You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2023/12/11 21:01:13 UTC

Re: [PR] PR for issue #12129 - insuring opened `Channel` instances are properly closed [pinot]

Jackie-Jiang commented on code in PR #12130:
URL: https://github.com/apache/pinot/pull/12130#discussion_r1423121540


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/RangeIndexCreator.java:
##########
@@ -321,6 +322,7 @@ public void seal()
     try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(_rangeIndexFile));
         DataOutputStream header = new DataOutputStream(bos);
         FileOutputStream fos = new FileOutputStream(_rangeIndexFile);
+        FileChannel channel = fos.getChannel();

Review Comment:
   File channel is actually closed along with the output stream, but it is benign to explicitly close it



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/RangeIndexCreator.java:
##########
@@ -321,6 +322,7 @@ public void seal()
     try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(_rangeIndexFile));
         DataOutputStream header = new DataOutputStream(bos);
         FileOutputStream fos = new FileOutputStream(_rangeIndexFile);

Review Comment:
   Not introduced in this PR, but `FileOutputStream` is opened twice, is this intentional?



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org