Package io.hekate.election
Interface LeaderContext
-
- All Superinterfaces:
HekateSupport
public interface LeaderContext extends HekateSupport
Leader state context forCandidate
.For more details about the leader election process please see the documentation of
ElectionService
interface.- See Also:
Candidate.becomeLeader(LeaderContext)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClusterNode
localNode()
Returns the local node where theCandidate
is running.void
yieldLeadership()
Asynchronously yields leadership and gives othercandidates
a chance to become a leader.-
Methods inherited from interface io.hekate.core.HekateSupport
hekate
-
-
-
-
Method Detail
-
localNode
ClusterNode localNode()
Returns the local node where theCandidate
is running.- Returns:
- Local node.
-
yieldLeadership
void yieldLeadership()
Asynchronously yields leadership and gives othercandidates
a chance to become a leader.Note that this method is asynchronous and all of its activities are preformed on a background thread. Once operation completes then
Candidate.becomeFollower(FollowerContext)
orCandidate.becomeLeader(LeaderContext)
method will be called depending on new leader election results.
-
-