Search in sources :

Example 1 with DummyRaftableContentSerializer

use of org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer in project neo4j by neo4j.

the class SegmentedRaftLogVerificationIT method createRaftLog.

@Override
protected RaftLog createRaftLog() throws Throwable {
    FileSystemAbstraction fsa = fsRule.get();
    File directory = new File(RAFT_LOG_DIRECTORY_NAME);
    fsa.mkdir(directory);
    long rotateAtSizeBytes = 128;
    int readerPoolSize = 8;
    LogProvider logProvider = getInstance();
    CoreLogPruningStrategy pruningStrategy = new CoreLogPruningStrategyFactory(raft_log_pruning_strategy.getDefaultValue(), logProvider).newInstance();
    SegmentedRaftLog newRaftLog = new SegmentedRaftLog(fsa, directory, rotateAtSizeBytes, new DummyRaftableContentSerializer(), logProvider, readerPoolSize, Clocks.systemClock(), new OnDemandJobScheduler(), pruningStrategy);
    newRaftLog.init();
    newRaftLog.start();
    return newRaftLog;
}
Also used : LogProvider(org.neo4j.logging.LogProvider) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) OnDemandJobScheduler(org.neo4j.test.OnDemandJobScheduler) File(java.io.File) DummyRaftableContentSerializer(org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)

Example 2 with DummyRaftableContentSerializer

use of org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer in project neo4j by neo4j.

the class SegmentedRaftLogContractTest method createRaftLog.

@Override
public RaftLog createRaftLog() {
    File directory = new File(RAFT_LOG_DIRECTORY_NAME);
    FileSystemAbstraction fileSystem = fsRule.get();
    fileSystem.mkdir(directory);
    LogProvider logProvider = getInstance();
    CoreLogPruningStrategy pruningStrategy = new CoreLogPruningStrategyFactory("1 entries", logProvider).newInstance();
    return life.add(new SegmentedRaftLog(fileSystem, directory, 1024, new DummyRaftableContentSerializer(), logProvider, 8, Clocks.fakeClock(), new OnDemandJobScheduler(), pruningStrategy));
}
Also used : LogProvider(org.neo4j.logging.LogProvider) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) OnDemandJobScheduler(org.neo4j.test.OnDemandJobScheduler) File(java.io.File) DummyRaftableContentSerializer(org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)

Example 3 with DummyRaftableContentSerializer

use of org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer in project neo4j by neo4j.

the class SegmentedConcurrentStressIT method createRaftLog.

@Override
public SegmentedRaftLog createRaftLog(FileSystemAbstraction fsa, File dir) throws Throwable {
    long rotateAtSize = 8 * 1024 * 1024;
    LogProvider logProvider = getInstance();
    int readerPoolSize = 8;
    CoreLogPruningStrategy pruningStrategy = new CoreLogPruningStrategyFactory(raft_log_pruning_strategy.getDefaultValue(), logProvider).newInstance();
    SegmentedRaftLog raftLog = new SegmentedRaftLog(fsa, dir, rotateAtSize, new DummyRaftableContentSerializer(), logProvider, readerPoolSize, Clocks.fakeClock(), new OnDemandJobScheduler(), pruningStrategy);
    raftLog.start();
    return raftLog;
}
Also used : LogProvider(org.neo4j.logging.LogProvider) OnDemandJobScheduler(org.neo4j.test.OnDemandJobScheduler) DummyRaftableContentSerializer(org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)

Example 4 with DummyRaftableContentSerializer

use of org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer in project neo4j by neo4j.

the class SegmentedRaftLogCursorIT method createRaftLog.

private SegmentedRaftLog createRaftLog(long rotateAtSize, String pruneStrategy) {
    if (fileSystem == null) {
        fileSystem = new EphemeralFileSystemAbstraction();
    }
    File directory = new File(RAFT_LOG_DIRECTORY_NAME);
    fileSystem.mkdir(directory);
    LogProvider logProvider = getInstance();
    CoreLogPruningStrategy pruningStrategy = new CoreLogPruningStrategyFactory(pruneStrategy, logProvider).newInstance();
    SegmentedRaftLog newRaftLog = new SegmentedRaftLog(fileSystem, directory, rotateAtSize, new DummyRaftableContentSerializer(), logProvider, 8, Clocks.systemClock(), new OnDemandJobScheduler(), pruningStrategy);
    life.add(newRaftLog);
    life.init();
    life.start();
    return newRaftLog;
}
Also used : LogProvider(org.neo4j.logging.LogProvider) EphemeralFileSystemAbstraction(org.neo4j.graphdb.mockfs.EphemeralFileSystemAbstraction) OnDemandJobScheduler(org.neo4j.test.OnDemandJobScheduler) File(java.io.File) DummyRaftableContentSerializer(org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)

Example 5 with DummyRaftableContentSerializer

use of org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer in project neo4j by neo4j.

the class SegmentedRaftLogRotationTest method createRaftLog.

private SegmentedRaftLog createRaftLog(long rotateAtSize) throws IOException {
    LogProvider logProvider = getInstance();
    CoreLogPruningStrategy pruningStrategy = new CoreLogPruningStrategyFactory(raft_log_pruning_strategy.getDefaultValue(), logProvider).newInstance();
    return new SegmentedRaftLog(fileSystemRule.get(), testDirectory.directory(), rotateAtSize, new DummyRaftableContentSerializer(), logProvider, 0, Clocks.fakeClock(), new OnDemandJobScheduler(), pruningStrategy);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) OnDemandJobScheduler(org.neo4j.test.OnDemandJobScheduler) DummyRaftableContentSerializer(org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)

Aggregations

DummyRaftableContentSerializer (org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)6 LogProvider (org.neo4j.logging.LogProvider)6 OnDemandJobScheduler (org.neo4j.test.OnDemandJobScheduler)6 File (java.io.File)4 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)3 EphemeralFileSystemAbstraction (org.neo4j.graphdb.mockfs.EphemeralFileSystemAbstraction)2