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/11/11 23:32:14 UTC

[GitHub] [pinot] snleee commented on a change in pull request #7752: Handle null segment lineage ZNRecord for getSelectedSegments API

snleee commented on a change in pull request #7752:
URL: https://github.com/apache/pinot/pull/7752#discussion_r747882657



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -618,12 +618,14 @@ public String getCrypterClassNameFromTableConfig(String tableNameWithType) {
       }
     }
     // Fetch the segment lineage metadata, and filter segments based on segment lineage.
-    ZNRecord segmentLineageZNRecord =
-        SegmentLineageAccessHelper.getSegmentLineageZNRecord(_propertyStore, tableNameWithType);
-    SegmentLineage segmentLineage = SegmentLineage.fromZNRecord(segmentLineageZNRecord);
-    Set<String> selectedSegmentSet = new HashSet<>(selectedSegments);
-    SegmentLineageUtils.filterSegmentsBasedOnLineageInPlace(selectedSegmentSet, segmentLineage);
-    return new ArrayList<>(selectedSegmentSet);
+    SegmentLineage segmentLineage = SegmentLineageAccessHelper.getSegmentLineage(_propertyStore, tableNameWithType);
+    if (segmentLineage == null) {

Review comment:
       We don't need to treat `null` separately?
   
   `SegmentLineageUtils.filterSegmentsBasedOnLineageInPlace()` has the null check so `null` case is covered. 
   
   The output with/without this `if (segmentLineage==null)` is the same. So we can remove this if statement.




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