diff options
Diffstat (limited to 'yarn/src/main/scala/org/apache/spark/scheduler/cluster/SchedulerExtensionService.scala')
-rw-r--r-- | yarn/src/main/scala/org/apache/spark/scheduler/cluster/SchedulerExtensionService.scala | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/scheduler/cluster/SchedulerExtensionService.scala b/yarn/src/main/scala/org/apache/spark/scheduler/cluster/SchedulerExtensionService.scala index c064521845..c4757e335b 100644 --- a/yarn/src/main/scala/org/apache/spark/scheduler/cluster/SchedulerExtensionService.scala +++ b/yarn/src/main/scala/org/apache/spark/scheduler/cluster/SchedulerExtensionService.scala @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicBoolean import org.apache.hadoop.yarn.api.records.{ApplicationAttemptId, ApplicationId} import org.apache.spark.{Logging, SparkContext} +import org.apache.spark.deploy.yarn.config._ import org.apache.spark.util.Utils /** @@ -103,20 +104,15 @@ private[spark] class SchedulerExtensionServices extends SchedulerExtensionServic val attemptId = binding.attemptId logInfo(s"Starting Yarn extension services with app $appId and attemptId $attemptId") - serviceOption = sparkContext.getConf.getOption(SchedulerExtensionServices.SPARK_YARN_SERVICES) - services = serviceOption - .map { s => - s.split(",").map(_.trim()).filter(!_.isEmpty) - .map { sClass => - val instance = Utils.classForName(sClass) - .newInstance() - .asInstanceOf[SchedulerExtensionService] - // bind this service - instance.start(binding) - logInfo(s"Service $sClass started") - instance - }.toList - }.getOrElse(Nil) + services = sparkContext.conf.get(SCHEDULER_SERVICES).map { sClass => + val instance = Utils.classForName(sClass) + .newInstance() + .asInstanceOf[SchedulerExtensionService] + // bind this service + instance.start(binding) + logInfo(s"Service $sClass started") + instance + }.toList } /** @@ -144,11 +140,3 @@ private[spark] class SchedulerExtensionServices extends SchedulerExtensionServic | services=$services, | started=$started)""".stripMargin } - -private[spark] object SchedulerExtensionServices { - - /** - * A list of comma separated services to instantiate in the scheduler - */ - val SPARK_YARN_SERVICES = "spark.yarn.services" -} |