diff options
author | echo2mei <534384876@qq.com> | 2015-12-25 17:42:24 -0800 |
---|---|---|
committer | Shixiong Zhu <shixiong@databricks.com> | 2015-12-25 17:42:24 -0800 |
commit | 1e97813951674aa5419744b455a4c7340462ac59 (patch) | |
tree | 64c23b848ab8ff9ae045a773b2e07c19899f34f3 | |
parent | ea4aab7e87fbcf9ac90f93af79cc892b56508aa0 (diff) | |
download | spark-1e97813951674aa5419744b455a4c7340462ac59.tar.gz spark-1e97813951674aa5419744b455a4c7340462ac59.tar.bz2 spark-1e97813951674aa5419744b455a4c7340462ac59.zip |
[SPARK-12396][CORE] Modify the function scheduleAtFixedRate to schedule.
Instead of just cancel the registrationRetryTimer to avoid driver retry connect to master, change the function to schedule.
It is no need to register to master iteratively.
Author: echo2mei <534384876@qq.com>
Closes #10447 from echoTomei/master.
-rw-r--r-- | core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala b/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala index 1e2f469214..a5753e1053 100644 --- a/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala +++ b/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala @@ -124,7 +124,7 @@ private[spark] class AppClient( */ private def registerWithMaster(nthRetry: Int) { registerMasterFutures.set(tryRegisterAllMasters()) - registrationRetryTimer.set(registrationRetryThread.scheduleAtFixedRate(new Runnable { + registrationRetryTimer.set(registrationRetryThread.schedule(new Runnable { override def run(): Unit = { Utils.tryOrExit { if (registered.get) { @@ -138,7 +138,7 @@ private[spark] class AppClient( } } } - }, REGISTRATION_TIMEOUT_SECONDS, REGISTRATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)) + }, REGISTRATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)) } /** |