Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/2432#discussion_r18313707
--- Diff:
yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala
---
@@ -48,6 +48,17 @@ private[spark] class YarnClusterSchedulerBackend(
totalRegisteredExecutors.get() >= totalExpectedExecutors *
minRegisteredRatio
}
- override def applicationId(): Option[String] =
sc.getConf.getOption("spark.yarn.app.id")
+ override def applicationId() =
+ /**
+ * In YARN Cluster mode, spark.yarn.app.id is expect to be set
+ * before user application is launched.
+ * So, if spark.yarn.app.id is not set, it is something wrong.
+ */
+ sc.getConf.getOption("spark.yarn.app.id")
+ .map(strAppId => new ApplicationId(strAppId))
+ .getOrElse {
+ logError("Application ID is not set.")
+ super.applicationId
+ }
--- End diff --
indentation is weird
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]