Пример #1
0
        public override ProtocolServer NewProtocolServer(InstanceId me, TimeoutStrategy timeoutStrategy, MessageSource input, MessageSender output, AcceptorInstanceStore acceptorInstanceStore, ElectionCredentialsProvider electionCredentialsProvider, Executor stateMachineExecutor, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, Config config)
        {
            DelayedDirectExecutor executor = new DelayedDirectExecutor(_logging);

            // Create state machines
            Timeouts timeouts = new Timeouts(timeoutStrategy);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.context.MultiPaxosContext context = new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.context.MultiPaxosContext(me, org.neo4j.helpers.collection.Iterables.iterable(new org.neo4j.cluster.protocol.election.ElectionRole(org.neo4j.cluster.protocol.cluster.ClusterConfiguration.COORDINATOR)), new org.neo4j.cluster.protocol.cluster.ClusterConfiguration(initialConfig.getName(), logging, initialConfig.getMemberURIs()), executor, logging, objectInputStreamFactory, objectOutputStreamFactory, acceptorInstanceStore, timeouts, electionCredentialsProvider, config);
            MultiPaxosContext context = new MultiPaxosContext(me, Iterables.iterable(new ElectionRole(ClusterConfiguration.COORDINATOR)), new ClusterConfiguration(_initialConfig.Name, _logging, _initialConfig.MemberURIs), executor, _logging, objectInputStreamFactory, objectOutputStreamFactory, acceptorInstanceStore, timeouts, electionCredentialsProvider, config);

            SnapshotContext snapshotContext = new SnapshotContext(context.ClusterContext, context.LearnerContext);

            return(NewProtocolServer(me, input, output, stateMachineExecutor, executor, timeouts, context, snapshotContext));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public ProtocolServer newProtocolServer(InstanceId me, org.neo4j.cluster.com.message.MessageSource input, org.neo4j.cluster.com.message.MessageSender output, java.util.concurrent.Executor stateMachineExecutor, DelayedDirectExecutor executor, org.neo4j.cluster.timeout.Timeouts timeouts, org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.context.MultiPaxosContext context, org.neo4j.cluster.protocol.snapshot.SnapshotContext snapshotContext)
        public virtual ProtocolServer NewProtocolServer(InstanceId me, MessageSource input, MessageSender output, Executor stateMachineExecutor, DelayedDirectExecutor executor, Timeouts timeouts, MultiPaxosContext context, SnapshotContext snapshotContext)
        {
            return(ConstructSupportingInfrastructureFor(me, input, output, executor, timeouts, stateMachineExecutor, context, new StateMachine[]
            {
                new StateMachine(context.AtomicBroadcastContext, typeof(AtomicBroadcastMessage), AtomicBroadcastState.start, _logging),
                new StateMachine(context.AcceptorContext, typeof(AcceptorMessage), AcceptorState.start, _logging),
                new StateMachine(context.ProposerContext, typeof(ProposerMessage), ProposerState.start, _logging),
                new StateMachine(context.LearnerContext, typeof(LearnerMessage), LearnerState.start, _logging),
                new StateMachine(context.HeartbeatContext, typeof(HeartbeatMessage), HeartbeatState.start, _logging),
                new StateMachine(context.ElectionContext, typeof(ElectionMessage), ElectionState.start, _logging),
                new StateMachine(snapshotContext, typeof(SnapshotMessage), SnapshotState.start, _logging),
                new StateMachine(context.ClusterContext, typeof(ClusterMessage), ClusterState.start, _logging)
            }));
        }