[ https://issues.apache.org/jira/browse/STORM-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15190492#comment-15190492 ]
ASF GitHub Bot commented on STORM-1616: --------------------------------------- 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); ``` > Add RAS API for Trident > ----------------------- > > Key: STORM-1616 > URL: https://issues.apache.org/jira/browse/STORM-1616 > Project: Apache Storm > Issue Type: Bug > Reporter: Kyle Nusbaum > Assignee: Kyle Nusbaum > -- This message was sent by Atlassian JIRA (v6.3.4#6332)