@@ -93,21 +93,21 @@ class ExecutorLauncher(args: ApplicationMasterArguments, conf: Configuration, sp
9393 appAttemptId = getApplicationAttemptId()
9494 resourceManager = registerWithResourceManager()
9595
96- // // do not override - hits https://issues.apache.org/jira/browse/HADOOP-8406
97- // // TODO: Uncomment when hadoop is on a version which has this fixed.
98- // val appMasterResponse: RegisterApplicationMasterResponse = registerApplicationMaster()
99- // // Compute number of threads for akka
100- // val minimumMemory = appMasterResponse.getMinimumResourceCapability().getMemory()
101- // // Additional memory overhead - in mb.
102- // val memoryOverhead = sparkConf.getInt("spark.yarn.container.memoryOverhead", 384)
103- //
104- // if (minimumMemory > 0) {
105- // val mem = args.executorMemory + memoryOverhead
106- // val numCore = (mem / minimumMemory) + (if (0 != (mem % minimumMemory)) 1 else 0)
107- // if (numCore > 0) {
108- // args.workerCores = numCore
109- // }
110- // }
96+ val appMasterResponse : RegisterApplicationMasterResponse = registerApplicationMaster()
97+
98+ // Compute number of threads for akka
99+ val minimumMemory = appMasterResponse.getMinimumResourceCapability().getMemory()
100+
101+ if (minimumMemory > 0 ) {
102+ val mem = args.executorMemory + sparkConf.getInt(" spark.yarn.container.memoryOverhead" , 384 )
103+ val numCore = (mem / minimumMemory) + ( if ( 0 != (mem % minimumMemory)) 1 else 0 )
104+
105+ if (numCore > 0 ) {
106+ // do not override - hits https://issues.apache.org/jira/browse/HADOOP-8406
107+ // TODO: Uncomment when hadoop is on a version which has this fixed.
108+ // args.workerCores = numCore
109+ }
110+ }
111111
112112 waitForSparkMaster()
113113
0 commit comments