File tree Expand file tree Collapse file tree 3 files changed +3
-18
lines changed
alpha/src/main/scala/org/apache/spark/deploy/yarn
main/scala/org/apache/spark/deploy/yarn
test/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 3 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ private[spark] class Client(
88
88
: ContainerLaunchContext = {
89
89
val containerContext = super .createContainerLaunchContext(newAppResponse)
90
90
val capability = Records .newRecord(classOf [Resource ])
91
- capability.setMemory(getAMMemory(newAppResponse) + amMemoryOverhead)
91
+ capability.setMemory(args.amMemory + amMemoryOverhead)
92
92
containerContext.setResource(capability)
93
93
containerContext
94
94
}
@@ -116,17 +116,6 @@ private[spark] class Client(
116
116
amContainer.setContainerTokens(ByteBuffer .wrap(dob.getData()))
117
117
}
118
118
119
- /**
120
- * Return the amount of memory for launching the ApplicationMaster container (MB).
121
- * GetNewApplicationResponse#getMinimumResourceCapability does not exist in the stable API.
122
- */
123
- override def getAMMemory (newAppResponse : GetNewApplicationResponse ): Int = {
124
- val minResMemory = newAppResponse.getMinimumResourceCapability().getMemory()
125
- val amMemory = ((args.amMemory / minResMemory) * minResMemory) +
126
- ((if ((args.amMemory % minResMemory) == 0 ) 0 else minResMemory) - amMemoryOverhead)
127
- amMemory
128
- }
129
-
130
119
/**
131
120
* Return the security token used by this client to communicate with the ApplicationMaster.
132
121
* If no security is enabled, the token returned by the report is null.
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ private[spark] trait ClientBase extends Logging {
66
66
throw new IllegalArgumentException (s " Required executor memory ( $executorMem MB) " +
67
67
s " is above the max threshold ( $maxMem MB) of this cluster! " )
68
68
}
69
- val amMem = getAMMemory(newAppResponse) + amMemoryOverhead
69
+ val amMem = args.amMemory + amMemoryOverhead
70
70
if (amMem > maxMem) {
71
71
throw new IllegalArgumentException (s " Required AM memory ( $amMem MB) " +
72
72
s " is above the max threshold ( $maxMem MB) of this cluster! " )
@@ -306,7 +306,7 @@ private[spark] trait ClientBase extends Logging {
306
306
val javaOpts = ListBuffer [String ]()
307
307
308
308
// Add Xmx for AM memory
309
- javaOpts += " -Xmx" + getAMMemory(newAppResponse) + " m"
309
+ javaOpts += " -Xmx" + args.amMemory + " m"
310
310
311
311
val tmpDir = new Path (Environment .PWD .$(), YarnConfiguration .DEFAULT_CONTAINER_TEMP_DIR )
312
312
javaOpts += " -Djava.io.tmpdir=" + tmpDir
@@ -476,9 +476,6 @@ private[spark] trait ClientBase extends Logging {
476
476
* If no security is enabled, the token returned by the report is null.
477
477
*/
478
478
protected def getClientToken (report : ApplicationReport ): String
479
-
480
- /** Return the amount of memory for launching the ApplicationMaster container (MB). */
481
- protected def getAMMemory (newAppResponse : GetNewApplicationResponse ): Int = args.amMemory
482
479
}
483
480
484
481
private [spark] object ClientBase extends Logging {
Original file line number Diff line number Diff line change @@ -237,7 +237,6 @@ class ClientBaseSuite extends FunSuite with Matchers {
237
237
val hadoopConf : Configuration ,
238
238
val sparkConf : SparkConf ,
239
239
val yarnConf : YarnConfiguration ) extends ClientBase {
240
- override def getAMMemory (newApp : GetNewApplicationResponse ): Int = ???
241
240
override def setupSecurityToken (amContainer : ContainerLaunchContext ): Unit = ???
242
241
override def submitApplication (): ApplicationId = ???
243
242
override def getApplicationReport (appId : ApplicationId ): ApplicationReport = ???
You can’t perform that action at this time.
0 commit comments