zjf2012 commented on a change in pull request #23560: [SPARK-26632][Spark Core]
Separate Thread Configurations of Driver and Executor
URL: https://github.com/apache/spark/pull/23560#discussion_r248179316
##########
File path:
core/src/main/scala/org/apache/spark/network/netty/SparkTransportConf.scala
##########
@@ -55,4 +57,31 @@ object SparkTransportConf {
}
})
}
+
+ /**
+ * Separate threads configuration of driver and executor
+ * @param conf the [[SparkConf]]
+ * @param module the module name
+ * @param server if true, it's for the serverThreads. Otherwise, it's for
the clientThreads.
+ * @param defaultNumThreads default number of threads
+ * @return
+ */
+ def getNumOfThreads(
+ conf: SparkConf,
+ module: String,
+ server: Boolean,
+ defaultNumThreads: Int): String = {
+
+ val isDriver = conf.get("spark.executor.id", "") ==
SparkContext.DRIVER_IDENTIFIER
+ val side = if (isDriver) "driver" else "executor"
+
+ val num =
+ if (server) {
+ conf.getInt(s"spark.$side.$module.io.serverThreads", defaultNumThreads)
+ } else {
+ conf.getInt(s"spark.$side.$module.io.clientThreads", defaultNumThreads)
+ }
+
+ if(num > 0) num.toString else defaultNumThreads.toString
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]