Esempio n. 1
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings invalidDict = new ActionBindings();

            invalidDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings invalidWaitingDict = new ActionBindings();

            invalidWaitingDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings sharingDict = new ActionBindings();

            sharingDict.Add(typeof(eStop), new Action(Stop));
            sharingDict.Add(typeof(eAskShare), new Action(Ack));

            ActionBindings shareWaitingDict = new ActionBindings();

            shareWaitingDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings exclusiveDict = new ActionBindings();

            exclusiveDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Invalid), invalidDict);
            dict.Add(typeof(InvalidWaiting), invalidWaitingDict);
            dict.Add(typeof(Sharing), sharingDict);
            dict.Add(typeof(ShareWaiting), shareWaitingDict);
            dict.Add(typeof(Exclusive), exclusiveDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings electionTimeoutDict = new ActionBindings();

            electionTimeoutDict.Add(typeof(eQueryElectionTimeout), new Action(CheckElectionTimeout));
            electionTimeoutDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings heartBeatingDict = new ActionBindings();

            heartBeatingDict.Add(typeof(eQueryHeartBeating), new Action(CheckHeartBeat));
            heartBeatingDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings clientTimeoutDict = new ActionBindings();

            clientTimeoutDict.Add(typeof(eQueryClientTimeout), new Action(CheckClientTimeout));
            clientTimeoutDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(ElectionTimeout), electionTimeoutDict);
            dict.Add(typeof(HeartBeating), heartBeatingDict);
            dict.Add(typeof(ClientTimeout), clientTimeoutDict);

            return(dict);
        }
Esempio n. 3
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings activeDict = new ActionBindings();

            activeDict.Add(typeof(eCreateAccount), new Action(CreateAccount));
            activeDict.Add(typeof(eCloseAccount), new Action(CloseAccount));
            activeDict.Add(typeof(eWithdraw), new Action(Withdraw));
            activeDict.Add(typeof(eDeposit), new Action(Deposit));
            activeDict.Add(typeof(eTransfer), new Action(Transfer));
            activeDict.Add(typeof(eBalanceInquiry), new Action(BalanceInquiry));
            activeDict.Add(typeof(eUnlock), new Action(UnlockAccount));
            activeDict.Add(typeof(eLock), new Action(LockAccount));
            activeDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings waitingAccountToCloseDict = new ActionBindings();

            waitingAccountToCloseDict.Add(typeof(eCloseAck), new Action(CloseAccountAck));

            dict.Add(typeof(Active), activeDict);
            dict.Add(typeof(WaitingAccountToClose), waitingAccountToCloseDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings activeDict = new ActionBindings();

            activeDict.Add(typeof(eBoot), new Action(Boot));
            activeDict.Add(typeof(eSum), new Action(Sum));

            dict.Add(typeof(Active), activeDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings activeDict = new ActionBindings();

            activeDict.Add(typeof(eIntervals), new Action(Intervals));
            activeDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Active), activeDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings waitingDict = new ActionBindings();

            waitingDict.Add(typeof(eFindSuccessor), new Action(FindSuccessor));
            waitingDict.Add(typeof(eJoinAck), new Action(QueryStabilize));

            dict.Add(typeof(Waiting), waitingDict);

            return(dict);
        }
Esempio n. 7
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings syncDict = new ActionBindings();

            syncDict.Add(typeof(eReq), new Action(CountReq));
            syncDict.Add(typeof(eDone), new Action(CheckIfDone));

            dict.Add(typeof(Sync), syncDict);

            return(dict);
        }
Esempio n. 8
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings waitDict = new ActionBindings();

            waitDict.Add(typeof(ePrepare), new Action(Prepare));
            waitDict.Add(typeof(eAccept), new Action(Accept));
            waitDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Wait), waitDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings waitingDict = new ActionBindings();

            waitingDict.Add(typeof(eQueryIdResp), new Action(ReceiveSuccessorId));
            waitingDict.Add(typeof(eFindSuccessorResp), new Action(SuccessorFound));
            waitingDict.Add(typeof(eStop), new Action(Stopping));

            dict.Add(typeof(Waiting), waitingDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings loopDict = new ActionBindings();

            loopDict.Add(typeof(eGLOBAL_ABORT), new Action(HandleGlobalAbort));
            loopDict.Add(typeof(eGLOBAL_COMMIT), new Action(HandleGlobalCommit));
            loopDict.Add(typeof(eREQ_REPLICA), new Action(HandleReqReplica));

            dict.Add(typeof(Loop), loopDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings queryingDict = new ActionBindings();

            queryingDict.Add(typeof(eClientTimedOut), new Action(SendNewQuery));
            queryingDict.Add(typeof(eClientHasNotTimedOut), new Action(QueryClientTimeout));
            queryingDict.Add(typeof(eClientReqAck), new Action(ProcessesResponse));
            queryingDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Querying), queryingDict);

            return(dict);
        }
Esempio n. 12
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings waitDict = new ActionBindings();

            waitDict.Add(typeof(eMonitorClientSent), new Action(AddClientSet));
            waitDict.Add(typeof(eMonitorProposerSent), new Action(AddProposerSet));
            waitDict.Add(typeof(eMonitorProposerChosen), new Action(CheckChosenValidity));
            waitDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Wait), waitDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings initDict = new ActionBindings();

            initDict.Add(typeof(eMONITOR_WRITE), new Action(DoWrite));
            initDict.Add(typeof(eMONITOR_READ_SUCCESS), new Action(CheckReadSuccess));
            initDict.Add(typeof(eMONITOR_READ_UNAVAILABLE), new Action(CheckReadUnavailable));
            initDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Init), initDict);

            return(dict);
        }
Esempio n. 14
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings startingDict = new ActionBindings();

            startingDict.Add(typeof(eHook), new Action(Hook));
            startingDict.Add(typeof(eGetNumber), new Action(GetNumber));
            startingDict.Add(typeof(eGetCount), new Action(GetCount));
            startingDict.Add(typeof(eGetString), new Action(GetString));
            startingDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Starting), startingDict);

            return(dict);
        }
Esempio n. 15
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings activeDict = new ActionBindings();

            activeDict.Add(typeof(eWithdraw), new Action(Withdraw));
            activeDict.Add(typeof(eDeposit), new Action(Deposit));
            activeDict.Add(typeof(eTransfer), new Action(Transfer));
            activeDict.Add(typeof(eBalanceInquiry), new Action(BalanceInquiry));
            activeDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Active), activeDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings joiningDict = new ActionBindings();

            joiningDict.Add(typeof(eQueryId), new Action(SendId));

            ActionBindings waitingDict = new ActionBindings();

            waitingDict.Add(typeof(eQueryId), new Action(SendId));
            waitingDict.Add(typeof(eStabilize), new Action(Stabilize));
            waitingDict.Add(typeof(eFindPredecessor), new Action(SendPredecessor));
            waitingDict.Add(typeof(eFindSuccessor), new Action(FindSuccessor));
            waitingDict.Add(typeof(eFindSuccessorResp), new Action(SuccessorFound));
            waitingDict.Add(typeof(eNotifySuccessor), new Action(UpdatePredecessor));
            waitingDict.Add(typeof(eFindPredecessorResp), new Action(UpdateSuccessor));
            waitingDict.Add(typeof(eAskForKeys), new Action(SendCorrespondingKeys));
            waitingDict.Add(typeof(eAskForKeysAck), new Action(UpdateKeys));
            waitingDict.Add(typeof(eFail), new Action(Failing));
            waitingDict.Add(typeof(eStop), new Action(Stopping));

            dict.Add(typeof(Joining), joiningDict);
            dict.Add(typeof(Waiting), waitingDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings runningDict = new ActionBindings();

            runningDict.Add(typeof(eRequestVote), new Action(PropagateVote));
            runningDict.Add(typeof(eRequestVoteAck), new Action(PropagateVoteAck));
            runningDict.Add(typeof(eClientReq), new Action(PropagateClientRequest));
            runningDict.Add(typeof(eAppendEntriesAck), new Action(PropagateAppendEntriesAck));
            runningDict.Add(typeof(eUpdateLeader), new Action(UpdateLeader));

            dict.Add(typeof(Running), runningDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings loopDict = new ActionBindings();

            loopDict.Add(typeof(eWRITE_REQ), new Action(DoWrite));
            loopDict.Add(typeof(eREAD_REQ), new Action(DoRead));

            ActionBindings countVoteDict = new ActionBindings();

            countVoteDict.Add(typeof(eREAD_REQ), new Action(DoRead));
            countVoteDict.Add(typeof(eRESP_REPLICA_ABORT), new Action(HandleAbort));

            dict.Add(typeof(Loop), loopDict);
            dict.Add(typeof(CountVote), countVoteDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings timerStartedDict = new ActionBindings();

            timerStartedDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(TimerStarted), timerStartedDict);

            return(dict);
        }
Esempio n. 20
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings sendLeaderDict = new ActionBindings();

            sendLeaderDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(SendLeader), sendLeaderDict);

            return(dict);
        }
Esempio n. 21
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings checkValueProposedDict = new ActionBindings();

            checkValueProposedDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(CheckValueProposed), checkValueProposedDict);

            return(dict);
        }
Esempio n. 22
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings initDict = new ActionBindings();

            initDict.Add(typeof(eAllNodes), new Action(UpdateAcceptors));

            // Action bindings for PerformOperation
            ActionBindings performOperationDict = new ActionBindings();

            // Proposer
            performOperationDict.Add(typeof(eUpdate), new Action(CheckIfLeader));
            // Acceptor
            performOperationDict.Add(typeof(ePrepare), new Action(Prepare));
            performOperationDict.Add(typeof(eAccept), new Action(Accept));
            // Leader Election
            performOperationDict.Add(typeof(ePing), new Action(ForwardToLE));
            performOperationDict.Add(typeof(eNewLeader), new Action(UpdateLeader));
            performOperationDict.Add(typeof(eStop), new Action(Stop));

            // Action bindings for ProposeValuePhase1
            ActionBindings proposeValuePhase1Dict = new ActionBindings();

            proposeValuePhase1Dict.Add(typeof(eAgree), new Action(CheckCountAgree));
            proposeValuePhase1Dict.Add(typeof(ePrepare), new Action(Prepare));

            // Action bindings for ProposeValuePhase2
            ActionBindings proposeValuePhase2Dict = new ActionBindings();

            proposeValuePhase2Dict.Add(typeof(eAccepted), new Action(CheckCountAccepted));
            proposeValuePhase2Dict.Add(typeof(eAccept), new Action(Accept));

            dict.Add(typeof(Init), initDict);
            dict.Add(typeof(PerformOperation), performOperationDict);
            dict.Add(typeof(ProposeValuePhase1), proposeValuePhase1Dict);
            dict.Add(typeof(ProposeValuePhase2), proposeValuePhase2Dict);

            return(dict);
        }
Esempio n. 23
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings bootingDict = new ActionBindings();

            bootingDict.Add(typeof(eHook), new Action(Hook));
            bootingDict.Add(typeof(eGetCountAck), new Action(ProcessPostRoundResults));
            bootingDict.Add(typeof(eGetStringAck), new Action(HandleGetStringAck));
            bootingDict.Add(typeof(eGetNumberAck), new Action(HandleGetNumberAck));

            ActionBindings secondRoundDict = new ActionBindings();

            secondRoundDict.Add(typeof(eHook), new Action(Hook));
            secondRoundDict.Add(typeof(eGetCountAck), new Action(ProcessPostRoundResults));
            secondRoundDict.Add(typeof(eGetStringAck), new Action(HandleGetStringAck));
            secondRoundDict.Add(typeof(eGetNumberAck), new Action(HandleGetNumberAck));

            dict.Add(typeof(Booting), bootingDict);
            dict.Add(typeof(SecondRound), secondRoundDict);

            return(dict);
        }
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings followerDict = new ActionBindings();

            followerDict.Add(typeof(eElectionTimedOut), new Action(ProcessElectionTimeout));
            followerDict.Add(typeof(eElectionHasNotTimedOut), new Action(QueryElectionTimeout));
            followerDict.Add(typeof(eRequestVote), new Action(ProcessVote));
            followerDict.Add(typeof(eAppendEntries), new Action(ProcessAppendEntries));
            followerDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings candidateDict = new ActionBindings();

            candidateDict.Add(typeof(eElectionTimedOut), new Action(ProcessElectionTimeout));
            candidateDict.Add(typeof(eElectionHasNotTimedOut), new Action(QueryElectionTimeout));
            candidateDict.Add(typeof(eRequestVote), new Action(ProcessVote));
            candidateDict.Add(typeof(eRequestVoteAck), new Action(ProcessVoteAck));
            candidateDict.Add(typeof(eAppendEntries), new Action(ProcessAppendEntries));
            candidateDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings leaderDict = new ActionBindings();

            leaderDict.Add(typeof(eSendHeartBeat), new Action(ProcessHeartBeat));
            leaderDict.Add(typeof(eDoNotSendHeartBeat), new Action(QueryHeartBeat));
            leaderDict.Add(typeof(eAppendEntries), new Action(ProcessAppendEntries));
            leaderDict.Add(typeof(eAppendEntriesAck), new Action(ProcessAppendEntriesAck));
            leaderDict.Add(typeof(eClientReq), new Action(ProcessClientReq));
            leaderDict.Add(typeof(eUpdateLeader), new Action(UpdateLeaderInformation));
            leaderDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Follower), followerDict);
            dict.Add(typeof(Candidate), candidateDict);
            dict.Add(typeof(Leader), leaderDict);

            return(dict);
        }
Esempio n. 25
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings loopDict = new ActionBindings();

            loopDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings startedDict = new ActionBindings();

            startedDict.Add(typeof(eStop), new Action(Stop));

            dict.Add(typeof(Loop), loopDict);
            dict.Add(typeof(Started), startedDict);

            return(dict);
        }
Esempio n. 26
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings proposeValuePhase1Dict = new ActionBindings();

            proposeValuePhase1Dict.Add(typeof(eAgree), new Action(CheckCountAgree));

            ActionBindings proposeValuePhase2Dict = new ActionBindings();

            proposeValuePhase2Dict.Add(typeof(eAccepted), new Action(CheckCountAccepted));

            dict.Add(typeof(ProposeValuePhase1), proposeValuePhase1Dict);
            dict.Add(typeof(ProposeValuePhase2), proposeValuePhase2Dict);

            return(dict);
        }
Esempio n. 27
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings initDict = new ActionBindings();

            initDict.Add(typeof(eInit), new Action(InitAction));

            ActionBindings sendCountDict = new ActionBindings();

            sendCountDict.Add(typeof(eMyCount), new Action(ConfirmThatInSync));

            dict.Add(typeof(Init), initDict);
            dict.Add(typeof(SendCount), sendCountDict);

            return(dict);
        }
Esempio n. 28
0
        protected override Dictionary <Type, ActionBindings> DefineActionBindings()
        {
            Dictionary <Type, ActionBindings> dict = new Dictionary <Type, ActionBindings>();

            ActionBindings receivingDict = new ActionBindings();

            receivingDict.Add(typeof(eStop), new Action(Stop));

            ActionBindings checkingInvariantDict = new ActionBindings();

            checkingInvariantDict.Add(typeof(eInvalidateAck), new Action(RecAck));

            dict.Add(typeof(Receiving), receivingDict);
            dict.Add(typeof(CheckingInvariant), checkingInvariantDict);

            return(dict);
        }