Class IsolatedLeader
- java.lang.Object
-
- org.opendaylight.controller.cluster.raft.behaviors.AbstractRaftActorBehavior
-
- org.opendaylight.controller.cluster.raft.behaviors.AbstractLeader
-
- org.opendaylight.controller.cluster.raft.behaviors.IsolatedLeader
-
- All Implemented Interfaces:
AutoCloseable
,RaftActorBehavior
public class IsolatedLeader extends AbstractLeader
Leader which is termed as isolated.If the reply from the majority of the followers is not received then the leader changes its behavior to IsolatedLeader. An isolated leader may have followers and they would continue to receive replicated messages.
A schedule is run, at an interval of (10 * Heartbeat-time-interval), in the Leader to check if its isolated or not.
In the Isolated Leader , on every AppendEntriesReply, we aggressively check if the leader is isolated. If no, then the state is switched back to Leader.
-
-
Field Summary
-
Fields inherited from class org.opendaylight.controller.cluster.raft.behaviors.AbstractRaftActorBehavior
context, log
-
-
Constructor Summary
Constructors Constructor Description IsolatedLeader(RaftActorContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RaftActorBehavior
handleAppendEntriesReply(ActorRef sender, AppendEntriesReply appendEntriesReply)
Derived classes should not directly handle AppendEntriesReply messages it should let the base class handle it first.-
Methods inherited from class org.opendaylight.controller.cluster.raft.behaviors.AbstractLeader
addFollower, beforeSendHeartbeat, close, followerLogSize, getFollower, getFollowerIds, getLeaderId, getLeaderPayloadVersion, getMinIsolatedLeaderPeerCount, handleAppendEntries, handleMessage, handleRequestVoteReply, initiateCaptureSnapshot, isLeaderIsolated, printFollowerStates, removeFollower, sendAppendEntries, updateMinReplicaCount
-
Methods inherited from class org.opendaylight.controller.cluster.raft.behaviors.AbstractRaftActorBehavior
actor, appendEntries, applyLogToStateMachine, canGrantVote, canStartElection, createBehavior, currentTerm, electionDuration, getId, getLogEntryIndex, getLogEntryOrSnapshotTerm, getLogEntryTerm, getMajorityVoteCount, getReplicatedToAllIndex, internalSwitchBehavior, internalSwitchBehavior, lastIndex, lastTerm, logName, performSnapshotWithoutCapture, requestVote, scheduleElection, setReplicatedToAllIndex, shouldUpdateTerm, state, stopElection, switchBehavior, votedFor
-
-
-
-
Constructor Detail
-
IsolatedLeader
public IsolatedLeader(RaftActorContext context)
-
-
Method Detail
-
handleAppendEntriesReply
protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender, AppendEntriesReply appendEntriesReply)
Description copied from class:AbstractRaftActorBehavior
Derived classes should not directly handle AppendEntriesReply messages it should let the base class handle it first. Once the base class handles the AppendEntriesReply message and does the common actions that are applicable in all RaftState's it will delegate the handling of the AppendEntriesReply message to the derived class to do more state specific handling by calling this method- Overrides:
handleAppendEntriesReply
in classAbstractLeader
- Parameters:
sender
- The actor that sent this messageappendEntriesReply
- The AppendEntriesReply message- Returns:
- a new behavior if it was changed or the current behavior
-
-