Exemple #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public synchronized org.neo4j.causalclustering.core.consensus.outcome.ConsensusOutcome handle(RaftMessages_RaftMessage incomingMessage) throws java.io.IOException
        public virtual ConsensusOutcome Handle(RaftMessages_RaftMessage incomingMessage)
        {
            lock (this)
            {
                Outcome outcome = _currentRole.handler.handle(incomingMessage, _state, _log);

                bool newLeaderWasElected = LeaderChanged(outcome, _state.leader());

                _state.update(outcome);                     // updates to raft log happen within
                SendMessages(outcome);

                HandleTimers(outcome);
                HandleLogShipping(outcome);

                DriveMembership(outcome);

                _volatileLeader.set(outcome.Leader);

                if (newLeaderWasElected)
                {
                    NotifyLeaderChanges(outcome);
                }
                return(outcome);
            }
        }
Exemple #2
0
 public RaftMessages_Directed(MemberId to, RaftMessages_RaftMessage message)
 {
     this.ToConflict      = to;
     this.MessageConflict = message;
 }