Skip to content

Commit

Permalink
[CARMEL-3499] Change vCores to 1 in ContainerRequest for hadoop limit (
Browse files Browse the repository at this point in the history
…#17)

* [CARMEL-3499] Change vCores to 1 in ContainerRequest for hadoop limit

* change the default value of DEFAULT_RESOURCE_CALCULATOR to false
  • Loading branch information
Luan, Xuedong authored and mingmwang committed Aug 11, 2020
1 parent 171868b commit e933ef6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ private[yarn] class YarnAllocator(
resource: Resource,
nodes: Array[String],
racks: Array[String]): ContainerRequest = {
if (sparkConf.get(DEFAULT_RESOURCE_CALCULATOR)) {
resource.setVirtualCores(1)
}
new ContainerRequest(resource, nodes, racks, RM_REQUEST_PRIORITY, true, labelExpression.orNull)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ package object config {
.timeConf(TimeUnit.MILLISECONDS)
.createWithDefaultString("1s")

private[spark] val DEFAULT_RESOURCE_CALCULATOR =
ConfigBuilder("spark.yarn.scheduler.default.resource.calculator")
.doc("After enable default resource calculator, the value of vCores " +
"in ContainerRequest is always 1.")
.booleanConf
.createWithDefault(false)

/* Shared Client-mode AM / Driver configuration. */

private[spark] val AM_MAX_WAIT_TIME = ConfigBuilder("spark.yarn.am.waitTime")
Expand Down

0 comments on commit e933ef6

Please sign in to comment.