csudharsanan commented on code in PR #2738:
URL: https://github.com/apache/helix/pull/2738#discussion_r1468060896
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/AssignableNode.java:
##########
@@ -263,13 +283,39 @@ public float
getGeneralProjectedHighestUtilization(Map<String, Integer> newUsage
* @return The highest utilization number of the node among all the capacity
category.
*/
public float getTopStateProjectedHighestUtilization(Map<String, Integer>
newUsage) {
- return getProjectedHighestUtilization(newUsage,
_remainingTopStateCapacity);
+ return getProjectedHighestUtilization(newUsage,
_remainingTopStateCapacity, null);
+ }
+
+ /**
+ * Return the most concerning capacity utilization number for evenly
partition assignment.
+ * The method dynamically calculates the projected highest utilization
number among all the
+ * capacity categories assuming the new capacity usage is added to the node.
+ *
+ * If the list of preferredScoringKeys is specified then utilization number
is computed based op the
+ * specified capacity category (keys) in the list only.
+ *
+ * For example, if the current node usage is {CPU: 0.9, MEM: 0.4, DISK:
0.6}, preferredScoringKeys: [ CPU ]
+ * Then this call shall return 0.9.
+ *
+ * This function returns projected highest utilization for only top state
partitions.
+ *
+ * @param newUsage the proposed new additional capacity usage.
+ * @param preferredScoringKeys if provided, the capacity utilization will be
calculated based on
+ * the supplied keys only, else across all
capacity categories.
+ * @return The highest utilization number of the node among all the capacity
category.
+ */
+ public float getTopStateProjectedHighestUtilization(Map<String, Integer>
newUsage, List<String> preferredScoringKeys) {
Review Comment:
Difference between this function and line 272 is this is used to return
projectedHighestUtilization for top state partitions only. Mentioned in
comments - line 300.
The function in line 307 is used by
TopStateMaxCapacityUsageInstanceConstraint and 272 by
MaxCapacityUsageInstanceConstraint.
--
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]