public class CoGroupedStreams<T1,T2> extends Object
CoGroupedStreams
represents two DataStream
s 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())
}
Modifier and Type | Class and Description |
---|---|
class |
CoGroupedStreams.Where<KEY>
A co-group operation that has
KeySelector s defined for the first input. |
Constructor and Description |
---|
CoGroupedStreams(DataStream<T1> input1,
DataStream<T2> input2) |
Modifier and Type | Method and Description |
---|---|
<F> F |
clean(F f)
Returns a "closure-cleaned" version of the given function.
|
<KEY> CoGroupedStreams.Where<KEY> |
where(scala.Function1<T1,KEY> keySelector,
TypeInformation<KEY> evidence$1)
Specifies a
KeySelector for elements from the first input. |
public CoGroupedStreams(DataStream<T1> input1, DataStream<T2> input2)
public <KEY> CoGroupedStreams.Where<KEY> where(scala.Function1<T1,KEY> keySelector, TypeInformation<KEY> evidence$1)
KeySelector
for elements from the first input.public <F> F clean(F f)
ExecutionConfig
.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.