Handle null segment lineage ZNRecord for getSelectedSegments API
@@ -618,13 +618,15 @@ public class PinotHelixResourceManager {
}
}
// Fetch the segment lineage metadata, and filter segments based on segment lineage.
- ZNRecord segmentLineageZNRecord =
- SegmentLineageAccessHelper.getSegmentLineageZNRecord(_propertyStore, tableNameWithType);
- SegmentLineage segmentLineage = SegmentLineage.fromZNRecord(segmentLineageZNRecord);
+ SegmentLineage segmentLineage = SegmentLineageAccessHelper.getSegmentLineage(_propertyStore, tableNameWithType);
+ if (segmentLineage == null) {
+ return selectedSegments;
+ } else {
Set<String> selectedSegmentSet = new HashSet<>(selectedSegments);
SegmentLineageUtils.filterSegmentsBasedOnLineageInPlace(selectedSegmentSet, segmentLineage);
return new ArrayList<>(selectedSegmentSet);
}
+ }
/**
* Checks whether the segment is within the time range between the start and end timestamps.
