@Override public void init() throws IOException { logVersionRepository = context.getLogVersionRepository(); // Make sure at least a bare bones log file is available before recovery long lastLogVersionUsed = this.logVersionRepository.getCurrentLogVersion(); channel = logFiles.createLogChannelForVersion( lastLogVersionUsed, OpenMode.READ_WRITE, context::getLastCommittedTransactionId ); channel.close(); }
@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 ); }
PhysicalLogVersionedStoreChannel newLog = logFiles.createLogChannelForVersion( newLogVersion, OpenMode.READ_WRITE, context::committingTransactionId ); currentLog.close();
@Override public void init() throws IOException { logVersionRepository = context.getLogVersionRepository(); // Make sure at least a bare bones log file is available before recovery long lastLogVersionUsed = this.logVersionRepository.getCurrentLogVersion(); channel = logFiles.createLogChannelForVersion( lastLogVersionUsed, OpenMode.READ_WRITE, context::getLastCommittedTransactionId ); channel.close(); }
@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 ); }
PhysicalLogVersionedStoreChannel newLog = logFiles.createLogChannelForVersion( newLogVersion, OpenMode.READ_WRITE, context::committingTransactionId ); currentLog.close();