jackjlli commented on a change in pull request #7752:
URL: https://github.com/apache/pinot/pull/7752#discussion_r747885616
##########
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:
The benefit of having the if check here is to reduce the collection
instantiation, ie. we don't have to instantiate one more hash set and then
another list if the segment lineage doesn't exist. We should be good here.
--
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]