@@ -197,19 +197,16 @@ private[rpc] class RpcTimeoutException(message: String, cause: TimeoutException)
197
197
* Associates a timeout with a description so that a when a TimeoutException occurs, additional
198
198
* context about the timeout can be amended to the exception message.
199
199
* @param timeout timeout duration in seconds
200
- * @param description description to be displayed in a timeout exception
200
+ * @param conf the configuration parameter that controls this timeout
201
201
*/
202
- private [spark] class RpcTimeout (timeout : FiniteDuration , description : String ) {
202
+ private [spark] class RpcTimeout (timeout : FiniteDuration , val conf : String ) {
203
203
204
204
/** Get the timeout duration */
205
205
def duration : FiniteDuration = timeout
206
206
207
- /** Get the message associated with this timeout */
208
- def message : String = description
209
-
210
207
/** Amends the standard message of TimeoutException to include the description */
211
208
private def createRpcTimeoutException (te : TimeoutException ): RpcTimeoutException = {
212
- new RpcTimeoutException (te.getMessage() + " " + description , te)
209
+ new RpcTimeoutException (te.getMessage() + " . This timeout is controlled by " + conf , te)
213
210
}
214
211
215
212
/**
@@ -244,8 +241,6 @@ private[spark] class RpcTimeout(timeout: FiniteDuration, description: String) {
244
241
245
242
private [spark] object RpcTimeout {
246
243
247
- private [this ] val messagePrefix = " This timeout is controlled by "
248
-
249
244
/**
250
245
* Lookup the timeout property in the configuration and create
251
246
* a RpcTimeout with the property key in the description.
@@ -255,7 +250,7 @@ private[spark] object RpcTimeout {
255
250
*/
256
251
def apply (conf : SparkConf , timeoutProp : String ): RpcTimeout = {
257
252
val timeout = { conf.getTimeAsSeconds(timeoutProp) seconds }
258
- new RpcTimeout (timeout, messagePrefix + timeoutProp)
253
+ new RpcTimeout (timeout, timeoutProp)
259
254
}
260
255
261
256
/**
@@ -268,7 +263,7 @@ private[spark] object RpcTimeout {
268
263
*/
269
264
def apply (conf : SparkConf , timeoutProp : String , defaultValue : String ): RpcTimeout = {
270
265
val timeout = { conf.getTimeAsSeconds(timeoutProp, defaultValue) seconds }
271
- new RpcTimeout (timeout, messagePrefix + timeoutProp)
266
+ new RpcTimeout (timeout, timeoutProp)
272
267
}
273
268
274
269
/**
@@ -292,6 +287,6 @@ private[spark] object RpcTimeout {
292
287
}
293
288
val finalProp = foundProp.getOrElse(timeoutPropList.head, defaultValue)
294
289
val timeout = { Utils .timeStringAsSeconds(finalProp._2) seconds }
295
- new RpcTimeout (timeout, messagePrefix + finalProp._1)
290
+ new RpcTimeout (timeout, finalProp._1)
296
291
}
297
292
}
0 commit comments