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


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalancer.java:
##########
@@ -291,43 +305,58 @@ private RebalanceResult doRebalance(TableConfig 
tableConfig, RebalanceConfig reb
               + "rebalance", rebalanceJobId, tableNameWithType), e);
       return new RebalanceResult(rebalanceJobId, RebalanceResult.Status.FAILED,
           "Caught exception while calculating target assignment: " + e, 
instancePartitionsMap,
-          tierToInstancePartitionsMap, null, preChecksResult);
+          tierToInstancePartitionsMap, null, preChecksResult, null);
     }
 
     boolean segmentAssignmentUnchanged = 
currentAssignment.equals(targetAssignment);
     LOGGER.info("For rebalanceId: {}, instancePartitionsUnchanged: {}, 
tierInstancePartitionsUnchanged: {}, "
             + "segmentAssignmentUnchanged: {} for table: {}", rebalanceJobId, 
instancePartitionsUnchanged,
         tierInstancePartitionsUnchanged, segmentAssignmentUnchanged, 
tableNameWithType);
 
+    RebalanceSummaryResult summaryResult = null;
+    if (summary) {
+      summaryResult = calculateDryRunSummary(currentAssignment, 
targetAssignment, tableNameWithType, rebalanceJobId);
+    }

Review Comment:
   I think it might still be useful to see the summary in case the table being 
balanced is not expected? wdyt?
   I haven't moved it yet, but let me know if you still think it's not worth 
calculating the summary for this scenario and I can move it down and adjust the 
tests.



##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalancer.java:
##########
@@ -559,6 +588,147 @@ private RebalanceResult doRebalance(TableConfig 
tableConfig, RebalanceConfig reb
     }
   }
 
+  private long calculateTableSizePerReplicaInBytes(String tableNameWithType) {
+    long tableSizePerReplicaInBytes = -1;
+    if (_tableSizeReader == null) {
+      LOGGER.warn("tableSizeReader is null, cannot calculate table size for 
table {}!", tableNameWithType);
+      return tableSizePerReplicaInBytes;
+    }
+    try {
+      TableSizeReader.TableSubTypeSizeDetails tableSizeDetails =
+          _tableSizeReader.getTableSubtypeSize(tableNameWithType, 30_000);
+      tableSizePerReplicaInBytes = 
tableSizeDetails._reportedSizePerReplicaInBytes;
+    } catch (InvalidConfigException e) {
+      String errMsg = String.format("Caught exception while trying to fetch 
table size details for table: %s",
+          tableNameWithType);
+      LOGGER.error(errMsg, e);

Review Comment:
   done



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

Reply via email to