@InterfaceStability.Evolving public interface StreamApplicationDescriptor extends ApplicationDescriptor<StreamApplicationDescriptor>
StreamApplicationDescriptor
contains the description of inputs, outputs, state, configuration and the
processing logic for a Samza High Level API StreamApplication
.
Use the StreamApplicationDescriptor
obtained from SamzaApplication.describe(S)
to get the
MessageStream
s, OutputStream
s and Table
s corresponding to their respective
InputDescriptor
s, OutputDescriptor
s and TableDescriptor
s.
Use the MessageStream
API operators to describe the processing logic for the StreamApplication
.
Modifier and Type | Method and Description |
---|---|
<M> MessageStream<M> |
getInputStream(InputDescriptor<M,?> inputDescriptor)
Gets the input
MessageStream corresponding to the inputDescriptor . |
<M> OutputStream<M> |
getOutputStream(OutputDescriptor<M,?> outputDescriptor)
Gets the
OutputStream corresponding to the outputDescriptor . |
<K,V> Table<KV<K,V>> |
getTable(TableDescriptor<K,V,?> tableDescriptor)
Gets the
Table corresponding to the TableDescriptor . |
getConfig, withApplicationContainerContextFactory, withApplicationTaskContextFactory, withDefaultSystem, withMetricsReporterFactories, withProcessorLifecycleListenerFactory
<M> MessageStream<M> getInputStream(InputDescriptor<M,?> inputDescriptor)
MessageStream
corresponding to the inputDescriptor
.
A MessageStream<KV<K, V>
, obtained by calling this method with a descriptor with a KVSerde<K, V>
,
can receive messages of type KV<K, V>
. An input MessageStream<M>
, obtained using a descriptor with
any other Serde<M>
, can receive messages of type M - the key in the incoming message is ignored.
A KVSerde<NoOpSerde, NoOpSerde>
or NoOpSerde
may be used for the descriptor if the
SystemConsumer
deserializes the incoming messages itself, and no further deserialization is required from
the framework.
Multiple invocations of this method with the same inputDescriptor
will throw an
IllegalStateException
.
M
- the type of messages in the input MessageStream
inputDescriptor
- the descriptor for the streamMessageStream
java.lang.IllegalStateException
- when invoked multiple times with the same inputDescriptor
<M> OutputStream<M> getOutputStream(OutputDescriptor<M,?> outputDescriptor)
OutputStream
corresponding to the outputDescriptor
.
An OutputStream<KV<K, V>>
, obtained by calling this method with a descriptor with a KVSerde<K, V>
,
can send messages of type KV<K, V>
. An OutputStream<M>
, obtained using a descriptor with any
other Serde<M>
, can send messages of type M without a key.
A KVSerde<NoOpSerde, NoOpSerde>
or NoOpSerde
may be used for the descriptor if the
SystemProducer
serializes the outgoing messages itself, and no prior serialization is required from
the framework.
When sending messages to an OutputStream<KV<K, V>>
, messages are partitioned using their serialized key.
When sending messages to any other OutputStream<M>
, messages are partitioned using a null partition key.
Multiple invocations of this method with the same outputDescriptor
will throw an
IllegalStateException
.
M
- the type of messages in the OutputStream
outputDescriptor
- the descriptor for the streamOutputStream
java.lang.IllegalStateException
- when invoked multiple times with the same outputDescriptor
<K,V> Table<KV<K,V>> getTable(TableDescriptor<K,V,?> tableDescriptor)
Table
corresponding to the TableDescriptor
.
Multiple invocations of this method with the same TableDescriptor
will throw an
IllegalStateException
.
K
- the type of the keyV
- the type of the valuetableDescriptor
- the TableDescriptor
Table
corresponding to the tableDescriptor
java.lang.IllegalStateException
- when invoked multiple times with the same TableDescriptor