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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/forward/ChunkReaderContext.java:
##########
@@ -52,11 +51,8 @@ public ChunkReaderContext(int maxChunkSize) {
   }
 
   @Override
-  public void close()
-      throws IOException {
-    if (CleanerUtil.UNMAP_SUPPORTED) {
-      CleanerUtil.getCleaner().freeBuffer(_chunkBuffer);
-    }
+  public void close() {
+    CleanerUtil.cleanQuietly(_chunkBuffer);

Review Comment:
   Can you try releasing the same buffer twice? My concern is this could cause 
segmentation fault



##########
pinot-core/src/main/java/org/apache/pinot/core/common/BlockDocIdIterator.java:
##########
@@ -47,4 +47,11 @@ public interface BlockDocIdIterator {
    * @see 
{https://github.com/RoaringBitmap/RoaringBitmap/pull/243#issuecomment-381278304}
    */
   int OPTIMAL_ITERATOR_BATCH_SIZE = 256;
+
+  /**
+   * Close resources if applicable.
+   */
+  default void close() {

Review Comment:
   (minor)
   ```suggestion
     @Override
     default void close() {
   ```



##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/ForwardIndexReaderContext.java:
##########
@@ -28,4 +28,7 @@
  * inside the context in order to accelerate the following reads.
  */
 public interface ForwardIndexReaderContext extends Closeable {

Review Comment:
   This can also be `AutoCloseable`



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

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


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

Reply via email to