zjf2012 commented on a change in pull request #23560: [SPARK-26632][Core] 
Separate Thread Configurations of Driver and Executor
URL: https://github.com/apache/spark/pull/23560#discussion_r264488007
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/network/netty/SparkTransportConf.scala
 ##########
 @@ -39,13 +39,18 @@ object SparkTransportConf {
    */
   def fromSparkConf(_conf: SparkConf, module: String, numUsableCores: Int = 
0): TransportConf = {
     val conf = _conf.clone
-
-    // Specify thread configuration based on our JVM's allocation of cores 
(rather than necessarily
-    // assuming we have all the machine's cores).
-    // NB: Only set if serverThreads/clientThreads not already set.
+    val executorId = conf.get("spark.executor.id", "")
+    val isDriver = executorId == SparkContext.DRIVER_IDENTIFIER ||
+          executorId == SparkContext.LEGACY_DRIVER_IDENTIFIER
+    val role = if (isDriver) "driver" else "executor"
 
 Review comment:
   @vanzin , I get your point. Actually, @jerryshao also pointed out the 
similar problem and told me to introduce "role" to make code clear. At the 
time, I tried to make the "role" as explicit argument to this method. However, 
it involves in a lot of code changes in many areas to get right "role".  It's 
not a simple task to be covered in this PR.  It seems that they don't want this 
PR to be that complex. Maybe we can do it when "role" is clearly defined in 
worker, master, driver etc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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]

Reply via email to