M - type of MessageEnvelopes in this stream@InterfaceStability.Unstable public interface MessageStream<M extends MessageEnvelope>
MessageEnvelopes.
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 MessageEnvelopes 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 MessageEnvelopes 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 MessageEnvelopes 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
MessageEnvelopes 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
MessageEnvelopes in this MessageStream according to the provided Window
(e.g. |
<TM extends MessageEnvelope> MessageStream<TM> map(MapFunction<M,TM> mapFn)
MapFunction to MessageEnvelopes in this MessageStream and returns the
transformed MessageStream.TM - the type of MessageEnvelopes in the transformed MessageStreammapFn - the function to transform a MessageEnvelope to another MessageEnvelopeMessageStream<TM extends MessageEnvelope> MessageStream<TM> flatMap(FlatMapFunction<M,TM> flatMapFn)
FlatMapFunction to transform a MessageEnvelope in this MessageStream
to n MessageEnvelopes in the transformed MessageStreamTM - the type of MessageEnvelopes in the transformed MessageStreamflatMapFn - the function to transform a MessageEnvelope to zero or more MessageEnvelopesMessageStreamMessageStream<M> filter(FilterFunction<M> filterFn)
FilterFunction to MessageEnvelopes 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 MessageEnvelopes from this MessageStreamMessageStreamvoid sink(SinkFunction<M> sinkFn)
MessageEnvelopes in this MessageStream to an output
SystemStream using the provided SinkFunction.sinkFn - the function to send MessageEnvelopes in this stream to output systems<K,WV,WM extends WindowPane<K,WV>> MessageStream<WM> window(Window<M,K,WV,WM> window)
MessageEnvelopes in this MessageStream according to the provided Window
(e.g. tumbling, sliding or session windows) and returns the transformed MessageStream of
WindowPanes.
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 MessageStreamWM - the type of WindowPane in the transformed MessageStreamwindow - the window to group and process MessageEnvelopes from this MessageStreamMessageStream<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 MessageEnvelopes in the other streamRM - the type of MessageEnvelopes resulting from the joinFnotherStream - the other MessageStream to be joined withjoinFn - the function to join MessageEnvelopes from this and the other MessageStreamMessageStreamMessageStream<M> merge(java.util.Collection<MessageStream<M>> otherStreams)
otherStreams with this MessageStream.
The merging streams must have the same MessageEnvelope type M.
otherStreams - other MessageStreams to be merged with this MessageStreamMessageStream