pkuwm commented on a change in pull request #369: Add the workaround fix for
assigning partitions when instance weight …
URL: https://github.com/apache/helix/pull/369#discussion_r309932250
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/rebalancer/strategy/crushMapping/CardDealingAdjustmentAlgorithmV2.java
##########
@@ -193,9 +213,7 @@ public int compare(Node node1, Node node2) {
List<String> partitions = assignmentMap.containsKey(instance) ?
assignmentMap.get(instance) :
new ArrayList<String>();
- int space =
- (int) (Math.floor(targetPartitionCount.get(instance))) +
targetAdjustment - partitions
- .size();
+ int space = instance.getWeight() <= 0 ? 0: (int)
(Math.floor(targetPartitionCount.get(instance))) + targetAdjustment -
partitions.size();
Review comment:
Format the style before `:`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services