[ 
https://issues.apache.org/jira/browse/STORM-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15191229#comment-15191229
 ] 

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_r55857918
  
    --- 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 --
    
    It is better to have these configs to be set at respective operation level 
in a stream with intuitive API than setting at topology level. Below API is 
suggested which may look more verbose than setXXXLoad method but it clearly 
conveys what it is for.   
    But we should not have API for this configuration at topology level as it 
requires to name these operations and use those names with load configs in 
topology looks to be clunky. 
    
    ``` java
    TridentTopology topo = new TridentTopology();
    TridentState wordCounts = 
        topology.newStream("spout1", spout)
            .withLoadConfig(new LoadConfigBuilder().
                            .withCPULoad(50)
                            .withMemoryLoad(1024).build())
            .each(new Fields("sentence"), new Split(), new Fields("word"))
             .withLoadConfig(new LoadConfigBuilder().
                            .withCPULoad(20)
                            .withMemoryLoad(256).build())
            .groupBy(new Fields("word"))
            .persistentAggregate(new MemorymapState.Factory(), new Count(), new 
Fields("count"))
            .parallelismHint(6);
    ```


> 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)

Reply via email to