Modifier and Type | Method and Description |
---|---|
LeaderElection |
LeaderElection.finish()
Mark as 'shouldFinish' not to schedule ZooKeeper callbacks
any further.
|
LeaderElection |
LeaderElection.setAclList(List<org.apache.zookeeper.data.ACL> list)
Set the ACL list used for creation of the znode for leader election.
|
LeaderElection |
LeaderElection.setId(String id)
Set the ID that represents this candidate in leader election.
|
LeaderElection |
LeaderElection.setListener(LeaderElection.Listener listener)
Set the listener for leader election events.
|
LeaderElection |
LeaderElection.setPath(String path)
Set the znode path used for leader election.
|
LeaderElection |
LeaderElection.setZooKeeper(org.apache.zookeeper.ZooKeeper zooKeeper)
Set the
ZooKeeper instance used for leader election. |
LeaderElection |
LeaderElection.start()
Start leader election.
|
Modifier and Type | Method and Description |
---|---|
void |
LeaderElection.Listener.onFinish(LeaderElection election)
Called when it is detected that callback should not be called
any more.
|
void |
LeaderElection.Adapter.onFinish(LeaderElection election) |
void |
LeaderElection.Listener.onLose(LeaderElection election)
Called when it is detected that another candidate is the leader.
|
void |
LeaderElection.Adapter.onLose(LeaderElection election) |
void |
LeaderElection.Listener.onStateChanged(LeaderElection election,
LeaderElection.State oldState,
LeaderElection.State newState)
Called when the state of the leader election changed.
|
void |
LeaderElection.Adapter.onStateChanged(LeaderElection election,
LeaderElection.State oldState,
LeaderElection.State newState) |
void |
LeaderElection.Listener.onVacant(LeaderElection election)
Called when it is detected that a leader does not exist.
|
void |
LeaderElection.Adapter.onVacant(LeaderElection election) |
void |
LeaderElection.Listener.onWin(LeaderElection election)
Called when this candidate won a leader election.
|
void |
LeaderElection.Adapter.onWin(LeaderElection election) |
Copyright © 2015. All rights reserved.