xyuanlu commented on code in PR #2456:
URL: https://github.com/apache/helix/pull/2456#discussion_r1177312628
##########
helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java:
##########
@@ -709,17 +698,17 @@ private void logPartitionMapState(String resource,
Set<Partition> allPartitions,
/**
* POJO that maps resource name to its priority represented by an integer.
*/
- private static class ResourcePriority {
- private String _resourceName;
- private int _priority;
+ private static class ResourcePriority implements
Comparable<ResourcePriority> {
+ private final String _resourceName;
+ private int _priority = Integer.MIN_VALUE;
- ResourcePriority(String resourceName, Integer priority) {
+ ResourcePriority(String resourceName) {
_resourceName = resourceName;
- _priority = priority;
}
+ @Override
public int compareTo(ResourcePriority resourcePriority) {
- return Integer.compare(_priority, resourcePriority._priority);
+ return Integer.compare(resourcePriority._priority, _priority);
Review Comment:
curious, why we change order?
--
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]