Class Follower

java.lang.Object
io.permazen.kv.raft.Follower

public class Follower extends Object
Contains information maintained by leaders about followers.
  • Field Details

  • Method Details

    • getIdentity

      public String getIdentity()
      Get the identity of this follower.
      Returns:
      follower identity
    • getAddress

      public String getAddress()
      Get the address of this follower.
      Returns:
      follower address
    • getNextIndex

      public long getNextIndex()
      Get the index of the next log entry to send to this follower.
      Returns:
      follower next index
    • getMatchIndex

      public long getMatchIndex()
      Get the index of the highest log entry in the follower's log known to match the leader's log.
      Returns:
      follower match index; will be zero if unknown
    • getLeaderTimestamp

      public Timestamp getLeaderTimestamp()
      Get the most recent (leader's) request timestamp returned by this follower in a response, if any.
      Returns:
      follower leader timestamp, or null if no response has been received yet from this follower
    • getSnapshotTimestamp

      public Timestamp getSnapshotTimestamp()
      Get the (leader's) timestamp of the most recent snapshot install sent to this follower, if any.
      Returns:
      follower leader timestamp, or null if no response has been received yet from this follower
    • getLeaderCommit

      public long getLeaderCommit()
      Get the leader commit index most recently sent to this follower.
      Returns:
      follower leader commit index
    • isSynced

      public boolean isSynced()
      Determine whether we believe this follower is "synchronized".

      By "synchronized" we mean the most recently received AppendResponse indicated a successful match of the previous log entry. We only send "probes" to unsynchronized followers.

      Returns:
      true if synchronized
    • isReceivingSnapshot

      public boolean isReceivingSnapshot()
      Determine whether this follower is currently being sent a whole database snapshot download.
      Returns:
      true if snapshot install is in progress
    • toString

      public String toString()
      Overrides:
      toString in class Object