Source:
<code>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 ); <START> ByteBuffer temporaryBuffer = ByteBuffer.allocate( (int) ByteUnit.mebiBytes( 1 ) ); <END> while ( files.hasNext() ) { StoreFileMetadata meta = files.next(); File file = meta.file(); boolean isLogFile = meta.isLogFile(); 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, false ); } continue; } } } try ( ReadableByteChannel fileChannel = fileSystem.open( file, OpenMode.READ ) ) { long fileSize = fileSystem.getFileSize( file ); doWrite( writer, temporaryBuffer, file, recordSize, fileChannel, fileSize, storeCopyIdentifier, isLogFile ); } } } finally { monitor.finishStreamingStoreFiles( storeCopyIdentifier ); } return anonymous( lastAppliedTransaction ); } catch ( IOException e ) { throw new ServerFailureException( e ); } }</code><technical_language>deal FileSender</technical_language>

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(); boolean isLogFile = meta.isLogFile(); 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, false ); } continue; } } } try ( ReadableByteChannel fileChannel = fileSystem.open( file, OpenMode.READ ) ) { long fileSize = fileSystem.getFileSize( file ); doWrite( writer, temporaryBuffer, file, recordSize, fileChannel, fileSize, storeCopyIdentifier, isLogFile ); } } } finally { monitor.finishStreamingStoreFiles( storeCopyIdentifier ); } return anonymous( lastAppliedTransaction ); } catch ( IOException e ) { throw new ServerFailureException( e ); } }