M
- type of MessageEnvelope
s in this stream@InterfaceStability.Unstable public interface MessageStream<M extends MessageEnvelope>
MessageEnvelope
s.
A MessageStream
can be transformed into another MessageStream
by applying the transforms in this API.
Modifier and Type | Method and Description |
---|---|
MessageStream<M> |
filter(FilterFunction<M> filterFn)
Applies the provided
FilterFunction to MessageEnvelope s in this MessageStream and returns the
transformed MessageStream . |
<TM extends MessageEnvelope> |
flatMap(FlatMapFunction<M,TM> flatMapFn)
Applies the provided 1:n
FlatMapFunction to transform a MessageEnvelope in this MessageStream
to n MessageEnvelope s in the transformed MessageStream |
<K,OM extends MessageEnvelope<K,?>,RM extends MessageEnvelope> |
join(MessageStream<OM> otherStream,
JoinFunction<M,OM,RM> joinFn)
|
<TM extends MessageEnvelope> |
map(MapFunction<M,TM> mapFn)
Applies the provided 1:1
MapFunction to MessageEnvelope s in this MessageStream and returns the
transformed MessageStream . |
MessageStream<M> |
merge(java.util.Collection<MessageStream<M>> otherStreams)
Merge all
otherStreams with this MessageStream . |
void |
sink(SinkFunction<M> sinkFn)
Allows sending
MessageEnvelope s in this MessageStream to an output
SystemStream using the provided SinkFunction . |
<K,WV,WM extends WindowPane<K,WV>> |
window(Window<M,K,WV,WM> window)
Groups and processes the
MessageEnvelope s in this MessageStream according to the provided Window
(e.g. |
<TM extends MessageEnvelope> MessageStream<TM> map(MapFunction<M,TM> mapFn)
MapFunction
to MessageEnvelope
s in this MessageStream
and returns the
transformed MessageStream
.TM
- the type of MessageEnvelope
s in the transformed MessageStream
mapFn
- the function to transform a MessageEnvelope
to another MessageEnvelope
MessageStream
<TM extends MessageEnvelope> MessageStream<TM> flatMap(FlatMapFunction<M,TM> flatMapFn)
FlatMapFunction
to transform a MessageEnvelope
in this MessageStream
to n MessageEnvelope
s in the transformed MessageStream
TM
- the type of MessageEnvelope
s in the transformed MessageStream
flatMapFn
- the function to transform a MessageEnvelope
to zero or more MessageEnvelope
sMessageStream
MessageStream<M> filter(FilterFunction<M> filterFn)
FilterFunction
to MessageEnvelope
s in this MessageStream
and returns the
transformed MessageStream
.
The FilterFunction
is a predicate which determines whether a MessageEnvelope
in this MessageStream
should be retained in the transformed MessageStream
.
filterFn
- the predicate to filter MessageEnvelope
s from this MessageStream
MessageStream
void sink(SinkFunction<M> sinkFn)
MessageEnvelope
s in this MessageStream
to an output
SystemStream
using the provided SinkFunction
.sinkFn
- the function to send MessageEnvelope
s in this stream to output systems<K,WV,WM extends WindowPane<K,WV>> MessageStream<WM> window(Window<M,K,WV,WM> window)
MessageEnvelope
s in this MessageStream
according to the provided Window
(e.g. tumbling, sliding or session windows) and returns the transformed MessageStream
of
WindowPane
s.
Use the Windows
helper methods to create the appropriate windows.
K
- the type of key in the MessageEnvelope
in this MessageStream
. If a key is specified,
panes are emitted per-key.WV
- the type of value in the WindowPane
in the transformed MessageStream
WM
- the type of WindowPane
in the transformed MessageStream
window
- the window to group and process MessageEnvelope
s from this MessageStream
MessageStream
<K,OM extends MessageEnvelope<K,?>,RM extends MessageEnvelope> MessageStream<RM> join(MessageStream<OM> otherStream, JoinFunction<M,OM,RM> joinFn)
MessageStream
with another MessageStream
using the provided pairwise JoinFunction
.
We currently only support 2-way joins.
K
- the type of join keyOM
- the type of MessageEnvelope
s in the other streamRM
- the type of MessageEnvelope
s resulting from the joinFn
otherStream
- the other MessageStream
to be joined withjoinFn
- the function to join MessageEnvelope
s from this and the other MessageStream
MessageStream
MessageStream<M> merge(java.util.Collection<MessageStream<M>> otherStreams)
otherStreams
with this MessageStream
.
The merging streams must have the same MessageEnvelope
type M
.
otherStreams
- other MessageStream
s to be merged with this MessageStream
MessageStream