@InterfaceStability.Unstable public interface StreamGraph
MessageStream
s and OutputStream
s used to describe the processing logic.Modifier and Type | Method and Description |
---|---|
<K,V,M> MessageStream<M> |
getInputStream(java.lang.String streamId,
java.util.function.BiFunction<? super K,? super V,? extends M> msgBuilder)
Gets the input
MessageStream corresponding to the streamId . |
<K,V,M> OutputStream<K,V,M> |
getOutputStream(java.lang.String streamId,
java.util.function.Function<? super M,? extends K> keyExtractor,
java.util.function.Function<? super M,? extends V> msgExtractor)
Gets the
OutputStream corresponding to the streamId . |
StreamGraph |
withContextManager(ContextManager contextManager)
Sets the
ContextManager for this StreamGraph . |
<K,V,M> MessageStream<M> getInputStream(java.lang.String streamId, java.util.function.BiFunction<? super K,? super V,? extends M> msgBuilder)
MessageStream
corresponding to the streamId
.
Multiple invocations of this method with the same streamId
will throw an IllegalStateException
.
K
- the type of key in the incoming messageV
- the type of message in the incoming messageM
- the type of message in the input MessageStream
streamId
- the unique ID for the streammsgBuilder
- the BiFunction
to convert the incoming key and message to a message
in the input MessageStream
MessageStream
java.lang.IllegalStateException
- when invoked multiple times with the same streamId
<K,V,M> OutputStream<K,V,M> getOutputStream(java.lang.String streamId, java.util.function.Function<? super M,? extends K> keyExtractor, java.util.function.Function<? super M,? extends V> msgExtractor)
OutputStream
corresponding to the streamId
.
Multiple invocations of this method with the same streamId
will throw an IllegalStateException
.
K
- the type of key in the outgoing messageV
- the type of message in the outgoing messageM
- the type of message in the OutputStream
streamId
- the unique ID for the streamkeyExtractor
- the Function
to extract the outgoing key from the output messagemsgExtractor
- the Function
to extract the outgoing message from the output messageMessageStream
java.lang.IllegalStateException
- when invoked multiple times with the same streamId
StreamGraph withContextManager(ContextManager contextManager)
ContextManager
for this StreamGraph
.
The provided ContextManager
can be used to setup shared context between the operator functions
within a task instance
contextManager
- the ContextManager
to use for the StreamGraph
StreamGraph
with contextManager
set as its ContextManager