You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2017/09/07 18:09:24 UTC

[6/8] storm git commit: STORM-2678 Improve performance of LoadAwareShuffleGrouping

STORM-2678 Improve performance of LoadAwareShuffleGrouping

* Let chooseTask() read from index 0, not 1


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/ab38a7a0
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/ab38a7a0
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/ab38a7a0

Branch: refs/heads/master
Commit: ab38a7a0c87a857f9a9021d9805d8d63c794ef74
Parents: 08038b6
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed Aug 23 23:42:23 2017 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed Aug 23 23:42:23 2017 +0900

----------------------------------------------------------------------
 .../jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/ab38a7a0/storm-client/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java b/storm-client/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java
index 080c48d..97c5ce1 100644
--- a/storm-client/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java
+++ b/storm-client/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java
@@ -62,7 +62,7 @@ public class LoadAwareShuffleGrouping implements LoadAwareCustomStreamGrouping,
         }
 
         shuffleArray(choices);
-        current = new AtomicInteger(0);
+        current = new AtomicInteger(-1);
 
         // allocate another array to be switched
         prepareChoices = new int[CAPACITY];
@@ -150,7 +150,7 @@ public class LoadAwareShuffleGrouping implements LoadAwareCustomStreamGrouping,
         choices = prepareChoices;
         prepareChoices = tempForSwap;
 
-        current.set(0);
+        current.set(-1);
     }
 
     private void shuffleArray(int[] arr) {