somandal commented on code in PR #15266:
URL: https://github.com/apache/pinot/pull/15266#discussion_r2021943506


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalanceProgressStats.java:
##########
@@ -118,13 +129,107 @@ public RebalanceStateStats 
getCurrentToTargetConvergence() {
     return _currentToTargetConvergence;
   }
 
+  public RebalanceProgressStats getRebalanceProgressStatsOverall() {
+    return _rebalanceProgressStatsOverall;
+  }
+
+  public RebalanceProgressStats getRebalanceProgressStatsCurrentStep() {
+    return _rebalanceProgressStatsCurrentStep;
+  }
+
+  public static boolean progressStatsDiffer(RebalanceProgressStats base, 
RebalanceProgressStats compare) {
+    // Don't check for changes in the estimated time for completion as this 
will always be updated since it is
+    // newly calculated for each iteration based on current time and start time
+    return base._totalSegmentsToBeAdded != compare._totalSegmentsToBeAdded
+        || base._totalSegmentsToBeDeleted != compare._totalSegmentsToBeDeleted
+        || base._totalRemainingSegmentsToBeAdded != 
compare._totalRemainingSegmentsToBeAdded
+        || base._totalRemainingSegmentsToBeDeleted != 
compare._totalRemainingSegmentsToBeDeleted
+        || base._totalRemainingSegmentsToConverge != 
compare._totalRemainingSegmentsToConverge
+        || base._totalUniqueNewUntrackedSegmentsDuringRebalance
+        != compare._totalUniqueNewUntrackedSegmentsDuringRebalance
+        || base._percentageTotalSegmentsAddsRemaining != 
compare._percentageTotalSegmentsAddsRemaining
+        || base._percentageTotalSegmentDeletesRemaining != 
compare._percentageTotalSegmentDeletesRemaining
+        || base._averageSegmentSizeInBytes != 
compare._averageSegmentSizeInBytes
+        || base._totalEstimatedDataToBeMovedInBytes != 
compare._totalEstimatedDataToBeMovedInBytes

Review Comment:
   no, this is calculated based on average segment size and number of segments 
moving. so if `_totalSegmentsToBeAdded` is updated, only then this should 
change.
   
   We calculate average segment size prior to table rebalance start and use the 
same throughout (it's only an estimate)



-- 
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]

Reply via email to