[
https://issues.apache.org/jira/browse/STORM-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15194300#comment-15194300
]
ASF GitHub Bot commented on STORM-1616:
---------------------------------------
Github user knusbaum commented on the pull request:
https://github.com/apache/storm/pull/1199#issuecomment-196548786
arunmahadevan added a note 3 days ago
> Actually naming the operations wherever specific config needs to be
applied looks cleaner and it separates out the streaming operations from the
config specification.
>
```
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
```
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.'
This does not work, and would require an overhaul of the way naming works
right now. First off, your example won't compile. `persistentAggregate` returns
a `TridentState`, which doesn't have a `name` method. Okay, well we can move
the name call up to just below the groupBy. It's a little confusing being right
in the middle, but groupBy returns a `GroupedStream`, which has a name method.
Unfortunately, you end up with all your bolts being named "b-*-aggregate"
because 'GroupedStream' just renames the stream before it. In fact, except for
differentiating between the spout and body, I don't see any existing way to
give different sections different names, and doing so is not a simple change,
and not one that is going to be backwards-compatible.
I agree with your point in principle, but how much do we want to change the
existing API to accommodate it?
> 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)