Class Follower
java.lang.Object
org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior
org.opendaylight.controller.cluster.raft.behaviors.Follower
- All Implemented Interfaces:
AutoCloseable
The behavior of a RaftActor in the Follower raft state.
- Respond to RPCs from candidates and leaders
- If election timeout elapses without receiving AppendEntries RPC from current leader or granting vote to candidate: convert to candidate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()final @NonNull Followercopy()final StringReturns the id of the leader.final shortReturns the leader's payload data version.handleMessage(ActorRef sender, Object message) Handle a message.protected final voidsetLeaderId(@Nullable String leaderId) protected final voidsetLeaderPayloadVersion(short leaderPayloadVersion) Methods inherited from class org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior
getReplicatedToAllIndex, raftRole, setReplicatedToAllIndex
-
Constructor Details
-
Follower
-
-
Method Details
-
copy
-
getLeaderId
Description copied from class:RaftActorBehaviorReturns the id of the leader.- Specified by:
getLeaderIdin classRaftActorBehavior- Returns:
- the id of the leader or null if not known
-
setLeaderId
-
getLeaderPayloadVersion
public final short getLeaderPayloadVersion()Description copied from class:RaftActorBehaviorReturns the leader's payload data version.- Specified by:
getLeaderPayloadVersionin classRaftActorBehavior- Returns:
- a short representing the version
-
setLeaderPayloadVersion
protected final void setLeaderPayloadVersion(short leaderPayloadVersion) -
handleMessage
Description copied from class:RaftActorBehaviorHandle a message. If the processing of the message warrants a state change then a new behavior should be returned otherwise this method should return the current behavior.- Overrides:
handleMessagein classRaftActorBehavior- Parameters:
sender- The sender of the messagemessage- A message that needs to be processed- Returns:
- The new behavior or current behavior, or null if the message was not handled.
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classRaftActorBehavior
-