Skip to content

Commit

Permalink
[SPARK-2140] Updating heap memory calculation for YARN stable and alpha.
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit ed1980f)
Signed-off-by: Thomas Graves <tgraves@apache.org>
  • Loading branch information
Chris Cope authored and tgravescs committed Sep 11, 2014
1 parent e51ce9a commit 06fb2d0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
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) = {
// Setup security tokens.
val dob = new DataOutputBuffer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ trait ClientBase extends Logging {
retval.toString
}

def calculateAMMemory(newApp: GetNewApplicationResponse): Int

def setupSecurityToken(amContainer: ContainerLaunchContext)

def createContainerLaunchContext(
Expand Down Expand Up @@ -353,7 +351,7 @@ trait ClientBase extends Logging {
}
amContainer.setEnvironment(env)

val amMemory = calculateAMMemory(newApp)
val amMemory = args.amMemory

val javaOpts = ListBuffer[String]()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ class ClientBaseSuite extends FunSuite with Matchers {
val sparkConf: SparkConf,
val yarnConf: YarnConfiguration) extends ClientBase {

override def calculateAMMemory(newApp: GetNewApplicationResponse): Int =
throw new UnsupportedOperationException()

override def setupSecurityToken(amContainer: ContainerLaunchContext): Unit =
throw new UnsupportedOperationException()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
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) = {
// Setup security tokens.
val dob = new DataOutputBuffer()
Expand Down

0 comments on commit 06fb2d0

Please sign in to comment.