K
- the type of keysV
- the type of valuespublic abstract class AbstractProcessor<K,V> extends Object implements Processor<K,V>
Processor
that manages the ProcessorContext
instance and provides default no-op
implementations of punctuate(long)
and close()
.Modifier | Constructor and Description |
---|---|
protected |
AbstractProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this processor and clean up any resources.
|
protected ProcessorContext |
context()
Get the processor's context set during
initialization . |
void |
init(ProcessorContext context)
Initialize this processor with the given context.
|
void |
punctuate(long timestamp)
Perform any periodic operations, if this processor
schedule itself with the context
during initialization . |
public void init(ProcessorContext context)
Processor
If this processor is to be called periodically
by the framework, then this method should
schedule itself
with the provided context.
public void punctuate(long timestamp)
schedule itself
with the context
during initialization
.
This method does nothing by default; if desired, subclasses should override it with custom functionality.
public void close()
This method does nothing by default; if desired, subclasses should override it with custom functionality.
protected final ProcessorContext context()
initialization
.initialization
.