You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/12/14 07:00:13 UTC

[GitHub] [pinot] klsince commented on a change in pull request #7898: Add help methods to check if segment needs reprocessing

klsince commented on a change in pull request #7898:
URL: https://github.com/apache/pinot/pull/7898#discussion_r768365216



##########
File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/invertedindex/InvertedIndexHandler.java
##########
@@ -45,17 +45,41 @@
 
   private final File _indexDir;
   private final SegmentMetadata _segmentMetadata;
+  private final SegmentDirectory.Reader _segmentReader;
   private final SegmentDirectory.Writer _segmentWriter;
   private final HashSet<String> _columnsToAddIdx;
 
   public InvertedIndexHandler(File indexDir, SegmentMetadata segmentMetadata, IndexLoadingConfig indexLoadingConfig,
       SegmentDirectory.Writer segmentWriter) {
+    this(indexDir, segmentMetadata, indexLoadingConfig, null, segmentWriter);
+  }
+
+  public InvertedIndexHandler(SegmentMetadata segmentMetadata, IndexLoadingConfig indexLoadingConfig,
+      SegmentDirectory.Reader segmentReader) {
+    this(null, segmentMetadata, indexLoadingConfig, segmentReader, null);
+  }
+
+  private InvertedIndexHandler(File indexDir, SegmentMetadata segmentMetadata, IndexLoadingConfig indexLoadingConfig,

Review comment:
       I don't think there is a need for that. I extracted this private constructor to make the two public ones shorter. I thought about to pass in SegmentDirectory, but the pattern of using SegmentDirectory.Writer is to accumulate as many writes as possible before closing for efficiency. It's costly to open/close Writer repetitively.  




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