Interface LeaderContender
-
- All Known Implementing Classes:
DefaultDispatcherRunner
,DispatcherRestEndpoint
,JobMasterServiceLeadershipRunner
,MiniDispatcherRestEndpoint
,ResourceManagerServiceImpl
,WebMonitorEndpoint
public interface LeaderContender
Interface which has to be implemented to take part in the leader election process of theLeaderElectionService
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
grantLeadership(UUID leaderSessionID)
Callback method which is called by theLeaderElectionService
upon selecting this instance as the new leader.void
handleError(Exception exception)
Callback method which is called byLeaderElectionService
in case of an error in the service thread.void
revokeLeadership()
Callback method which is called by theLeaderElectionService
upon revoking the leadership of a former leader.
-
-
-
Method Detail
-
grantLeadership
void grantLeadership(UUID leaderSessionID)
Callback method which is called by theLeaderElectionService
upon selecting this instance as the new leader. The method is called with the new leader session ID.- Parameters:
leaderSessionID
- New leader session ID
-
revokeLeadership
void revokeLeadership()
Callback method which is called by theLeaderElectionService
upon revoking the leadership of a former leader. This might happen in case that multiple contenders have been granted leadership.
-
handleError
void handleError(Exception exception)
Callback method which is called byLeaderElectionService
in case of an error in the service thread.- Parameters:
exception
- Caught exception
-
-