Jackie-Jiang commented on a change in pull request #7294:
URL: https://github.com/apache/pinot/pull/7294#discussion_r688179982



##########
File path: 
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessor.java
##########
@@ -104,77 +101,11 @@ public void process()
         LOGGER.warn("Skip creating default columns for segment: {} without 
schema", _segmentMetadata.getName());
       }
 
-      // Create column inverted indices according to the index config.
-      InvertedIndexHandler invertedIndexHandler =
-          new InvertedIndexHandler(_indexDir, _segmentMetadata, 
_indexLoadingConfig, segmentWriter);
-      invertedIndexHandler.createInvertedIndices();
-
-      // Create column range indices according to the index config.
-      RangeIndexHandler rangeIndexHandler =
-          new RangeIndexHandler(_indexDir, _segmentMetadata, 
_indexLoadingConfig, segmentWriter);
-      rangeIndexHandler.createRangeIndices();
-
-      // Create text indices according to the index config.
-      Set<String> textIndexColumns = _indexLoadingConfig.getTextIndexColumns();
-      if (!textIndexColumns.isEmpty()) {
-        TextIndexHandler textIndexHandler =
-            new TextIndexHandler(_indexDir, _segmentMetadata, 
textIndexColumns, segmentWriter);
-        textIndexHandler.createTextIndexesOnSegmentLoad();
-      }
-
-      Set<String> fstIndexColumns = _indexLoadingConfig.getFSTIndexColumns();
-      if (!fstIndexColumns.isEmpty()) {
-        LuceneFSTIndexHandler luceneFSTIndexHandler =
-            new LuceneFSTIndexHandler(_indexDir, _segmentMetadata, 
fstIndexColumns, segmentWriter);
-        luceneFSTIndexHandler.createFSTIndexesOnSegmentLoad();
-      }
+      // Create/remove column indices according to the index config.
+      processColumnIndices(segmentWriter);

Review comment:
       We might want to split the handling for each index type into a separate 
method, but since the logic for each index type is already encapsulated within 
each index handler, IMO I would prefer keeping it the current way




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