File tree Expand file tree Collapse file tree
core/src/main/scala/org/apache/spark/rpc/netty Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,12 +343,20 @@ private[netty] class NettyRpcEnv(
343343 private def downloadClient (host : String , port : Int ): TransportClient = {
344344 if (fileDownloadFactory == null ) synchronized {
345345 if (fileDownloadFactory == null ) {
346+ val module = " files"
347+ val prefix = " spark.rpc.io."
346348 val clone = conf.clone()
347- conf.getOption(" spark.files.maxDownloadClients" ).foreach { v =>
348- clone.set(" spark.rpc.io.numConnectionsPerPeer" , v)
349+
350+ // Copy any RPC configuration that is not overridden in the spark.files namespace.
351+ conf.getAll.foreach { case (key, value) =>
352+ if (key.startsWith(prefix)) {
353+ val opt = key.substring(prefix.length())
354+ clone.setIfMissing(s " spark. $module.io. $opt" , value)
355+ }
349356 }
357+
350358 val ioThreads = clone.getInt(" spark.files.io.threads" , 1 )
351- val downloadConf = SparkTransportConf .fromSparkConf(clone, " rpc " , ioThreads)
359+ val downloadConf = SparkTransportConf .fromSparkConf(clone, module , ioThreads)
352360 val downloadContext = new TransportContext (downloadConf, new NoOpRpcHandler (), true )
353361 fileDownloadFactory = downloadContext.createClientFactory(createClientBootstraps())
354362 }
You can’t perform that action at this time.
0 commit comments