Github user satishd commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1199#discussion_r55792061
  
    --- Diff: storm-core/src/jvm/org/apache/storm/trident/TridentTopology.java 
---
    @@ -394,11 +395,28 @@ public StormTopology build() {
             Map<Node, String> spoutIds = genSpoutIds(spoutNodes);
             Map<Group, String> boltIds = genBoltIds(mergedGroups);
             
    +        Map defaults = Utils.readDefaultConfig();
    +
             for(SpoutNode sn: spoutNodes) {
                 Integer parallelism = parallelisms.get(grouper.nodeGroup(sn));
    +
    +            Map<String, Number> spoutRes = null;
    +            if(sn instanceof ITridentResource) {
    +                spoutRes = 
mergeDefaultResources(((ITridentResource)sn).getResources(), defaults);
    +            }
    +            else {
    +                spoutRes = mergeDefaultResources(null, defaults);
    +            }
    --- End diff --
    
    sn is always an instance of ITridentResource and you can have simple null 
check over here. You may want to replace if/else block with the below.
    ``` java
                Map<String, Number> spoutRes = mergeDefaultResources((sn != 
null ? sn.getResources() : null), defaults);
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to