internal CausalClusteringBeanImpl(ManagementData management, bool isMXBean) : base(management, isMXBean) { ClusterStateDirectory = management.ResolveDependency(typeof(ClusterStateDirectory)); RaftMachine = management.ResolveDependency(typeof(RaftMachine)); Fs = management.KernelData.FilesystemAbstraction; }
public IdReusabilityCondition(CommandIndexTracker commandIndexTracker, RaftMachine raftMachine, MemberId myself) { this._commandIndexTracker = commandIndexTracker; this._raftMachine = raftMachine; this._myself = myself; raftMachine.RegisterListener(this); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturnFollower() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldReturnFollower() { // given RaftMachine raft = mock(typeof(RaftMachine)); when(raft.Leader).thenReturn(false); RoleProcedure proc = new CoreRoleProcedure(raft); // when RawIterator <object[], ProcedureException> result = proc.Apply(null, null, null); // then assertEquals(RoleInfo.FOLLOWER.name(), Single(result)[0]); }
public ReplicationModule(RaftMachine raftMachine, MemberId myself, PlatformModule platformModule, Config config, Outbound <MemberId, Org.Neo4j.causalclustering.core.consensus.RaftMessages_RaftMessage> outbound, File clusterStateDirectory, FileSystemAbstraction fileSystem, LogProvider logProvider, AvailabilityGuard globalAvailabilityGuard, LocalDatabase localDatabase) { LifeSupport life = platformModule.Life; DurableStateStorage <GlobalSessionTrackerState> sessionTrackerStorage; sessionTrackerStorage = life.Add(new DurableStateStorage <>(fileSystem, clusterStateDirectory, SESSION_TRACKER_NAME, new GlobalSessionTrackerState.Marshal(new MemberId.Marshal()), config.Get(CausalClusteringSettings.global_session_tracker_state_size), logProvider)); _sessionTracker = new SessionTracker(sessionTrackerStorage); GlobalSession myGlobalSession = new GlobalSession(System.Guid.randomUUID(), myself); LocalSessionPool sessionPool = new LocalSessionPool(myGlobalSession); _progressTracker = new ProgressTrackerImpl(myGlobalSession); Duration initialBackoff = config.Get(CausalClusteringSettings.replication_retry_timeout_base); Duration upperBoundBackoff = config.Get(CausalClusteringSettings.replication_retry_timeout_limit); TimeoutStrategy progressRetryStrategy = new ExponentialBackoffStrategy(initialBackoff, upperBoundBackoff); long availabilityTimeoutMillis = config.Get(CausalClusteringSettings.replication_retry_timeout_base).toMillis(); _replicator = new RaftReplicator(raftMachine, myself, outbound, sessionPool, _progressTracker, progressRetryStrategy, availabilityTimeoutMillis, globalAvailabilityGuard, logProvider, localDatabase, platformModule.Monitors); }
public RaftLogPruner(RaftMachine raftMachine, CommandApplicationProcess applicationProcess, Clock clock) { this._raftMachine = raftMachine; this._applicationProcess = applicationProcess; this._clock = clock; }
public CoreRoleProcedure(RaftMachine raft) : base() { this._raft = raft; }
internal LeaderIdReusabilityCondition(CommandIndexTracker commandIndexTracker, RaftMachine raftMachine) { this.CommandIndexTracker = commandIndexTracker; // Get highest command id seen this.CommandIdWhenBecameLeader = raftMachine.State().lastLogIndexBeforeWeBecameLeader(); }
internal LeaderCanWrite(RaftMachine raftMachine) { this._raftMachine = raftMachine; }