Class LeaderSnapshot


  • public class LeaderSnapshot
    extends Object
    A snapshot of a leader and its view of the world.
    • Method Detail

      • getReplicas

        public Collection<ReplicaSnapshot> getReplicas()
        Get unmodifiable view of configured replicas.
        Returns:
        unmodifiable view of configured replicas.
      • getState

        public KetchLeader.State getState()
        Get current state of the leader.
        Returns:
        current state of the leader.
      • isIdle

        public boolean isIdle()
        Whether the leader is not running a round to reach consensus, and has no rounds queued.
        Returns:
        true if the leader is not running a round to reach consensus, and has no rounds queued.
      • getHead

        @Nullable
        public LogIndex getHead()
        Get end of the leader's log
        Returns:
        end of the leader's log; null if leader hasn't started up enough to begin its own election.
      • getCommitted

        @Nullable
        public LogIndex getCommitted()
        Get state the leader knows is committed on a majority of participant replicas
        Returns:
        state the leader knows is committed on a majority of participant replicas. Null until the leader instance has committed a log index within its own term.