K
- the type of keysV
- the type of values@InterfaceStability.Evolving public interface Processor<K,V>
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this processor and clean up any resources.
|
void |
init(ProcessorContext context)
Initialize this processor with the given context.
|
void |
process(K key,
V value)
Process the record with the given key and value.
|
void |
punctuate(long timestamp)
Perform any periodic operations, if this processor
schedule itself with the context
during initialization . |
void init(ProcessorContext context)
If this processor is to be called periodically
by the framework, then this method should
schedule itself
with the provided context.
context
- the context; may not be nullvoid process(K key, V value)
key
- the key for the recordvalue
- the value for the recordvoid punctuate(long timestamp)
schedule itself
with the context
during initialization
.timestamp
- the stream time when this method is being calledvoid close()
close()
is called after an internal cleanup.
Thus, it is not possible to write anything to Kafka as underlying clients are already closed.
Note: Do not close any streams managed resources, like StateStore
s here, as they are managed by the library.