Skip to content

Commit 06fb2d0

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. (cherry picked from commit ed1980f) Signed-off-by: Thomas Graves <[email protected]>
1 parent e51ce9a commit 06fb2d0

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
@@ -102,14 +102,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
102102
appContext
103103
}
104104

105-
def calculateAMMemory(newApp: GetNewApplicationResponse): Int = {
106-
val minResMemory = newApp.getMinimumResourceCapability().getMemory()
107-
val amMemory = ((args.amMemory / minResMemory) * minResMemory) +
108-
((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
109-
memoryOverhead)
110-
amMemory
111-
}
112-
113105
def setupSecurityToken(amContainer: ContainerLaunchContext) = {
114106
// Setup security tokens.
115107
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
@@ -309,8 +309,6 @@ trait ClientBase extends Logging {
309309
retval.toString
310310
}
311311

312-
def calculateAMMemory(newApp: GetNewApplicationResponse): Int
313-
314312
def setupSecurityToken(amContainer: ContainerLaunchContext)
315313

316314
def createContainerLaunchContext(
@@ -353,7 +351,7 @@ trait ClientBase extends Logging {
353351
}
354352
amContainer.setEnvironment(env)
355353

356-
val amMemory = calculateAMMemory(newApp)
354+
val amMemory = args.amMemory
357355

358356
val javaOpts = ListBuffer[String]()
359357

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)