public interface StreamTask
MessageCollector
. A StreamTask may be augmented by
implementing other interfaces, such as InitableTask
, WindowableTask
,
or ClosableTask
.
The methods of StreamTasks and associated other tasks are guaranteed to be called in a single-threaded fashion;
no extra synchronization is necessary on the part of the class implementer. References to instances of
IncomingMessageEnvelope
s,MessageCollector
s, and
TaskCoordinator
should not be held onto between calls; there is no guarantee that
these will not be invalidated or otherwise used by the framework.
Modifier and Type | Method and Description |
---|---|
void |
process(IncomingMessageEnvelope envelope,
MessageCollector collector,
TaskCoordinator coordinator)
Called once for each message that this StreamTask receives.
|
void process(IncomingMessageEnvelope envelope, MessageCollector collector, TaskCoordinator coordinator) throws java.lang.Exception
envelope
- Contains the received deserialized message and key, and also information regarding the stream and
partition of which the message was received from.collector
- Contains the means of sending message envelopes to the output stream. The collector must only
be used during the current call to the process method; you should not reuse the collector between invocations
of this method.coordinator
- Manages execution of tasks.java.lang.Exception
- Any exception types encountered during the execution of the processing task.