File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
java/org/apache/samza/config
scala/org/apache/samza/job/yarn Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ public class YarnConfig extends MapConfig {
8585 */
8686 public static final String AM_CONTAINER_LABEL = "yarn.am.container.label" ;
8787
88+ /**
89+ * Number of CPU cores to request from YARN for running the AM
90+ */
91+ public static final String AM_CONTAINER_MAX_CPU_CORES = "yarn.am.container.cpu.cores" ;
92+ private static final int DEFAULT_AM_CPU_CORES = 1 ;
93+
8894 /**
8995 * Determines the interval for the Heartbeat between the AM and the Yarn RM
9096 */
@@ -188,6 +194,10 @@ public String getAMContainerLabel() {
188194 return get (AM_CONTAINER_LABEL , null );
189195 }
190196
197+ public int getAMContainerMaxCpuCores () {
198+ return getInt (AM_CONTAINER_MAX_CPU_CORES , DEFAULT_AM_CPU_CORES );
199+ }
200+
191201 public String getAmOpts () {
192202 return get (AM_JVM_OPTIONS , "" );
193203 }
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class ClientHelper(conf: Configuration) extends Logging {
9292
9393 val packagePath = new Path (yarnConfig.getPackagePath)
9494 val mem = yarnConfig.getAMContainerMaxMemoryMb
95- val cpu = 1
95+ val cpu = yarnConfig.getAMContainerMaxCpuCores
9696 val queueName = Option (yarnConfig.getQueueName)
9797 val appMasterLabel = Option (yarnConfig.getAMContainerLabel)
9898
You can’t perform that action at this time.
0 commit comments