Class LeaderSnapshot


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

      • LeaderSnapshot

        LeaderSnapshot()
    • Method Detail

      • getReplicas

        public java.util.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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • debug

        private static void debug​(java.lang.StringBuilder b,
                                  ReplicaSnapshot s)
      • debug

        private static void debug​(java.lang.StringBuilder s,
                                  java.lang.String name,
                                  ObjectId accepted,
                                  ObjectId committed)
      • str

        static java.lang.String str​(ObjectId c)