Source:
public RequestContext flushStoresAndStreamStoreFiles( String triggerName, StoreWriter writer, boolean includeLogs ) { try { String storeCopyIdentifier = Thread.currentThread().getName(); ThrowingAction<IOException> checkPointAction = () -> { monitor.startTryCheckPoint( storeCopyIdentifier ); checkPointer.tryCheckPoint( new SimpleTriggerInfo( triggerName ) ); monitor.finishTryCheckPoint( storeCopyIdentifier ); }; long lastAppliedTransaction; try ( Resource lock = mutex.storeCopy( checkPointAction ); ResourceIterator<StoreFileMetadata> files = dataSource.listStoreFiles( includeLogs ) ) { lastAppliedTransaction = checkPointer.lastCheckPointedTransactionId(); monitor.startStreamingStoreFiles( storeCopyIdentifier ); ByteBuffer temporaryBuffer = ByteBuffer.allocateDirect( (int) ByteUnit.mebiBytes( 1 ) ); while ( files.hasNext() ) { StoreFileMetadata meta = files.next(); File file = meta.file(); int recordSize = meta.recordSize(); boolean isDefaultFileSystem = pageCache.getCachedFileSystem() instanceof DefaultFileSystemAbstraction; if ( !isDefaultFileSystem ) { final Optional<PagedFile> optionalPagedFile = pageCache.getExistingMapping( file ); if ( optionalPagedFile.isPresent() ) { try ( PagedFile pagedFile = optionalPagedFile.get() ) { long fileSize = pagedFile.fileSize(); try ( ReadableByteChannel fileChannel = pagedFile.openReadableByteChannel() ) { doWrite( writer, temporaryBuffer, file, recordSize, fileChannel, fileSize, storeCopyIdentifier ); } return anonymous( lastAppliedTransaction ); } } } try ( ReadableByteChannel fileChannel = fileSystem.open( file, "r" ) ) { long fileSize = fileSystem.getFileSize( file ); doWrite( writer, temporaryBuffer, file, recordSize, fileChannel, fileSize, storeCopyIdentifier ); } } } finally { monitor.finishStreamingStoreFiles( storeCopyIdentifier ); } return anonymous( lastAppliedTransaction ); } catch ( IOException e ) { throw new ServerFailureException( e ); } }

Target:
public RequestContext flushStoresAndStreamStoreFiles( String triggerName, StoreWriter writer, boolean includeLogs ) { try { String storeCopyIdentifier = Thread.currentThread().getName(); ThrowingAction<IOException> checkPointAction = () -> { monitor.startTryCheckPoint( storeCopyIdentifier ); checkPointer.tryCheckPoint( new SimpleTriggerInfo( triggerName ) ); monitor.finishTryCheckPoint( storeCopyIdentifier ); }; long lastAppliedTransaction; try ( Resource lock = mutex.storeCopy( checkPointAction ); ResourceIterator<StoreFileMetadata> files = dataSource.listStoreFiles( includeLogs ) ) { lastAppliedTransaction = checkPointer.lastCheckPointedTransactionId(); monitor.startStreamingStoreFiles( storeCopyIdentifier ); ByteBuffer temporaryBuffer = ByteBuffer.allocateDirect( (int) ByteUnit.mebiBytes( 1 ) ); while ( files.hasNext() ) { StoreFileMetadata meta = files.next(); File file = meta.file(); int recordSize = meta.recordSize(); if ( !pageCache.fileSystemSupportsFileOperations() ) { final Optional<PagedFile> optionalPagedFile = pageCache.getExistingMapping( file ); if ( optionalPagedFile.isPresent() ) { try ( PagedFile pagedFile = optionalPagedFile.get() ) { long fileSize = pagedFile.fileSize(); try ( ReadableByteChannel fileChannel = pagedFile.openReadableByteChannel() ) { doWrite( writer, temporaryBuffer, file, recordSize, fileChannel, fileSize, storeCopyIdentifier ); } return anonymous( lastAppliedTransaction ); } } } try ( ReadableByteChannel fileChannel = fileSystem.open( file, "r" ) ) { long fileSize = fileSystem.getFileSize( file ); doWrite( writer, temporaryBuffer, file, recordSize, fileChannel, fileSize, storeCopyIdentifier ); } } } finally { monitor.finishStreamingStoreFiles( storeCopyIdentifier ); } return anonymous( lastAppliedTransaction ); } catch ( IOException e ) { throw new ServerFailureException( e ); } }