diff options
author | Weiqing Yang <yangweiqing001@gmail.com> | 2016-11-15 13:14:17 -0800 |
---|---|---|
committer | Marcelo Vanzin <vanzin@cloudera.com> | 2016-11-15 13:14:17 -0800 |
commit | 5bcb9a7ff4bdd7dac75481a951cd7da2133a2e2d (patch) | |
tree | b644a76719729e67c8e83140f7eb5db510bc35e8 /yarn/src/main/scala | |
parent | 2afdaa9805f44b45242978eab9a9623d31dddbf3 (diff) | |
download | spark-5bcb9a7ff4bdd7dac75481a951cd7da2133a2e2d.tar.gz spark-5bcb9a7ff4bdd7dac75481a951cd7da2133a2e2d.tar.bz2 spark-5bcb9a7ff4bdd7dac75481a951cd7da2133a2e2d.zip |
[SPARK-18417][YARN] Define 'spark.yarn.am.port' in yarn config object
## What changes were proposed in this pull request?
This PR is to define 'spark.yarn.am.port' in yarn config.scala just like other Yarn configurations. That makes code easier to maintain.
## How was this patch tested?
Build passed & tested some Yarn unit tests.
Author: Weiqing Yang <yangweiqing001@gmail.com>
Closes #15858 from weiqingy/yarn.
Diffstat (limited to 'yarn/src/main/scala')
-rw-r--r-- | yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala | 2 | ||||
-rw-r--r-- | yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala index 918cc2dd04..0378ef4fac 100644 --- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala +++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala @@ -429,7 +429,7 @@ private[spark] class ApplicationMaster( } private def runExecutorLauncher(securityMgr: SecurityManager): Unit = { - val port = sparkConf.getInt("spark.yarn.am.port", 0) + val port = sparkConf.get(AM_PORT) rpcEnv = RpcEnv.create("sparkYarnAM", Utils.localHostName, port, sparkConf, securityMgr, clientMode = true) val driverRef = waitForSparkDriver() diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala index ca8c89043a..666cb456a9 100644 --- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala +++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala @@ -40,6 +40,11 @@ package object config { .timeConf(TimeUnit.MILLISECONDS) .createOptional + private[spark] val AM_PORT = + ConfigBuilder("spark.yarn.am.port") + .intConf + .createWithDefault(0) + private[spark] val EXECUTOR_ATTEMPT_FAILURE_VALIDITY_INTERVAL_MS = ConfigBuilder("spark.yarn.executor.failuresValidityInterval") .doc("Interval after which Executor failures will be considered independent and not " + |