Class Acceptor


  • public final class Acceptor
    extends java.lang.Object
    This class represents the acceptor role in the consensus protocol. This class work together with the TOMLayer class in order to supply a atomic multicast service.
    • Constructor Detail

      • Acceptor

        public Acceptor​(ServerCommunicationSystem communication,
                        MessageFactory factory,
                        ServerViewController controller)
        Creates a new instance of Acceptor.
        Parameters:
        communication - Replicas communication system
        factory - Message factory for PaW messages
        controller - sever view controller
    • Method Detail

      • setExecutionManager

        public void setExecutionManager​(ExecutionManager manager)
        Sets the execution manager for this acceptor
        Parameters:
        manager - Execution manager for this acceptor
      • setTOMLayer

        public void setTOMLayer​(TOMLayer tom)
        Sets the TOM layer for this acceptor
        Parameters:
        tom - TOM layer for this acceptor
      • deliver

        public final void deliver​(ConsensusMessage msg)
        Called by communication layer to delivery Paxos messages. This method only verifies if the message can be executed and calls process message (storing it on an out of context message buffer if this is not the case)
        Parameters:
        msg - Paxos messages delivered by the communication layer
      • processMessage

        public final void processMessage​(ConsensusMessage msg)
        Called when a Consensus message is received or when a out of context message must be processed. It processes the received message according to its type
        Parameters:
        msg - The message to be processed
      • proposeReceived

        public void proposeReceived​(Epoch epoch,
                                    ConsensusMessage msg)
        Called when a PROPOSE message is received or when processing a formerly out of context propose which is know belongs to the current consensus.
        Parameters:
        msg - The PROPOSE message to by processed
      • sendRequestDecision

        public void sendRequestDecision​(Epoch epoch,
                                        int cid,
                                        int[] receivers,
                                        byte[] value)
        Send a REQ_DECISION to others
        Parameters:
        epoch - the current epoch
        cid - consensus id
        receivers - the replicas that are asked
        value - epoch.propValueHash
      • verifyDecision

        public boolean verifyDecision​(ConsensusMessage msg)
        verifyDecision takes a FORWARDED-DECISION message and checks if the contained decision can be verified using the attached proof. The proof is a set of ACCEPT messages which
        Parameters:
        msg - a Consensus Message: must be a FORWARD-DECISION
        Returns:
        if the FORWARD-DECISION is good