Interface Processor<T>
-
- Type Parameters:
T
- the type of the input that is processed
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AggregateByKeyProcessor
,AggregateProcessor
,BranchProcessor
,CoGroupByKeyProcessor
,FilterProcessor
,FlatMapProcessor
,FlatMapValuesProcessor
,ForEachProcessor
,JoinProcessor
,MapProcessor
,MapValuesProcessor
,MergeAggregateByKeyProcessor
,MergeAggregateProcessor
,PeekProcessor
,ReduceByKeyProcessor
,ReduceProcessor
,StateQueryProcessor
,UpdateStateByKeyProcessor
@Unstable public interface Processor<T> extends Serializable
A processor processes a stream of elements and produces some result.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(T input, String streamId)
Executes some operations on the input and possibly emits some results.void
init(ProcessorContext context)
Initializes the processor.void
punctuate(String stream)
Punctuation marks end of a batch which can be used to compute and pass the results of one stage in the pipeline to the next.
-
-
-
Method Detail
-
init
void init(ProcessorContext context)
Initializes the processor. This is typically invoked from the underlying storm bolt's prepare method.- Parameters:
context
- the processor context
-
execute
void execute(T input, String streamId)
Executes some operations on the input and possibly emits some results.- Parameters:
input
- the input to be processedstreamId
- the source stream id from where the input is received
-
punctuate
void punctuate(String stream)
Punctuation marks end of a batch which can be used to compute and pass the results of one stage in the pipeline to the next. For e.g. emit the results of an aggregation.- Parameters:
stream
- the stream id on which the punctuation arrived
-
-