aboutsummaryrefslogtreecommitdiff
path: root/yarn/common/src/main
diff options
context:
space:
mode:
authorSandy Ryza <sandy@cloudera.com>2014-07-21 13:15:46 -0500
committerThomas Graves <tgraves@apache.org>2014-07-21 13:15:46 -0500
commitf89cf65d7aced0bb387c05586f9f51cb29865022 (patch)
treeabf25e4025ad61c86bb04814abadc7710b3b13eb /yarn/common/src/main
parentcd273a238144a9a436219cd01250369586f5638b (diff)
downloadspark-f89cf65d7aced0bb387c05586f9f51cb29865022.tar.gz
spark-f89cf65d7aced0bb387c05586f9f51cb29865022.tar.bz2
spark-f89cf65d7aced0bb387c05586f9f51cb29865022.zip
SPARK-1707. Remove unnecessary 3 second sleep in YarnClusterScheduler
Author: Sandy Ryza <sandy@cloudera.com> Closes #634 from sryza/sandy-spark-1707 and squashes the following commits: 2f6e358 [Sandy Ryza] Default min registered executors ratio to .8 for YARN 354c630 [Sandy Ryza] Remove outdated comments c744ef3 [Sandy Ryza] Take out waitForInitialAllocations 2a4329b [Sandy Ryza] SPARK-1707. Remove unnecessary 3 second sleep in YarnClusterScheduler
Diffstat (limited to 'yarn/common/src/main')
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientClusterScheduler.scala10
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala5
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterScheduler.scala8
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala5
4 files changed, 11 insertions, 17 deletions
diff --git a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientClusterScheduler.scala b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientClusterScheduler.scala
index 15e8c21aa5..3474112ded 100644
--- a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientClusterScheduler.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientClusterScheduler.scala
@@ -37,14 +37,4 @@ private[spark] class YarnClientClusterScheduler(sc: SparkContext, conf: Configur
val retval = YarnAllocationHandler.lookupRack(conf, host)
if (retval != null) Some(retval) else None
}
-
- override def postStartHook() {
-
- super.postStartHook()
- // The yarn application is running, but the executor might not yet ready
- // Wait for a few seconds for the slaves to bootstrap and register with master - best case attempt
- // TODO It needn't after waitBackendReady
- Thread.sleep(2000L)
- logInfo("YarnClientClusterScheduler.postStartHook done")
- }
}
diff --git a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
index 1b37c4bb13..d8266f7b0c 100644
--- a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
@@ -30,6 +30,11 @@ private[spark] class YarnClientSchedulerBackend(
extends CoarseGrainedSchedulerBackend(scheduler, sc.env.actorSystem)
with Logging {
+ if (conf.getOption("spark.scheduler.minRegisteredExecutorsRatio").isEmpty) {
+ minRegisteredRatio = 0.8
+ ready = false
+ }
+
var client: Client = null
var appId: ApplicationId = null
diff --git a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterScheduler.scala b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterScheduler.scala
index 9ee53d797c..9aeca4a637 100644
--- a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterScheduler.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterScheduler.scala
@@ -47,14 +47,8 @@ private[spark] class YarnClusterScheduler(sc: SparkContext, conf: Configuration)
}
override def postStartHook() {
- val sparkContextInitialized = ApplicationMaster.sparkContextInitialized(sc)
+ ApplicationMaster.sparkContextInitialized(sc)
super.postStartHook()
- if (sparkContextInitialized){
- ApplicationMaster.waitForInitialAllocations()
- // Wait for a few seconds for the slaves to bootstrap and register with master - best case attempt
- // TODO It needn't after waitBackendReady
- Thread.sleep(3000L)
- }
logInfo("YarnClusterScheduler.postStartHook done")
}
}
diff --git a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala
index a04b08f43c..0ad1794d19 100644
--- a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala
@@ -27,6 +27,11 @@ private[spark] class YarnClusterSchedulerBackend(
sc: SparkContext)
extends CoarseGrainedSchedulerBackend(scheduler, sc.env.actorSystem) {
+ if (conf.getOption("spark.scheduler.minRegisteredExecutorsRatio").isEmpty) {
+ minRegisteredRatio = 0.8
+ ready = false
+ }
+
override def start() {
super.start()
var numExecutors = ApplicationMasterArguments.DEFAULT_NUMBER_EXECUTORS