junkaixue commented on code in PR #2639:
URL: https://github.com/apache/helix/pull/2639#discussion_r1358956177
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/HardConstraint.java:
##########
@@ -33,15 +34,46 @@ abstract class HardConstraint {
* Check if the replica could be assigned to the node
* @return True if the proposed assignment is valid; False otherwise
*/
- abstract boolean isAssignmentValid(AssignableNode node, AssignableReplica
replica,
+ abstract ValidationResult isAssignmentValid(AssignableNode node,
AssignableReplica replica,
ClusterContext clusterContext);
+
/**
- * Return class name by default as description if it's explanatory enough,
child class could override
- * the method and add more detailed descriptions
- * @return The detailed description of hard constraint
+ * Stores the assignment validation result and the error message, in case of
failure.
*/
- String getDescription() {
- return getClass().getName();
+ public static class ValidationResult {
Review Comment:
Why we need to have this kind of result? I am not fully convinced to have
this structure. If a failure of a message require this new object. It will
generated a lot of object during pipelines can cause GC.
--
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]