Skip to content

Commit ed1980f

Browse files
Chris Copetgravescs
authored andcommitted
[SPARK-2140] Updating heap memory calculation for YARN stable and alpha.
Updated pull request, reflecting YARN stable and alpha states. I am getting intermittent test failures on my own test infrastructure. Is that tracked anywhere yet? Author: Chris Cope <[email protected]> Closes #2253 from copester/master and squashes the following commits: 5ad89da [Chris Cope] [SPARK-2140] Removing calculateAMMemory functions since they are no longer needed. 52b4e45 [Chris Cope] [SPARK-2140] Updating heap memory calculation for YARN stable and alpha.
1 parent c27718f commit ed1980f

File tree

4 files changed

+1
-23
lines changed

4 files changed

+1
-23
lines changed

yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
103103
appContext
104104
}
105105

106-
def calculateAMMemory(newApp: GetNewApplicationResponse): Int = {
107-
val minResMemory = newApp.getMinimumResourceCapability().getMemory()
108-
val amMemory = ((args.amMemory / minResMemory) * minResMemory) +
109-
((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
110-
memoryOverhead)
111-
amMemory
112-
}
113-
114106
def setupSecurityToken(amContainer: ContainerLaunchContext) = {
115107
// Setup security tokens.
116108
val dob = new DataOutputBuffer()

yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ trait ClientBase extends Logging {
300300
retval.toString
301301
}
302302

303-
def calculateAMMemory(newApp: GetNewApplicationResponse): Int
304-
305303
def setupSecurityToken(amContainer: ContainerLaunchContext)
306304

307305
def createContainerLaunchContext(
@@ -346,7 +344,7 @@ trait ClientBase extends Logging {
346344
}
347345
amContainer.setEnvironment(env)
348346

349-
val amMemory = calculateAMMemory(newApp)
347+
val amMemory = args.amMemory
350348

351349
val javaOpts = ListBuffer[String]()
352350

yarn/common/src/test/scala/org/apache/spark/deploy/yarn/ClientBaseSuite.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ class ClientBaseSuite extends FunSuite with Matchers {
238238
val sparkConf: SparkConf,
239239
val yarnConf: YarnConfiguration) extends ClientBase {
240240

241-
override def calculateAMMemory(newApp: GetNewApplicationResponse): Int =
242-
throw new UnsupportedOperationException()
243-
244241
override def setupSecurityToken(amContainer: ContainerLaunchContext): Unit =
245242
throw new UnsupportedOperationException()
246243

yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
103103
clusterMetrics.getNumNodeManagers)
104104
}
105105

106-
def calculateAMMemory(newApp: GetNewApplicationResponse) :Int = {
107-
// TODO: Need a replacement for the following code to fix -Xmx?
108-
// val minResMemory: Int = newApp.getMinimumResourceCapability().getMemory()
109-
// var amMemory = ((args.amMemory / minResMemory) * minResMemory) +
110-
// ((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
111-
// memoryOverhead )
112-
args.amMemory
113-
}
114-
115106
def setupSecurityToken(amContainer: ContainerLaunchContext) = {
116107
// Setup security tokens.
117108
val dob = new DataOutputBuffer()

0 commit comments

Comments
 (0)