Skip to content
Snippets Groups Projects
Commit ed1980ff authored by Chris Cope's avatar Chris Cope Committed by Thomas Graves
Browse files

[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 <ccope@resilientscience.com>

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.
parent c27718f3
No related branches found
No related tags found
No related merge requests found
...@@ -103,14 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa ...@@ -103,14 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
appContext appContext
} }
def calculateAMMemory(newApp: GetNewApplicationResponse): Int = {
val minResMemory = newApp.getMinimumResourceCapability().getMemory()
val amMemory = ((args.amMemory / minResMemory) * minResMemory) +
((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
memoryOverhead)
amMemory
}
def setupSecurityToken(amContainer: ContainerLaunchContext) = { def setupSecurityToken(amContainer: ContainerLaunchContext) = {
// Setup security tokens. // Setup security tokens.
val dob = new DataOutputBuffer() val dob = new DataOutputBuffer()
......
...@@ -300,8 +300,6 @@ trait ClientBase extends Logging { ...@@ -300,8 +300,6 @@ trait ClientBase extends Logging {
retval.toString retval.toString
} }
def calculateAMMemory(newApp: GetNewApplicationResponse): Int
def setupSecurityToken(amContainer: ContainerLaunchContext) def setupSecurityToken(amContainer: ContainerLaunchContext)
def createContainerLaunchContext( def createContainerLaunchContext(
...@@ -346,7 +344,7 @@ trait ClientBase extends Logging { ...@@ -346,7 +344,7 @@ trait ClientBase extends Logging {
} }
amContainer.setEnvironment(env) amContainer.setEnvironment(env)
val amMemory = calculateAMMemory(newApp) val amMemory = args.amMemory
val javaOpts = ListBuffer[String]() val javaOpts = ListBuffer[String]()
......
...@@ -238,9 +238,6 @@ class ClientBaseSuite extends FunSuite with Matchers { ...@@ -238,9 +238,6 @@ class ClientBaseSuite extends FunSuite with Matchers {
val sparkConf: SparkConf, val sparkConf: SparkConf,
val yarnConf: YarnConfiguration) extends ClientBase { val yarnConf: YarnConfiguration) extends ClientBase {
override def calculateAMMemory(newApp: GetNewApplicationResponse): Int =
throw new UnsupportedOperationException()
override def setupSecurityToken(amContainer: ContainerLaunchContext): Unit = override def setupSecurityToken(amContainer: ContainerLaunchContext): Unit =
throw new UnsupportedOperationException() throw new UnsupportedOperationException()
......
...@@ -103,15 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa ...@@ -103,15 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
clusterMetrics.getNumNodeManagers) clusterMetrics.getNumNodeManagers)
} }
def calculateAMMemory(newApp: GetNewApplicationResponse) :Int = {
// TODO: Need a replacement for the following code to fix -Xmx?
// val minResMemory: Int = newApp.getMinimumResourceCapability().getMemory()
// var amMemory = ((args.amMemory / minResMemory) * minResMemory) +
// ((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
// memoryOverhead )
args.amMemory
}
def setupSecurityToken(amContainer: ContainerLaunchContext) = { def setupSecurityToken(amContainer: ContainerLaunchContext) = {
// Setup security tokens. // Setup security tokens.
val dob = new DataOutputBuffer() val dob = new DataOutputBuffer()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment