klsince commented on code in PR #10089:
URL: https://github.com/apache/pinot/pull/10089#discussion_r1081607056


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessor.java:
##########
@@ -207,11 +207,7 @@ private boolean needProcessStarTrees() {
     List<StarTreeV2Metadata> starTreeMetadataList = 
_segmentMetadata.getStarTreeV2MetadataList();
     // There are existing star-trees, but if they match the builder configs 
exactly,
     // then there is no need to generate the star-trees
-    if (starTreeMetadataList != null && !StarTreeBuilderUtils
-        .shouldRemoveExistingStarTrees(starTreeBuilderConfigs, 
starTreeMetadataList)) {
-      return false;
-    }
-    return !starTreeBuilderConfigs.isEmpty();
+    return 
StarTreeBuilderUtils.existingStarTreesNeedChange(starTreeBuilderConfigs, 
starTreeMetadataList);

Review Comment:
   bump ^



##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -403,6 +417,16 @@ public void reloadSegment(String segmentName, 
IndexLoadingConfig indexLoadingCon
     }
   }
 
+  public boolean canReuseExistingDirectoryForReload(SegmentZKMetadata 
segmentZKMetadata,
+      String currentSegmentTier, SegmentDirectory segmentDirectory, 
IndexLoadingConfig indexLoadingConfig,
+      Schema schema)
+      throws Exception {
+    SegmentDirectoryLoader segmentDirectoryLoader =
+        
SegmentDirectoryLoaderRegistry.getSegmentDirectoryLoader(indexLoadingConfig.getSegmentDirectoryLoader());
+    return 
!segmentDirectoryLoader.needsTierMigration(segmentZKMetadata.getTier(), 
currentSegmentTier)
+        && !ImmutableSegmentLoader.needPreprocess(segmentDirectory, 
indexLoadingConfig, schema);

Review Comment:
   How about put the method on SegmentDirectory iface? as segmentDirectory 
tracks its current tier, so can compare with the new tier. Custom 
segmentDirectory impls can decide whether to migrate tier per need.
   ```
   return segmentDirectory.needTierMigration(segmentZKMetadata.getTier()) && ...
   ```



##########
pinot-core/src/test/java/org/apache/pinot/core/data/manager/BaseTableDataManagerTest.java:
##########
@@ -191,7 +191,6 @@ public void testReloadSegmentUseLocalCopy()
       fail();
     } catch (Exception e) {
       // As expected, segment reloading fails due to missing the local segment 
dir.
-      assertTrue(e.getMessage().contains("does not exist or is not a 
directory"));

Review Comment:
   did reloadSegment() complete w/o any errors? that's a bit unexpected as L188 
deleted the local seg dir. same question for next test case.



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