Class ContextualProcessor<KIn,VIn,KOut,VOut>
java.lang.Object
org.apache.kafka.streams.processor.api.ContextualProcessor<KIn,VIn,KOut,VOut>
- Type Parameters:
KIn- the type of input keysVIn- the type of input valuesKOut- the type of output keysVOut- the type of output values
- All Implemented Interfaces:
Processor<KIn,VIn, KOut, VOut>
@Public
public abstract class ContextualProcessor<KIn,VIn,KOut,VOut>
extends Object
implements Processor<KIn,VIn,KOut,VOut>
An abstract implementation of
Processor that manages the ProcessorContext instance.-
Method Details
-
init
Description copied from interface:ProcessorInitialize this processor with the given context. The framework ensures this is called once per processor when the topology that contains it is initialized. When the framework is done with the processor,Processor.close()will be called on it; the framework may later re-use the processor by calling#init()again.The provided
contextcan be used to access topology and record meta data, toschedulea method to becalled periodicallyand to access attachedStateStores.State stores attached to this processor are fully restored from their changelog topics before
init()is called. However, for stores that report approximate sizes (notably the default RocksDB-backed stores), size estimates such asReadOnlyKeyValueStore.approximateNumEntries()may not yet reflect post-compaction counts at this point and can include duplicate writes and tombstones replayed during restoration; see that method's Javadoc for details.
-