예제 #1
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);
        }
예제 #2
0
 public RecoverConsensusLogIndex(LocalDatabase localDatabase, LogProvider logProvider)
 {
     this._localDatabase = localDatabase;
     this._logProvider   = logProvider;
 }