himanshukandwal commented on code in PR #2639:
URL: https://github.com/apache/helix/pull/2639#discussion_r1344746289


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithm.java:
##########
@@ -120,24 +120,24 @@ public OptimalAssignment calculate(ClusterModel 
clusterModel) throws HelixRebala
   private Optional<AssignableNode> getNodeWithHighestPoints(AssignableReplica 
replica,
       List<AssignableNode> assignableNodes, ClusterContext clusterContext,
       Set<String> busyInstances, OptimalAssignment optimalAssignment) {
-    Map<AssignableNode, List<HardConstraint>> hardConstraintFailures = new 
ConcurrentHashMap<>();
+    Map<AssignableNode, List<String>> hardConstraintFailures = new 
ConcurrentHashMap<>();
     List<AssignableNode> candidateNodes = 
assignableNodes.parallelStream().filter(candidateNode -> {
       boolean isValid = true;
       // need to record all the failure reasons and it gives us the ability to 
debug/fix the runtime
       // cluster environment
       for (HardConstraint hardConstraint : _hardConstraints) {
-        if (!hardConstraint.isAssignmentValid(candidateNode, replica, 
clusterContext)) {
+        ValidationResult validationResult  = 
hardConstraint.isAssignmentValid(candidateNode, replica, clusterContext);

Review Comment:
   Currently we produce a static response for a type of Constraint Failure, 
which does not capture the details of the failing constraint, as say for 
Capacity there are many dimensions: disk, partcount, cu ..
   
   With this change we will provide the exact information about the failure. 
Such as:
   ```Node has insufficient capacity```
   Will be:
   ```Node has insufficient capacity for dimension: testKey. Left available: 1, 
Required: 5```



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