Class AbstractProcessor<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.processor.AbstractProcessor<K,V>
-
- Type Parameters:
K- the type of keysV- the type of values
- All Implemented Interfaces:
Processor<K,V>
public abstract class AbstractProcessor<K,V> extends java.lang.Object implements Processor<K,V>
An abstract implementation ofProcessorthat manages theProcessorContextinstance and provides default no-op implementations ofpunctuate(long)andclose().
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this processor and clean up any resources.protected ProcessorContextcontext()Get the processor's context set duringinitialization.voidinit(ProcessorContext context)Initialize this processor with the given context.voidpunctuate(long timestamp)Perform any periodic operations, if this processorschedule itselfwith the context duringinitialization.
-
-
-
Method Detail
-
init
public void init(ProcessorContext context)
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.The provided
contextcan be used to access topology and record meta data, toschedulea method to becalled periodicallyand to access attachedStateStores.
-
punctuate
public void punctuate(long timestamp)
Perform any periodic operations, if this processorschedule itselfwith the context duringinitialization.This method does nothing by default; if desired, subclasses should override it with custom functionality.
-
close
public void close()
Close this processor and clean up any resources.This method does nothing by default; if desired, subclasses should override it with custom functionality.
-
context
protected final ProcessorContext context()
Get the processor's context set duringinitialization.- Returns:
- the processor context; null only when called prior to
initialization.
-
-