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: [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]