public NetworkChannelsListenerAnonymousInnerClass(ClusterClientModule outerInstance, LogProvider logging, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory) { this.outerInstance = outerInstance; this._logging = logging; this._objectInputStreamFactory = objectInputStreamFactory; this._objectOutputStreamFactory = objectOutputStreamFactory; }
internal LearnerContextImpl(Org.Neo4j.cluster.InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, PaxosInstanceStore paxosInstances, AcceptorInstanceStore instanceStore, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, HeartbeatContext heartbeatContext) : base(me, commonState, logging, timeouts) { this._heartbeatContext = heartbeatContext; this._instanceStore = instanceStore; this._objectInputStreamFactory = objectInputStreamFactory; this._objectOutputStreamFactory = objectOutputStreamFactory; this._paxosInstances = paxosInstances; this._learnMissLogger = (new CappedLogger(logging.GetLog(typeof(LearnerState)))).setDuplicateFilterEnabled(true); }
internal ClusterContextImpl(InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, Executor executor, ObjectOutputStreamFactory objectOutputStreamFactory, ObjectInputStreamFactory objectInputStreamFactory, LearnerContext learnerContext, HeartbeatContext heartbeatContext, Config config) : base(me, commonState, logging, timeouts) { this._executor = executor; this._objectOutputStreamFactory = objectOutputStreamFactory; this._objectInputStreamFactory = objectInputStreamFactory; this._learnerContext = learnerContext; this._heartbeatContext = heartbeatContext; this._config = config; heartbeatContext.AddHeartbeatListener(new HeartbeatListener_AdapterAnonymousInnerClass(this)); }
private ClusterContextImpl(InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, IEnumerable <URI> joiningInstances, ClusterMessage.ConfigurationResponseState joinDeniedConfigurationResponseState, Executor executor, ObjectOutputStreamFactory objectOutputStreamFactory, ObjectInputStreamFactory objectInputStreamFactory, LearnerContext learnerContext, HeartbeatContext heartbeatContext, Config config) : base(me, commonState, logging, timeouts) { this._joiningInstances = joiningInstances; this._joinDeniedConfigurationResponseState = joinDeniedConfigurationResponseState; this._executor = executor; this._objectOutputStreamFactory = objectOutputStreamFactory; this._objectInputStreamFactory = objectInputStreamFactory; this._learnerContext = learnerContext; this._heartbeatContext = heartbeatContext; this._config = config; }
public PaxosClusterMemberAvailability(InstanceId myId, BindingNotifier binding, AtomicBroadcast atomicBroadcast, LogProvider logProvider, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory) { this._myId = myId; this._binding = binding; this._atomicBroadcast = atomicBroadcast; this._objectInputStreamFactory = objectInputStreamFactory; this._objectOutputStreamFactory = objectOutputStreamFactory; this._log = logProvider.getLog(this.GetType()); _bindingListener = me => { _serverClusterId = me; PaxosClusterMemberAvailability.this._log.info("Listening at:" + me); }; }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected: //ORIGINAL LINE: public PaxosClusterMemberEvents(final org.neo4j.cluster.protocol.snapshot.Snapshot snapshot, org.neo4j.cluster.protocol.cluster.Cluster cluster, org.neo4j.cluster.protocol.heartbeat.Heartbeat heartbeat, org.neo4j.cluster.protocol.atomicbroadcast.AtomicBroadcast atomicBroadcast, org.neo4j.logging.LogProvider logProvider, System.Predicate<ClusterMembersSnapshot> validator, System.Func<Iterable<MemberIsAvailable>, MemberIsAvailable, Iterable<MemberIsAvailable>> snapshotFilter, org.neo4j.cluster.protocol.atomicbroadcast.ObjectInputStreamFactory lenientObjectInputStream, org.neo4j.cluster.protocol.atomicbroadcast.ObjectOutputStreamFactory lenientObjectOutputStream, org.neo4j.helpers.NamedThreadFactory.Monitor namedThreadFactoryMonitor) public PaxosClusterMemberEvents(Snapshot snapshot, Cluster cluster, Heartbeat heartbeat, AtomicBroadcast atomicBroadcast, LogProvider logProvider, System.Predicate <ClusterMembersSnapshot> validator, System.Func <IEnumerable <MemberIsAvailable>, MemberIsAvailable, IEnumerable <MemberIsAvailable> > snapshotFilter, ObjectInputStreamFactory lenientObjectInputStream, ObjectOutputStreamFactory lenientObjectOutputStream, NamedThreadFactory.Monitor namedThreadFactoryMonitor) { this._snapshot = snapshot; this._cluster = cluster; this._heartbeat = heartbeat; this._atomicBroadcast = atomicBroadcast; this._lenientObjectInputStream = lenientObjectInputStream; this._lenientObjectOutputStream = lenientObjectOutputStream; this._namedThreadFactoryMonitor = namedThreadFactoryMonitor; this._log = logProvider.getLog(this.GetType()); _clusterListener = new ClusterListenerImpl(this); _atomicBroadcastListener = new AtomicBroadcastListenerImpl(this); this._snapshotValidator = validator; _clusterMembersSnapshot = new ClusterMembersSnapshot(snapshotFilter); }
public virtual LearnerContextImpl Snapshot(CommonContextState commonStateSnapshot, LogProvider logging, Timeouts timeouts, PaxosInstanceStore paxosInstancesSnapshot, AcceptorInstanceStore instanceStore, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, HeartbeatContextImpl snapshotHeartbeatContext) { return(new LearnerContextImpl(Me, commonStateSnapshot, logging, timeouts, _lastDeliveredInstanceId, _lastLearnedInstanceId, snapshotHeartbeatContext, instanceStore, objectInputStreamFactory, objectOutputStreamFactory, paxosInstancesSnapshot)); }
public AtomicBroadcastSerializer(ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory) { this._objectInputStreamFactory = objectInputStreamFactory; this._objectOutputStreamFactory = objectOutputStreamFactory; }
public virtual ClusterContextImpl Snapshot(CommonContextState commonStateSnapshot, LogProvider logging, Timeouts timeouts, Executor executor, ObjectOutputStreamFactory objectOutputStreamFactory, ObjectInputStreamFactory objectInputStreamFactory, LearnerContextImpl snapshotLearnerContext, HeartbeatContextImpl snapshotHeartbeatContext) { return(new ClusterContextImpl(Me, commonStateSnapshot, logging, timeouts, _joiningInstances == null ? null : new List <>(asList(_joiningInstances)), _joinDeniedConfigurationResponseState == null ? null : _joinDeniedConfigurationResponseState.snapshot(), executor, objectOutputStreamFactory, objectInputStreamFactory, snapshotLearnerContext, snapshotHeartbeatContext, _config)); }
public MultiPaxosContext(InstanceId me, IEnumerable <ElectionRole> roles, ClusterConfiguration configuration, Executor executor, LogProvider logging, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, AcceptorInstanceStore instanceStore, Timeouts timeouts, ElectionCredentialsProvider electionCredentialsProvider, Config config) { _commonState = new CommonContextState(configuration, config.Get(ClusterSettings.max_acceptors)); _paxosInstances = new PaxosInstanceStore(); _heartbeatContext = new HeartbeatContextImpl(me, _commonState, logging, timeouts, executor); _learnerContext = new LearnerContextImpl(me, _commonState, logging, timeouts, _paxosInstances, instanceStore, objectInputStreamFactory, objectOutputStreamFactory, _heartbeatContext); _clusterContext = new ClusterContextImpl(me, _commonState, logging, timeouts, executor, objectOutputStreamFactory, objectInputStreamFactory, _learnerContext, _heartbeatContext, config); _electionContext = new ElectionContextImpl(me, _commonState, logging, timeouts, roles, _clusterContext, _heartbeatContext, electionCredentialsProvider); _proposerContext = new ProposerContextImpl(me, _commonState, logging, timeouts, _paxosInstances, _heartbeatContext); _acceptorContext = new AcceptorContextImpl(me, _commonState, logging, timeouts, instanceStore); _atomicBroadcastContext = new AtomicBroadcastContextImpl(me, _commonState, logging, timeouts, executor, _heartbeatContext); _heartbeatContext.setCircularDependencies(_clusterContext, _learnerContext); }
/// <summary> /// Create a state snapshot. The snapshot will not duplicate services, and expects the caller to duplicate /// <seealso cref="AcceptorInstanceStore"/>, since that is externally provided. /// </summary> public virtual MultiPaxosContext Snapshot(LogProvider logging, Timeouts timeouts, Executor executor, AcceptorInstanceStore instanceStore, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, ElectionCredentialsProvider electionCredentialsProvider) { CommonContextState commonStateSnapshot = _commonState.snapshot(logging.GetLog(typeof(ClusterConfiguration))); PaxosInstanceStore paxosInstancesSnapshot = _paxosInstances.snapshot(); HeartbeatContextImpl snapshotHeartbeatContext = _heartbeatContext.snapshot(commonStateSnapshot, logging, timeouts, executor); LearnerContextImpl snapshotLearnerContext = _learnerContext.snapshot(commonStateSnapshot, logging, timeouts, paxosInstancesSnapshot, instanceStore, objectInputStreamFactory, objectOutputStreamFactory, snapshotHeartbeatContext); ClusterContextImpl snapshotClusterContext = _clusterContext.snapshot(commonStateSnapshot, logging, timeouts, executor, objectOutputStreamFactory, objectInputStreamFactory, snapshotLearnerContext, snapshotHeartbeatContext); ElectionContextImpl snapshotElectionContext = _electionContext.snapshot(commonStateSnapshot, logging, timeouts, snapshotClusterContext, snapshotHeartbeatContext, electionCredentialsProvider); ProposerContextImpl snapshotProposerContext = _proposerContext.snapshot(commonStateSnapshot, logging, timeouts, paxosInstancesSnapshot, _heartbeatContext); AcceptorContextImpl snapshotAcceptorContext = _acceptorContext.snapshot(commonStateSnapshot, logging, timeouts, instanceStore); AtomicBroadcastContextImpl snapshotAtomicBroadcastContext = _atomicBroadcastContext.snapshot(commonStateSnapshot, logging, timeouts, executor, snapshotHeartbeatContext); snapshotHeartbeatContext.SetCircularDependencies(snapshotClusterContext, snapshotLearnerContext); return(new MultiPaxosContext(snapshotProposerContext, snapshotAcceptorContext, snapshotLearnerContext, snapshotHeartbeatContext, snapshotElectionContext, snapshotAtomicBroadcastContext, commonStateSnapshot, paxosInstancesSnapshot, snapshotClusterContext)); }