public interface LeadershipStore extends Store<LeadershipEvent,LeadershipStoreDelegate>
LeadershipService state.| Modifier and Type | Method and Description |
|---|---|
Leadership |
addRegistration(java.lang.String topic)
Adds registration for the local instance to be part of the leadership contest for topic.
|
Leadership |
getLeadership(java.lang.String topic)
Returns the current leadership for topic.
|
java.util.Map<java.lang.String,Leadership> |
getLeaderships()
Return current leadership for all topics.
|
boolean |
makeTopCandidate(java.lang.String topic,
NodeId nodeId)
Attempts to make a node the top candidate.
|
boolean |
moveLeadership(java.lang.String topic,
NodeId toNodeId)
Updates state so that given node is leader for a topic.
|
void |
removeRegistration(NodeId nodeId)
Unregisters an instance from all leadership contests.
|
void |
removeRegistration(java.lang.String topic)
Unregisters the local instance from leadership contest for topic.
|
hasDelegate, setDelegate, unsetDelegateLeadership addRegistration(java.lang.String topic)
topic - leadership topicvoid removeRegistration(java.lang.String topic)
topic - leadership topicvoid removeRegistration(NodeId nodeId)
nodeId - node identifierboolean moveLeadership(java.lang.String topic,
NodeId toNodeId)
topic - leadership topictoNodeId - identifier of the desired leadertrue if the transfer succeeded; false otherwise.
This method can return false if the node is not registered for the topicboolean makeTopCandidate(java.lang.String topic,
NodeId nodeId)
topic - leadership topicnodeId - node identifiertrue if the specified node is now the top candidate.
This method will return false if the node is not registered for the topicLeadership getLeadership(java.lang.String topic)
topic - leadership topicjava.util.Map<java.lang.String,Leadership> getLeaderships()