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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]