public interface LeaderElectionService
| Modifier and Type | Method and Description |
|---|---|
void |
confirmLeaderSessionID(UUID leaderSessionID)
Confirms that the new leader session ID has been successfully received by the new leader.
|
boolean |
hasLeadership(UUID leaderSessionId)
Returns true if the
LeaderContender with which the service has been started owns
currently the leadership under the given leader session id. |
void |
start(LeaderContender contender)
Starts the leader election service.
|
void |
stop()
Stops the leader election service.
|
void start(LeaderContender contender) throws Exception
contender - LeaderContender which applies for the leadershipExceptionvoid confirmLeaderSessionID(UUID leaderSessionID)
LeaderContender.
The rational behind this method is to establish an order between setting the new leader
session ID in the LeaderContender and publishing the new leader session ID to the
leader retrieval services.leaderSessionID - The new leader session IDboolean hasLeadership(@Nonnull UUID leaderSessionId)
LeaderContender with which the service has been started owns
currently the leadership under the given leader session id.leaderSessionId - identifying the current leaderLeaderContender is the leader, otherwise falseCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.