You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by raghavgautam <gi...@git.apache.org> on 2017/01/20 03:07:15 UTC

[GitHub] storm pull request #1889: STORM-2305: STORM-2279 calculates task index diffe...

GitHub user raghavgautam opened a pull request:

    https://github.com/apache/storm/pull/1889

    STORM-2305: STORM-2279 calculates task index different from grouper code

    @HeartSaVioR @arunmahadevan Please review.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/raghavgautam/storm master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/1889.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1889
    
----
commit 97479ac278417c743b3d665bb03ef95c53f297bb
Author: Raghav Kumar Gautam <ra...@apache.org>
Date:   2017-01-20T00:41:00Z

    STORM-2305: STORM-2279 calculates task index different from grouper code

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1889: STORM-2305: STORM-2279 calculates task index diffe...

Posted by arunmahadevan <gi...@git.apache.org>.
Github user arunmahadevan commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1889#discussion_r97013631
  
    --- Diff: storm-core/src/jvm/org/apache/storm/utils/TupleUtils.java ---
    @@ -40,7 +40,11 @@ public static boolean isTick(Tuple tuple) {
                  && Constants.SYSTEM_TICK_STREAM_ID.equals(tuple.getSourceStreamId());
         }
     
    -    public static <T> int listHashCode(List<T> alist) {
    +    public static <T> int chooseTaskIndex(List<T> alist, int numTasks) {
    --- End diff --
    
    nit: rename alist to keys to better convey the meaning.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1889: STORM-2305: STORM-2279 calculates task index diffe...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/storm/pull/1889


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1889: STORM-2305: STORM-2279 calculates task index diffe...

Posted by raghavgautam <gi...@git.apache.org>.
Github user raghavgautam commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1889#discussion_r97081027
  
    --- Diff: storm-core/src/jvm/org/apache/storm/utils/TupleUtils.java ---
    @@ -40,7 +40,11 @@ public static boolean isTick(Tuple tuple) {
                  && Constants.SYSTEM_TICK_STREAM_ID.equals(tuple.getSourceStreamId());
         }
     
    -    public static <T> int listHashCode(List<T> alist) {
    +    public static <T> int chooseTaskIndex(List<T> alist, int numTasks) {
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm issue #1889: STORM-2305: STORM-2279 calculates task index different fr...

Posted by HeartSaVioR <gi...@git.apache.org>.
Github user HeartSaVioR commented on the issue:

    https://github.com/apache/storm/pull/1889
  
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1889: STORM-2305: STORM-2279 calculates task index diffe...

Posted by arunmahadevan <gi...@git.apache.org>.
Github user arunmahadevan commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1889#discussion_r97013363
  
    --- Diff: storm-core/src/jvm/org/apache/storm/daemon/nimbus/Nimbus.java ---
    @@ -3600,8 +3600,7 @@ public ComponentPageInfo getComponentPageInfo(String topoId, String componentId,
                     List<Integer> tasks = compToTasks.get(StormCommon.EVENTLOGGER_COMPONENT_ID);
                     tasks.sort(null);
                     // Find the task the events from this component route to.
    -                int taskIndex = (TupleUtils.listHashCode(Arrays.asList(componentId)) % tasks.size() + tasks.size()) %
    -                        tasks.size();
    +                int taskIndex = TupleUtils.chooseTaskIndex(Arrays.asList(componentId), tasks.size());
    --- End diff --
    
    nit: use `Collections.singletonList(componentId)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1889: STORM-2305: STORM-2279 calculates task index diffe...

Posted by raghavgautam <gi...@git.apache.org>.
Github user raghavgautam commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1889#discussion_r97081014
  
    --- Diff: storm-core/src/jvm/org/apache/storm/daemon/nimbus/Nimbus.java ---
    @@ -3600,8 +3600,7 @@ public ComponentPageInfo getComponentPageInfo(String topoId, String componentId,
                     List<Integer> tasks = compToTasks.get(StormCommon.EVENTLOGGER_COMPONENT_ID);
                     tasks.sort(null);
                     // Find the task the events from this component route to.
    -                int taskIndex = (TupleUtils.listHashCode(Arrays.asList(componentId)) % tasks.size() + tasks.size()) %
    -                        tasks.size();
    +                int taskIndex = TupleUtils.chooseTaskIndex(Arrays.asList(componentId), tasks.size());
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm issue #1889: STORM-2305: STORM-2279 calculates task index different fr...

Posted by arunmahadevan <gi...@git.apache.org>.
Github user arunmahadevan commented on the issue:

    https://github.com/apache/storm/pull/1889
  
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---