예제 #1
0
        private SegmentedRaftLog CreateRaftLog(long rotateAtSize)
        {
            File directory = new File(RAFT_LOG_DIRECTORY_NAME);

            _logDirectory = Dir.directory(directory.Name);

            LogProvider            logProvider     = Instance;
            CoreLogPruningStrategy pruningStrategy = (new CoreLogPruningStrategyFactory("100 entries", logProvider)).NewInstance();

            return(new SegmentedRaftLog(FsRule.get(), _logDirectory, rotateAtSize, CoreReplicatedContentMarshal.marshaller(), logProvider, 8, Clocks.fakeClock(), new OnDemandJobScheduler(), pruningStrategy));
        }
예제 #2
0
        private RecoveryProtocol CreateRecoveryProtocol()
        {
            FileNames fileNames = new FileNames(_logDirectory);

            return(new RecoveryProtocol(FsRule.get(), fileNames, new ReaderPool(8, Instance, fileNames, FsRule.get(), Clocks.fakeClock()), CoreReplicatedContentMarshal.marshaller(), Instance));
        }