You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "SzyWilliam (via GitHub)" <gi...@apache.org> on 2023/04/26 14:41:42 UTC

[GitHub] [ratis] SzyWilliam commented on a diff in pull request #877: RATIS-1837. Restrict reading maxChunkSize bytes each installSnapshot RPC

SzyWilliam commented on code in PR #877:
URL: https://github.com/apache/ratis/pull/877#discussion_r1177985363


##########
ratis-server/src/main/java/org/apache/ratis/server/storage/FileChunkReader.java:
##########
@@ -47,11 +51,14 @@ public class FileChunkReader implements Closeable {
    *
    * @param info the information of the file.
    * @param relativePath the relative path of the file.
+   * @param chunkMaxSize maximum chunk size for each {@link #readFileChunk()} call
    * @throws IOException if it failed to open the file.
    */
-  public FileChunkReader(FileInfo info, Path relativePath) throws IOException {
+  public FileChunkReader(FileInfo info, Path relativePath, int chunkMaxSize) throws IOException {
     this.info = info;
     this.relativePath = relativePath;
+    this.chunkMaxSize = chunkMaxSize;

Review Comment:
   You are right! We can save some unnecessary memory allocations.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org