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


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -1013,8 +1013,30 @@ public boolean tryLoadExistingSegment(SegmentZKMetadata 
zkMetadata, IndexLoading
     }
   }
 
+  /**
+   * This method checks if any reload is needed on a segment.
+   * Scans through indices, columns, startree index and min max values to 
achieve the result
+   * True if reload is needed and false if no reload is needed.
+   */
+  @Override
+  public boolean checkReloadSegment(SegmentZKMetadata zkMetadata, 
IndexLoadingConfig indexLoadingConfig) {
+    String segmentName = zkMetadata.getSegmentName();
+    SegmentDirectory segmentDirectory =
+        tryInitSegmentDirectory(segmentName, 
String.valueOf(zkMetadata.getCrc()), indexLoadingConfig);
+
+    try {
+      Schema schema = indexLoadingConfig.getSchema();
+      //if re processing or reload is needed on a segment then return true
+      return ImmutableSegmentLoader.needPreprocess(segmentDirectory, 
indexLoadingConfig, schema);
+    } catch (Exception e) {
+      _logger.error("Failed to check if reload is needed for a segment {}", 
segmentName, e);

Review Comment:
   I feel that might be overkilling. IMO we can simply throw the exception out, 
and client can handle it accordingly.



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