use of org.neo4j.kernel.impl.transaction.SimpleTransactionIdStore in project neo4j by neo4j.
the class LogFilesBuilderTest method buildContextWithCustomAbsoluteLogFilesLocations.
@Test
void buildContextWithCustomAbsoluteLogFilesLocations() throws Throwable {
Path customLogDirectory = testDirectory.directory("absoluteCustomLogDirectory");
Config config = Config.newBuilder().set(neo4j_home, testDirectory.homePath()).set(transaction_logs_root_path, customLogDirectory.toAbsolutePath()).build();
LogFiles logFiles = builder(DatabaseLayout.of(config), fileSystem).withRotationThreshold(ByteUnit.mebiBytes(1)).withLogVersionRepository(new SimpleLogVersionRepository()).withTransactionIdStore(new SimpleTransactionIdStore()).withLogEntryReader(logEntryReader()).withStoreId(StoreId.UNKNOWN).build();
logFiles.init();
logFiles.start();
assertEquals(customLogDirectory.resolve(databaseLayout.getDatabaseName()), logFiles.getLogFile().getHighestLogFile().getParent());
logFiles.shutdown();
}
use of org.neo4j.kernel.impl.transaction.SimpleTransactionIdStore in project neo4j by neo4j.
the class LogFilesBuilderTest method buildDefaultContext.
@Test
void buildDefaultContext() throws IOException {
TransactionLogFilesContext context = builder(databaseLayout, fileSystem).withLogVersionRepository(new SimpleLogVersionRepository(2)).withTransactionIdStore(new SimpleTransactionIdStore()).withLogEntryReader(logEntryReader()).buildContext();
assertEquals(fileSystem, context.getFileSystem());
assertNotNull(context.getLogEntryReader());
assertEquals(ByteUnit.mebiBytes(250), context.getRotationThreshold().get());
assertEquals(1, context.getLastCommittedTransactionId());
assertEquals(2, context.getLogVersionRepository().getCurrentLogVersion());
}
use of org.neo4j.kernel.impl.transaction.SimpleTransactionIdStore in project neo4j by neo4j.
the class LogFilesBuilderTest method buildDefaultContextWithDependencies.
@Test
void buildDefaultContextWithDependencies() throws IOException {
SimpleLogVersionRepository logVersionRepository = new SimpleLogVersionRepository(2);
SimpleTransactionIdStore transactionIdStore = new SimpleTransactionIdStore();
DatabaseHealth databaseHealth = new DatabaseHealth(PanicEventGenerator.NO_OP, NullLog.getInstance());
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependency(logVersionRepository);
dependencies.satisfyDependency(transactionIdStore);
dependencies.satisfyDependency(databaseHealth);
TransactionLogFilesContext context = builder(databaseLayout, fileSystem).withDependencies(dependencies).withLogEntryReader(logEntryReader()).buildContext();
assertEquals(fileSystem, context.getFileSystem());
assertNotNull(context.getLogEntryReader());
assertEquals(ByteUnit.mebiBytes(250), context.getRotationThreshold().get());
assertEquals(databaseHealth, context.getDatabaseHealth());
assertEquals(1, context.getLastCommittedTransactionId());
assertEquals(2, context.getLogVersionRepository().getCurrentLogVersion());
}
use of org.neo4j.kernel.impl.transaction.SimpleTransactionIdStore in project neo4j by neo4j.
the class TransactionLogFilesTest method createLogFiles.
private LogFiles createLogFiles() throws Exception {
var files = LogFilesBuilder.builder(databaseLayout, fileSystem).withTransactionIdStore(new SimpleTransactionIdStore()).withLogVersionRepository(new SimpleLogVersionRepository()).withLogEntryReader(new VersionAwareLogEntryReader(new TestCommandReaderFactory())).withStoreId(StoreId.UNKNOWN).build();
files.init();
return files;
}
use of org.neo4j.kernel.impl.transaction.SimpleTransactionIdStore in project neo4j by neo4j.
the class AbstractLogTailScannerTest method setUp.
@BeforeEach
void setUp() throws IOException {
logVersionRepository = new SimpleLogVersionRepository();
transactionIdStore = new SimpleTransactionIdStore();
logProvider = new AssertableLogProvider();
logFiles = createLogFiles();
}
Aggregations