Class StateManager

    • Field Detail

      • senderStates

        protected java.util.HashMap<java.lang.Integer,​ApplicationState> senderStates
      • senderViews

        protected java.util.HashMap<java.lang.Integer,​View> senderViews
      • senderRegencies

        protected java.util.HashMap<java.lang.Integer,​java.lang.Integer> senderRegencies
      • senderLeaders

        protected java.util.HashMap<java.lang.Integer,​java.lang.Integer> senderLeaders
      • senderProofs

        protected java.util.HashMap<java.lang.Integer,​CertifiedDecision> senderProofs
      • appStateOnly

        protected boolean appStateOnly
      • waitingCID

        protected int waitingCID
      • queryID

        protected int queryID
      • lastCID

        protected int lastCID
      • isInitializing

        protected boolean isInitializing
      • queries

        protected java.util.Map<java.lang.Integer,​java.util.Map<java.lang.Integer,​java.lang.Integer>> queries
    • Constructor Detail

      • StateManager

        public StateManager()
    • Method Detail

      • getReplies

        protected int getReplies()
      • enoughReplies

        protected boolean enoughReplies()
      • enoughRegencies

        protected boolean enoughRegencies​(int regency)
      • enoughLeaders

        protected boolean enoughLeaders​(int leader)
      • enoughViews

        protected boolean enoughViews​(View view)
      • enoughProofs

        protected boolean enoughProofs​(int cid,
                                       LCManager lc)
      • reset

        protected void reset()
        Clear the collections and state hold by this object. Calls clear() in the States, Leaders, regencies and Views collections. Sets the state to null;
      • receivedStates

        public java.util.Collection<ApplicationState> receivedStates()
      • setLastCID

        public void setLastCID​(int cid)
      • getLastCID

        public int getLastCID()
      • requestAppState

        public void requestAppState​(int cid)
      • analyzeState

        public void analyzeState​(int cid)
      • isRetrievingState

        public boolean isRetrievingState()
      • askCurrentConsensusId

        public void askCurrentConsensusId()
      • currentConsensusIdAsked

        public void currentConsensusIdAsked​(int sender,
                                            int id)
      • currentConsensusIdReceived

        public void currentConsensusIdReceived​(SMMessage smsg)
      • triggerTimeout

        public void triggerTimeout​(SMMessage msg)
      • requestState

        protected abstract void requestState()
        Request the state to the other replicas. It should ask for the state defined in the 'waitingCID' variable.
      • stateTimeout

        public abstract void stateTimeout()
        To use if the state manager needs to use timeout for liveness and when such timeout expires. To trigger the invocation, the method 'triggerTimeout' should be invoked by the class extending StateManager supplying an SMMessage of type 'TRIGGER_SM_LOCALLY'
      • SMRequestDeliver

        public abstract void SMRequestDeliver​(SMMessage msg,
                                              boolean isBFT)
        Invoked when a replica is asking to be sent the application state.
        Parameters:
        msg - The message sent by the replica, of type 'SM_REQUEST'.
        isBFT - true if the library is set for BFT, false if CFT
      • SMReplyDeliver

        public abstract void SMReplyDeliver​(SMMessage msg,
                                            boolean isBFT)
        Invoked when a replica receives a reply to its request to be sent the application state.
        Parameters:
        msg - The message sent by the replica, of type 'SM_REPLY'.
        isBFT - true if the library is set for BFT, false if CFT