Hi Manu,
If my understanding is right, groupBy() doesn't do anything unless you call
one or some of GroupedStream's methods.
https://github.com/apache/storm/blob/v1.0.2/storm-core/src/jvm/org/apache/storm/trident/fluent/GroupedStream.java
Thus, `groupBy("ip").toStream().window` is same to `stream.window`, making
no effect on groupBy.
So you might want to implement your own Aggregator which aggregates tuples
by fields group, and pass to window() method on Stream.
There's GroupedAggregator but it's used as an implementation details on
Trident API, not intended to be used as public API. You could still give it
a try to wrap your Aggregator to GroupedAggregator and pass to window.
https://github.com/apache/storm/blob/v1.0.2/storm-core/src/jvm/org/apache/storm/trident/operation/impl/GroupedAggregator.java
Hope this helps.
Thanks,
Jungtaek Lim (HeartSaVioR)
2016년 8월 25일 (목) 오전 10:52, Manu Zhang <[email protected]>님이 작성:
> Hi,
>
> I'm writing an Trident application calculating uservisits in sliding
> windows. The current flow is to group uservisits by IP and then count over
> windows but the problem is `GroupedStream` doesn't have a window function.
> I'm not sure `groupBy("ip").toStream().window` is the right way to go. Any
> documentation and examples will be very helpful.
>
> Thanks,
> Manu Zhang
>