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)
Deprecated.
Please use
Punctuator functional interface instead. |
void init(ProcessorContext context)
The provided context
can be used to access topology and record meta data, to
schedule
a method to be
called periodically
and to access attached StateStore
s.
context
- the context; may not be nullvoid process(K key, V value)
key
- the key for the recordvalue
- the value for the record@Deprecated void punctuate(long timestamp)
Punctuator
functional interface instead.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.