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 2019/11/12 21:16:28 UTC

[GitHub] [helix] narendly commented on a change in pull request #586: Improve the WAGED rebalancer performance.

narendly commented on a change in pull request #586: Improve the WAGED rebalancer performance.
URL: https://github.com/apache/helix/pull/586#discussion_r345447475
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedRebalancer.java
 ##########
 @@ -296,27 +332,21 @@ public void close() {
       Set<String> activeNodes, final CurrentStateOutput currentStateOutput)
       throws HelixRebalanceException {
     getChangeDetector().updateSnapshots(clusterData);
-    // Get all the changed items' information
-    Map<HelixConstants.ChangeType, Set<String>> clusterChanges =
+    // Get all the changed items' information. Filter for the items that have content changed.
+    final Map<HelixConstants.ChangeType, Set<String>> clusterChanges =
         getChangeDetector().getChangeTypes().stream()
             .collect(Collectors.toMap(changeType -> changeType, changeType -> {
               Set<String> itemKeys = new HashSet<>();
               itemKeys.addAll(getChangeDetector().getAdditionsByType(changeType));
               itemKeys.addAll(getChangeDetector().getChangesByType(changeType));
               itemKeys.addAll(getChangeDetector().getRemovalsByType(changeType));
               return itemKeys;
-            }));
-    // Filter for the items that have content changed.
-    clusterChanges =
-        clusterChanges.entrySet().stream().filter(changeEntry -> !changeEntry.getValue().isEmpty())
+            })).entrySet().stream().filter(changeEntry -> !changeEntry.getValue().isEmpty())
 
 Review comment:
   can you parallel stream this?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org