I - Type of the input objectO - Type of the output objectpublic interface ContainerProcessor<I,O> extends Serializable
1) Read phase. When Jet reads data from all input producers (previous vertices or taps) and
can write or just collect somewhere input data
2) Finalization phase. When JET uses results of Read-phase (if it presents) and can write or not
data to the output stream
There is strict happens-before relation between execution of processor's execution.
So no needs to use thread-safe structures in case if task created separate processor
using corresponding factory| Modifier and Type | Method and Description |
|---|---|
default void |
afterProcessing(ProcessorContext processorContext)
Will be invoked strictly after last invocation of the corresponding task, strictly
from the executor thread
|
default void |
beforeProcessing(ProcessorContext processorContext)
Will be invoked strictly before first invocation of the corresponding task, strictly
from the executor thread
|
default boolean |
finalizeProcessor(ConsumerOutputStream<O> outputStream,
ProcessorContext processorContext)
Will be invoked on finalization phase
|
default boolean |
process(ProducerInputStream<I> inputStream,
ConsumerOutputStream<O> outputStream,
String sourceName,
ProcessorContext processorContext)
Performs next iteration of execution
|
default void beforeProcessing(ProcessorContext processorContext)
processorContext - context of processordefault boolean process(ProducerInputStream<I> inputStream, ConsumerOutputStream<O> outputStream, String sourceName, ProcessorContext processorContext) throws Exception
inputStream - stream to be used for reading of dataoutputStream - steam to be used for writing of datasourceName - name of the source where data come from (Vertex or Tap)processorContext - context of processorException - if any exceptiondefault boolean finalizeProcessor(ConsumerOutputStream<O> outputStream, ProcessorContext processorContext) throws Exception
outputStream - outputSteam where data should be writtenprocessorContext - context of processorException - if any exceptiondefault void afterProcessing(ProcessorContext processorContext)
processorContext - context of processorCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.