@Override public void start() throws IOException { // Recovery has taken place before this, so the log file has been truncated to last known good tx // Just read header and move to the end long lastLogVersionUsed = logVersionRepository.getCurrentLogVersion(); channel = logFiles.createLogChannelForVersion( lastLogVersionUsed, OpenMode.READ_WRITE, context::getLastCommittedTransactionId ); // Move to the end channel.position( channel.size() ); writer = new PositionAwarePhysicalFlushableChannel( channel ); }
private void verifyTransactionLogs( File txDirectory, File storeDir ) throws IOException { FileSystemAbstraction fileSystem = fileSystemRule.get(); LogFiles storeDirLogs = LogFilesBuilder.logFilesBasedOnlyBuilder( storeDir, fileSystem ).build(); assertFalse( storeDirLogs.versionExists( 0 ) ); LogFiles txDirectoryLogs = LogFilesBuilder.logFilesBasedOnlyBuilder( txDirectory, fileSystem ).build(); assertTrue( txDirectoryLogs.versionExists( 0 ) ); try ( PhysicalLogVersionedStoreChannel physicalLogVersionedStoreChannel = txDirectoryLogs.openForVersion( 0 ) ) { assertThat( physicalLogVersionedStoreChannel.size(), greaterThan( 0L ) ); } }
@Override public void start() throws IOException { // Recovery has taken place before this, so the log file has been truncated to last known good tx // Just read header and move to the end long lastLogVersionUsed = logVersionRepository.getCurrentLogVersion(); channel = logFiles.createLogChannelForVersion( lastLogVersionUsed, OpenMode.READ_WRITE, context::getLastCommittedTransactionId ); // Move to the end channel.position( channel.size() ); writer = new PositionAwarePhysicalFlushableChannel( channel ); }