You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/02/15 00:31:27 UTC
[GitHub] [helix] NealSun96 commented on a change in pull request #1959: remove sort for each round
NealSun96 commented on a change in pull request #1959:
URL: https://github.com/apache/helix/pull/1959#discussion_r806351068
##########
File path: helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithm.java
##########
@@ -75,15 +75,13 @@ public OptimalAssignment calculate(ClusterModel clusterModel) throws HelixRebala
computeOverallClusterRemainingCapacity(nodes);
// Create a wrapper for each AssignableReplica.
- Set<AssignableReplicaWithScore> toBeAssignedReplicas =
- clusterModel.getAssignableReplicaMap().values().stream()
- .flatMap(replicas -> replicas.stream())
- .map(replica -> new AssignableReplicaWithScore(replica, clusterModel))
- .collect(Collectors.toSet());
+ List<AssignableReplicaWithScore> toBeAssignedReplicas =
+ clusterModel.getAssignableReplicaMap().values().stream().flatMap(Collection::stream).map(
+ replica -> new AssignableReplicaWithScore(replica, clusterModel,
Review comment:
Is it possible to avoid creating the object for faster performance? i.e. can we just calculate the score here with a function?
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org