You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "PrachiKhobragade (via GitHub)" <gi...@apache.org> on 2023/03/07 23:16:32 UTC

[GitHub] [pinot] PrachiKhobragade commented on a diff in pull request #10387: Add look-back support for MergeRollupTask

PrachiKhobragade commented on code in PR #10387:
URL: https://github.com/apache/pinot/pull/10387#discussion_r1128447623


##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGenerator.java:
##########
@@ -211,6 +217,10 @@ public List<PinotTaskConfig> generateTasks(List<TableConfig> tableConfigs) {
         }
       }
 
+      // Get scheduling mode which is "one-off" by default. If "lookBack" mode is enabled, there will be no
+      // watermark, and each round we pick the buckets in chronological order which have unmerged segments.
+      boolean isLookBack = "lookBack".equalsIgnoreCase(taskConfigs.get(MergeTask.MODE));

Review Comment:
   Make lookBack a constant



##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGenerator.java:
##########
@@ -260,9 +270,13 @@ public List<PinotTaskConfig> generateTasks(List<TableConfig> tableConfigs) {
         // Get watermark from MergeRollupTaskMetadata ZNode
         // bucketStartMs = watermarkMs
         // bucketEndMs = bucketStartMs + bucketMs
-        long watermarkMs =
-            getWatermarkMs(preSelectedSegments.get(0).getStartTimeMs(), bucketMs, mergeLevel, mergeRollupTaskMetadata);
-        long bucketStartMs = watermarkMs;
+        long bucketStartMs = preSelectedSegments.get(0).getStartTimeMs() / bucketMs * bucketMs;
+        long watermarkMs = 0;
+        if (!isLookBack) {
+          watermarkMs = getWatermarkMs(preSelectedSegments.get(0).getStartTimeMs(), bucketMs, mergeLevel,

Review Comment:
   Add a variable preSelectedSegStarttimeMs? can be replaced here and L273



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org