jackjlli commented on a change in pull request #7651:
URL: https://github.com/apache/pinot/pull/7651#discussion_r737929318
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -593,6 +593,78 @@ public String getCrypterClassNameFromTableConfig(String
tableNameWithType) {
return ZKMetadataProvider.getSegments(_propertyStore, tableNameWithType);
}
+ /**
+ * Returns the segments for the given table based on the start and end
timestamp.
+ *
+ * @param tableNameWithType Table name with type suffix
+ * @param startTimestamp start timestamp in milliseconds (inclusive)
+ * @param endTimestamp end timestamp in milliseconds (exclusive)
+ * @param excludeOverlapping whether to exclude the segments overlapping
with the timestamps
+ */
+ public List<String> getSegmentsForTableWithTimestamps(String
tableNameWithType, long startTimestamp,
+ long endTimestamp, boolean excludeOverlapping) {
+ List<String> selectedSegments = new ArrayList<>();
+ List<String> segmentNames = getSegmentsFor(tableNameWithType);
+ // If no start and end timestamp specified, just select all the segments.
+ if (startTimestamp == Long.MIN_VALUE && endTimestamp == Long.MAX_VALUE) {
+ selectedSegments = segmentNames;
+ } else {
+ String segmentZKMetadataPathPrefix =
Review comment:
Updated.
--
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]