use of org.apache.samza.operators.stream.InputStreamInternal in project samza by apache.
the class StreamOperatorTask method process.
/**
* Passes the incoming message envelopes along to the {@link org.apache.samza.operators.impl.RootOperatorImpl} node
* for the input {@link SystemStream}.
* <p>
* From then on, each {@link org.apache.samza.operators.impl.OperatorImpl} propagates its transformed output to
* its chained {@link org.apache.samza.operators.impl.OperatorImpl}s itself.
*
* @param ime incoming message envelope to process
* @param collector the collector to send messages with
* @param coordinator the coordinator to request commits or shutdown
*/
@Override
public final void process(IncomingMessageEnvelope ime, MessageCollector collector, TaskCoordinator coordinator) {
SystemStream systemStream = ime.getSystemStreamPartition().getSystemStream();
InputStreamInternal inputStream = inputSystemStreamToInputStream.get(systemStream);
RootOperatorImpl rootOperatorImpl = operatorImplGraph.getRootOperator(systemStream);
if (rootOperatorImpl != null) {
// TODO: SAMZA-1148 - Cast to appropriate input (key, msg) types based on the serde
// before applying the msgBuilder.
Object message = inputStream.getMsgBuilder().apply(ime.getKey(), ime.getMessage());
rootOperatorImpl.onMessage(message, collector, coordinator);
}
}
use of org.apache.samza.operators.stream.InputStreamInternal in project samza by apache.
the class StreamGraphImpl method getAllOperatorSpecs.
/**
* Get all {@link OperatorSpec}s available in this {@link StreamGraphImpl}
*
* @return a set of all available {@link OperatorSpec}s
*/
public Collection<OperatorSpec> getAllOperatorSpecs() {
Collection<InputStreamInternal> inputStreams = inStreams.values();
Set<OperatorSpec> operatorSpecs = new HashSet<>();
for (InputStreamInternal stream : inputStreams) {
doGetOperatorSpecs((MessageStreamImpl) stream, operatorSpecs);
}
return operatorSpecs;
}
Aggregations