Toggle navigation
Home
org.neo4j.causalclustering.catchup.storecopy.FileContent to org.neo4j.causalclustering.catchup.storecopy.FileChunk
No. of Instances - 5
No. of Commits - 1
No. of Projects - {'neo4j'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Rename Variable
fileContent
to
fileChunk
fileContent
to
fileChunk
Cascading Type Change (Similar)
FileContent
to
FileChunk
Update Anonymous class
{ private long expectedBytes=0; private String destination; @Override public void onFileHeader( CompletableFuture<Long> requestOutcomeSignal, FileHeader fileHeader){ this.expectedBytes=fileHeader.fileLength(); this.destination=fileHeader.fileName(); } @Override public boolean onFileContent( CompletableFuture<Long> signal, FileContent fileContent) throws IOException { try (FileContent content=fileContent;OutputStream outputStream=storeFileStreams.createStream(destination)){ expectedBytes-=content.writeTo(outputStream); } return expectedBytes <= 0; } @Override public void onFileStreamingComplete( CompletableFuture<Long> signal, StoreCopyFinishedResponse response){ signal.complete(response.lastCommittedTxBeforeStoreCopy()); } }
to
{ private String destination; @Override public void onFileHeader( CompletableFuture<Long> requestOutcomeSignal, FileHeader fileHeader){ this.destination=fileHeader.fileName(); } @Override public boolean onFileContent( CompletableFuture<Long> signal, FileChunk fileChunk) throws IOException { try (OutputStream outputStream=storeFileStreams.createStream(destination)){ outputStream.write(fileChunk.bytes()); } return fileChunk.isLast(); } @Override public void onFileStreamingComplete( CompletableFuture<Long> signal, StoreCopyFinishedResponse response){ signal.complete(response.lastCommittedTxBeforeStoreCopy()); } }