alpapad commented on a change in pull request #411:
URL: https://github.com/apache/incubator-ratis/pull/411#discussion_r567062092
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/storage/FileChunkReader.java
##########
@@ -65,7 +66,7 @@ public FileChunkReader(FileInfo info, RaftStorageDirectory
directory) throws IOE
public FileChunkProto readFileChunk(int chunkMaxSize) throws IOException {
final long remaining = info.getFileSize() - offset;
final int chunkLength = remaining < chunkMaxSize ? (int) remaining :
chunkMaxSize;
- final ByteString data = ByteString.readFrom(in, chunkLength);
Review comment:
ByteString.readFrom(in, chunkLength) will read the whole file not just
chunkLength
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]