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 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 and provides default no-op
implementation of Processor.close()
.-
Field Summary
Fields Modifier and Type Field Description protected ProcessorContext<KOut,VOut>
context
-
Constructor Summary
Constructors Modifier Constructor Description protected
ContextualProcessor()
-
Method Summary
Modifier and Type Method Description protected ProcessorContext<KOut,VOut>
context()
Get the processor's context set duringinitialization
.void
init(ProcessorContext<KOut,VOut> context)
Initialize this processor with the given context.
-
Field Details
-
context
-
-
Constructor Details
-
ContextualProcessor
protected ContextualProcessor()
-
-
Method Details
-
init
Description copied from interface:Processor
Initialize 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
context
can be used to access topology and record meta data, toschedule
a method to becalled periodically
and to access attachedStateStore
s. -
context
Get the processor's context set duringinitialization
.- Returns:
- the processor context; null only when called prior to
initialization
.
-