|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.inria.myriads.snoozenode.groupmanager.leadelection.api.impl.ZooKeeperLeaderElection
public final class ZooKeeperLeaderElection
Leader election implementation based on the Apache ZooKeeper coordination service. Inspired by the great tutorials at: http://zookeeper.apache.org/doc/r3.3.1/recipes.html#sc_leaderElection http://dengyin2000.iteye.com/blog/858939
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher |
---|
org.apache.zookeeper.Watcher.Event |
Constructor Summary | |
---|---|
ZooKeeperLeaderElection(ZooKeeperSettings zooKeeperParameters,
org.inria.myriads.snoozecommon.communication.groupmanager.GroupManagerDescription groupManagerDescription,
LeaderElectionListener listener)
Leader election based on ZooKeeper. |
Method Summary | |
---|---|
void |
process(org.apache.zookeeper.WatchedEvent event)
Processes the watcher event. |
void |
run()
Run method. |
void |
start()
Starts the leader election. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZooKeeperLeaderElection(ZooKeeperSettings zooKeeperParameters, org.inria.myriads.snoozecommon.communication.groupmanager.GroupManagerDescription groupManagerDescription, LeaderElectionListener listener) throws Exception
zooKeeperParameters
- The zookeeper parametersgroupManagerDescription
- The group manager descriptionlistener
- The leader election listener
Exception
Method Detail |
---|
public void run()
run
in interface Runnable
public void process(org.apache.zookeeper.WatchedEvent event)
process
in interface org.apache.zookeeper.Watcher
event
- The watched eventpublic void start()
start
in interface LeaderElection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |