[ https://issues.apache.org/jira/browse/STORM-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15191361#comment-15191361 ]
ASF GitHub Bot commented on STORM-1616: --------------------------------------- Github user arunmahadevan commented on a diff in the pull request: https://github.com/apache/storm/pull/1199#discussion_r55870224 --- Diff: storm-core/src/jvm/org/apache/storm/trident/Stream.java --- @@ -124,6 +124,31 @@ public Stream parallelismHint(int hint) { } /** + * Sets the CPU Load resource for the current node + */ + public Stream setCPULoad(Number load) { --- End diff -- Actually naming the operations wherever specific config needs to be applied looks cleaner and it separates out the streaming operations from the config specification. ```java TridentTopology topo = new TridentTopology(); TridentState wordCounts = topology.newStream("spout1", spout) .name("spout1") .each(new Fields("sentence"), new Split(), new Fields("word")) .name("split_operation") .groupBy(new Fields("word")) .persistentAggregate(new MemorymapState.Factory(), new Count(), new Fields("count")) .name("aggregate"); ``` And then ```java topology.setConfig("spout1", Config.cpuLoad(20).memoryLoad(1024)) .setConfig("split_operation", Config.cpuLoad(20).memoryLoad(256)) .setConfig("aggregate", Config.parallelismHint(6)); ``` The concern with directly adding each config api in Stream is that we might want to add more configs in future and then it would mess up the Stream api. > 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)