Extraordinarily minor code/comment cleanup
This commit is contained in:
parent
440e531a5e
commit
1ab031eaff
|
@ -18,12 +18,12 @@
|
||||||
package org.apache.spark.deploy.master
|
package org.apache.spark.deploy.master
|
||||||
|
|
||||||
import scala.collection.JavaConversions._
|
import scala.collection.JavaConversions._
|
||||||
import scala.concurrent.ops._
|
|
||||||
|
import org.apache.zookeeper._
|
||||||
|
import org.apache.zookeeper.Watcher.Event.KeeperState
|
||||||
|
import org.apache.zookeeper.data.Stat
|
||||||
|
|
||||||
import org.apache.spark.Logging
|
import org.apache.spark.Logging
|
||||||
import org.apache.zookeeper._
|
|
||||||
import org.apache.zookeeper.data.Stat
|
|
||||||
import org.apache.zookeeper.Watcher.Event.KeeperState
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a Scala-side interface to the standard ZooKeeper client, with the addition of retry
|
* Provides a Scala-side interface to the standard ZooKeeper client, with the addition of retry
|
||||||
|
@ -33,7 +33,7 @@ import org.apache.zookeeper.Watcher.Event.KeeperState
|
||||||
* informed via zkDown().
|
* informed via zkDown().
|
||||||
*
|
*
|
||||||
* Additionally, all commands sent to ZooKeeper will be retried until they either fail too many
|
* Additionally, all commands sent to ZooKeeper will be retried until they either fail too many
|
||||||
* times or a semantic exception is thrown (e.g.., "node already exists").
|
* times or a semantic exception is thrown (e.g., "node already exists").
|
||||||
*/
|
*/
|
||||||
private[spark] class SparkZooKeeperSession(zkWatcher: SparkZooKeeperWatcher) extends Logging {
|
private[spark] class SparkZooKeeperSession(zkWatcher: SparkZooKeeperWatcher) extends Logging {
|
||||||
val ZK_URL = System.getProperty("spark.deploy.zookeeper.url", "")
|
val ZK_URL = System.getProperty("spark.deploy.zookeeper.url", "")
|
||||||
|
@ -179,7 +179,7 @@ private[spark] class SparkZooKeeperSession(zkWatcher: SparkZooKeeperWatcher) ext
|
||||||
} catch {
|
} catch {
|
||||||
case e: KeeperException.NoNodeException => throw e
|
case e: KeeperException.NoNodeException => throw e
|
||||||
case e: KeeperException.NodeExistsException => throw e
|
case e: KeeperException.NodeExistsException => throw e
|
||||||
case e if n > 0 =>
|
case e: Exception if n > 0 =>
|
||||||
logError("ZooKeeper exception, " + n + " more retries...", e)
|
logError("ZooKeeper exception, " + n + " more retries...", e)
|
||||||
Thread.sleep(RETRY_WAIT_MILLIS)
|
Thread.sleep(RETRY_WAIT_MILLIS)
|
||||||
retry(fn, n-1)
|
retry(fn, n-1)
|
||||||
|
|
|
@ -21,8 +21,8 @@ import akka.actor.ActorRef
|
||||||
import org.apache.zookeeper._
|
import org.apache.zookeeper._
|
||||||
import org.apache.zookeeper.Watcher.Event.EventType
|
import org.apache.zookeeper.Watcher.Event.EventType
|
||||||
|
|
||||||
import org.apache.spark.deploy.master.MasterMessages._
|
|
||||||
import org.apache.spark.Logging
|
import org.apache.spark.Logging
|
||||||
|
import org.apache.spark.deploy.master.MasterMessages._
|
||||||
|
|
||||||
private[spark] class ZooKeeperLeaderElectionAgent(val masterActor: ActorRef, masterUrl: String)
|
private[spark] class ZooKeeperLeaderElectionAgent(val masterActor: ActorRef, masterUrl: String)
|
||||||
extends LeaderElectionAgent with SparkZooKeeperWatcher with Logging {
|
extends LeaderElectionAgent with SparkZooKeeperWatcher with Logging {
|
||||||
|
@ -105,7 +105,7 @@ private[spark] class ZooKeeperLeaderElectionAgent(val masterActor: ActorRef, mas
|
||||||
// We found a different master file pointing to this process.
|
// We found a different master file pointing to this process.
|
||||||
// This can happen in the following two cases:
|
// This can happen in the following two cases:
|
||||||
// (1) The master process was restarted on the same node.
|
// (1) The master process was restarted on the same node.
|
||||||
// (2) The ZK server died between creating the node and returning the name of the node.
|
// (2) The ZK server died between creating the file and returning the name of the file.
|
||||||
// For this case, we will end up creating a second file, and MUST explicitly delete the
|
// For this case, we will end up creating a second file, and MUST explicitly delete the
|
||||||
// first one, since our ZK session is still open.
|
// first one, since our ZK session is still open.
|
||||||
// Note that this deletion will cause a NodeDeleted event to be fired so we check again for
|
// Note that this deletion will cause a NodeDeleted event to be fired so we check again for
|
||||||
|
|
Loading…
Reference in a new issue