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

ASF GitHub Bot commented on STORM-1616:
---------------------------------------

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

    https://github.com/apache/storm/pull/1199#discussion_r55755494
  
    --- 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 --
    
    I can look at adding a method for including a component -> resources map 
when creating a trident topology. 
    
    As for the others:
    There's not really a clean way to add this to TridentTopology, and we 
wanted some way to specify resources similar to RAS's API. Stream is the 
cleanest place for it, and it works just like `parallelismHint(...)` does.
    
    Having one method, 'nodeConfig(...)' with a `NodeConfig` object would 
reduce the number of new methods in Stream, like you said. I don't really see 
that as looking any better for the end-user, though. Consider this:
    ```java
    TridentTopology topo = new TridentTopology();
    TridentState wordCounts = 
        topology.newStream("spout1", spout)
            .setCPULoad(50)
            .setMemoryLoad(1024)
            .each(new Fields("sentence"), new Split(), new Fields("word"))
            .setCPULoad(100)
            .setMemoryLoad(256)
            .groupBy(new Fields("word"))
            .persistentAggregate(new MemorymapState.Factory(), new Count(), new 
Fields("count"))
            .parallelismHint(6);
    ```
    
    Would become this:
    ```java
    TridentTopology topo = new TridentTopology();
    TridentState wordCounts = 
        topology.newStream("spout1", spout)
            .nodeConfig(new NodeConfig()
                            .setCPULoad(50)
                            .setMemoryLoad(1024))
            .each(new Fields("sentence"), new Split(), new Fields("word"))
            .nodeConfig(new NodeConfig()
                            .setCPULoad(100)
                            .setMemoryLoad(256))
            .groupBy(new Fields("word"))
            .persistentAggregate(new MemorymapState.Factory(), new Count(), new 
Fields("count"))
            .parallelismHint(6);
    ```
    
    I may be missing the benefit here, but as far as I can tell, users 
shouldn't really need to be aware of Nodes at all. They're supposed to be 
internal to Trident.


> 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