CoGroupedStreams
org.apache.flinkx.api.CoGroupedStreams
@Public
CoGroupedStreams
represents two DataStreams that have been co-grouped. A streaming co-group operation is evaluated over elements in a window.
To finalize the co-group operation you also need to specify a KeySelector for both the first and second input and a WindowAssigner
Note: Right now, the groups are being built in memory so you need to ensure that they don't get too big. Otherwise the JVM might crash.
Example:
val one: DataStream[(String, Int)] = ...
val two: DataStream[(String, Int)] = ...
val result = one.coGroup(two)
.where(new MyFirstKeySelector())
.equalTo(new MyFirstKeySelector())
.window(TumblingEventTimeWindows.of(Time.of(5, TimeUnit.SECONDS)))
.apply(new MyCoGroupFunction())
}
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article