KIn - the type of input keysVIn - the type of input valuesKOut - the type of output keysVOut - the type of output valuespublic interface Processor<KIn,VIn,KOut,VOut>
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Close this processor and clean up any resources.
|
default void |
init(ProcessorContext<KOut,VOut> context)
Initialize this processor with the given context.
|
void |
process(Record<KIn,VIn> record)
Process the record.
|
default void init(ProcessorContext<KOut,VOut> context)
close() will be called on it; the
framework may later re-use the processor by calling #init() again.
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 StateStores.
context - the context; may not be nullvoid process(Record<KIn,VIn> record)
record - the record to processdefault void close()
#close() is called after an internal cleanup.
Thus, it is not possible to write anything to Kafka as underlying clients are already closed. The framework may
later re-use this processor by calling #init() on it again.
Note: Do not close any streams managed resources, like StateStores here, as they are managed by the library.