jtao15 commented on code in PR #10387: URL: https://github.com/apache/pinot/pull/10387#discussion_r1129008166
########## pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGenerator.java: ########## @@ -712,6 +771,98 @@ private void createOrUpdateDelayMetrics(String tableNameWithType, String mergeLe }); } + /** + * Update the number buckets to process for the given table and merge level. We create the new gauge metric if + * the metric is not available. + * @param tableNameWithType table name with type + * @param mergeLevel merge level + * @param lowerMergeLevel lower merge level + * @param bufferTimeMs buffer time + * @param bucketTimeMs bucket time + * @param sortedSegments sorted segment list + * @param sortedMergeLevels sorted merge level list + */ + private void createOrUpdateNumBucketsToProcessMetrics(String tableNameWithType, String mergeLevel, + String lowerMergeLevel, long bufferTimeMs, long bucketTimeMs, + List<SegmentZKMetadata> sortedSegments, List<String> sortedMergeLevels) { + ControllerMetrics controllerMetrics = _clusterInfoAccessor.getControllerMetrics(); + if (controllerMetrics == null) { + return; + } + + // Find all buckets and segments that are ready to merge + List<List<SegmentZKMetadata>> selectedSegmentsForAllBuckets = new ArrayList<>(); + List<SegmentZKMetadata> selectedSegmentsForBucket = new ArrayList<>(); + long bucketStartMs = sortedSegments.get(0).getStartTimeMs() / bucketTimeMs * bucketTimeMs; Review Comment: In terms of correctness, I think it's okay to have it not rounded. Currently we always use the rounded time value to calculate the bucket start/end time. I used the rounded number here so it's consistent with the way we schedule tasks and how we calculate the delay metric. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org