use of org.neo4j.kernel.impl.transaction.log.entry.LogVersions.CURRENT_LOG_VERSION in project neo4j by neo4j.
the class RecoveryTest method writeSomeData.
private void writeSomeData(File file, Visitor<Pair<LogEntryWriter, Consumer<LogPositionMarker>>, IOException> visitor) throws IOException {
try (LogVersionedStoreChannel versionedStoreChannel = new PhysicalLogVersionedStoreChannel(fileSystemRule.get().open(file, "rw"), logVersion, CURRENT_LOG_VERSION);
final PositionAwarePhysicalFlushableChannel writableLogChannel = new PositionAwarePhysicalFlushableChannel(versionedStoreChannel)) {
writeLogHeader(writableLogChannel, logVersion, 2L);
Consumer<LogPositionMarker> consumer = marker -> {
try {
writableLogChannel.getCurrentPosition(marker);
} catch (IOException e) {
throw new RuntimeException(e);
}
};
LogEntryWriter first = new LogEntryWriter(writableLogChannel);
visitor.visit(Pair.of(first, consumer));
}
}
Aggregations