Interface Processor<K,V>
-
- Type Parameters:
K- the type of keysV- the type of values
- All Known Implementing Classes:
AbstractProcessor
@Evolving public interface Processor<K,V>A processor of key-value pair records.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidclose()Close this processor and clean up any resources.voidinit(ProcessorContext context)Initialize this processor with the given context.voidprocess(K key, V value)Process the record with the given key and value.voidpunctuate(long timestamp)Deprecated.Please usePunctuatorfunctional interface instead.
-
-
-
Method Detail
-
init
void init(ProcessorContext context)
Initialize this processor with the given context. The framework ensures this is called once per processor when the topology that contains it is initialized.The provided
contextcan be used to access topology and record meta data, toschedulea method to becalled periodicallyand to access attachedStateStores.- Parameters:
context- the context; may not be null
-
process
void process(K key, V value)
Process the record with the given key and value.- Parameters:
key- the key for the recordvalue- the value for the record
-
punctuate
@Deprecated void punctuate(long timestamp)
Deprecated.Please usePunctuatorfunctional interface instead.Perform any periodic operations, if this processorschedule itselfwith the context duringinitialization.- Parameters:
timestamp- the stream time when this method is being called
-
close
void close()
Close this processor and clean up any resources. Be aware thatclose()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
StateStores here, as they are managed by the library.
-
-