java.lang.Object
org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior
org.opendaylight.controller.cluster.raft.behaviors.Follower
All Implemented Interfaces:
AutoCloseable

public class Follower extends RaftActorBehavior
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 Details

  • Method Details

    • copy

      public final @NonNull Follower copy()
    • getLeaderId

      public final String getLeaderId()
      Description copied from class: RaftActorBehavior
      Returns the id of the leader.
      Specified by:
      getLeaderId in class RaftActorBehavior
      Returns:
      the id of the leader or null if not known
    • setLeaderId

      protected final void setLeaderId(@Nullable String leaderId)
    • getLeaderPayloadVersion

      public final short getLeaderPayloadVersion()
      Description copied from class: RaftActorBehavior
      Returns the leader's payload data version.
      Specified by:
      getLeaderPayloadVersion in class RaftActorBehavior
      Returns:
      a short representing the version
    • setLeaderPayloadVersion

      protected final void setLeaderPayloadVersion(short leaderPayloadVersion)
    • handleMessage

      public RaftActorBehavior handleMessage(org.apache.pekko.actor.ActorRef sender, Object message)
      Description copied from class: RaftActorBehavior
      Handle 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:
      handleMessage in class RaftActorBehavior
      Parameters:
      sender - The sender of the message
      message - 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:
      close in interface AutoCloseable
      Specified by:
      close in class RaftActorBehavior