@@ -197,19 +197,16 @@ private[rpc] class RpcTimeoutException(message: String, cause: TimeoutException)
197197 * Associates a timeout with a description so that a when a TimeoutException occurs, additional
198198 * context about the timeout can be amended to the exception message.
199199 * @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
201201 */
202- private [spark] class RpcTimeout (timeout : FiniteDuration , description : String ) {
202+ private [spark] class RpcTimeout (timeout : FiniteDuration , val conf : String ) {
203203
204204 /** Get the timeout duration */
205205 def duration : FiniteDuration = timeout
206206
207- /** Get the message associated with this timeout */
208- def message : String = description
209-
210207 /** Amends the standard message of TimeoutException to include the description */
211208 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)
213210 }
214211
215212 /**
@@ -244,8 +241,6 @@ private[spark] class RpcTimeout(timeout: FiniteDuration, description: String) {
244241
245242private [spark] object RpcTimeout {
246243
247- private [this ] val messagePrefix = " This timeout is controlled by "
248-
249244 /**
250245 * Lookup the timeout property in the configuration and create
251246 * a RpcTimeout with the property key in the description.
@@ -255,7 +250,7 @@ private[spark] object RpcTimeout {
255250 */
256251 def apply (conf : SparkConf , timeoutProp : String ): RpcTimeout = {
257252 val timeout = { conf.getTimeAsSeconds(timeoutProp) seconds }
258- new RpcTimeout (timeout, messagePrefix + timeoutProp)
253+ new RpcTimeout (timeout, timeoutProp)
259254 }
260255
261256 /**
@@ -268,7 +263,7 @@ private[spark] object RpcTimeout {
268263 */
269264 def apply (conf : SparkConf , timeoutProp : String , defaultValue : String ): RpcTimeout = {
270265 val timeout = { conf.getTimeAsSeconds(timeoutProp, defaultValue) seconds }
271- new RpcTimeout (timeout, messagePrefix + timeoutProp)
266+ new RpcTimeout (timeout, timeoutProp)
272267 }
273268
274269 /**
@@ -292,6 +287,6 @@ private[spark] object RpcTimeout {
292287 }
293288 val finalProp = foundProp.getOrElse(timeoutPropList.head, defaultValue)
294289 val timeout = { Utils .timeStringAsSeconds(finalProp._2) seconds }
295- new RpcTimeout (timeout, messagePrefix + finalProp._1)
290+ new RpcTimeout (timeout, finalProp._1)
296291 }
297292}
0 commit comments