You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "zuston (via GitHub)" <gi...@apache.org> on 2023/03/20 02:23:08 UTC

[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #717: [#674] improvement(server): use ByteString#asReadOnlyByteBuffer to reduce the memory allocation

zuston commented on code in PR #717:
URL: https://github.com/apache/incubator-uniffle/pull/717#discussion_r1141562822


##########
storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriter.java:
##########
@@ -31,15 +33,26 @@ public class LocalFileWriter implements FileWriter, Closeable {
 
   private DataOutputStream dataOutputStream;
   private FileOutputStream fileOutputStream;
+  private FileChannel fileChannel;
   private long nextOffset;
 
   public LocalFileWriter(File file) throws IOException {
     fileOutputStream = new FileOutputStream(file, true);
+    fileChannel = fileOutputStream.getChannel();
     // init fsDataOutputStream
     dataOutputStream = new DataOutputStream(new BufferedOutputStream(fileOutputStream));

Review Comment:
   Emm... Actually, the `FileWriter` interface is not only for writing index data but also writing shuffle data, which is split with 2 methods, but they are exclusive. So only one of `dataOutputStream` and `fileChannel` will be used. 



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org