File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
core/src/main/scala/org/apache/spark/rpc Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -264,10 +264,17 @@ object RpcTimeout {
264
264
require(timeoutPropList.nonEmpty)
265
265
266
266
// Find the first set property or use the default value with the first property
267
- val foundProp = timeoutPropList.view.map(x => (x, conf.getOption(x))).filter(_._2.isDefined).
268
- map(y => (y._1, y._2.get)).headOption.getOrElse(timeoutPropList.head, defaultValue)
269
-
270
- val timeout = { Utils .timeStringAsSeconds(foundProp._2) seconds }
271
- new RpcTimeout (timeout, messagePrefix + foundProp._1)
267
+ val itr = timeoutPropList.iterator
268
+ var foundProp = None : Option [(String , String )]
269
+ while (itr.hasNext && foundProp.isEmpty){
270
+ val propKey = itr.next()
271
+ conf.getOption(propKey) match {
272
+ case Some (prop) => foundProp = Some (propKey,prop)
273
+ case None =>
274
+ }
275
+ }
276
+ val finalProp = foundProp.getOrElse(timeoutPropList.head, defaultValue)
277
+ val timeout = { Utils .timeStringAsSeconds(finalProp._2) seconds }
278
+ new RpcTimeout (timeout, messagePrefix + finalProp._1)
272
279
}
273
280
}
You can’t perform that action at this time.
0 commit comments