Interface InternalProcessorContext
-
- All Superinterfaces:
ProcessorContext
- All Known Implementing Classes:
AbstractProcessorContext
,GlobalProcessorContextImpl
,ProcessorContextImpl
public interface InternalProcessorContext extends ProcessorContext
For internal use so we can update theRecordContext
and currentProcessorNode
when we are forwarding items that have been evicted or flushed fromThreadCache
-
-
Field Summary
Fields Modifier and Type Field Description static ByteArraySerializer
BYTEARRAY_VALUE_SERIALIZER
static BytesSerializer
BYTES_KEY_SERIALIZER
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ThreadCache
cache()
Get the thread-global cacheProcessorNode<?,?>
currentNode()
Get the currentProcessorNode
long
currentSystemTimeMs()
default <T extends StateStore>
TgetStateStore(StoreBuilder<T> builder)
Get a correctly typed state store, given a handle on the original builder.void
initialize()
Mark this context as being initializedvoid
logChange(String storeName, org.apache.kafka.common.utils.Bytes key, byte[] value, long timestamp)
StreamsMetricsImpl
metrics()
Returns Metrics instance.ProcessorRecordContext
recordContext()
Returns the currentRecordContext
void
registerCacheFlushListener(String namespace, ThreadCache.DirtyEntryFlushListener listener)
Register a dirty entry flush listener for a particular namespacevoid
setCurrentNode(ProcessorNode<?,?> currentNode)
void
setRecordContext(ProcessorRecordContext recordContext)
void
setSystemTimeMs(long timeMs)
Task.TaskType
taskType()
void
transitionToActive(StreamTask streamTask, RecordCollector recordCollector, ThreadCache newCache)
Transition to active task and register a new task and cache to this processor contextvoid
transitionToStandby(ThreadCache newCache)
Transition to standby task and register a dummy cache to this processor contextvoid
uninitialize()
Mark this context as being uninitialized-
Methods inherited from interface org.apache.kafka.streams.processor.ProcessorContext
appConfigs, appConfigsWithPrefix, applicationId, applicationInternalStream, commit, forward, forward, forward, forward, getStateStore, headers, keySerde, offset, partition, register, schedule, schedule, stateDir, taskId, timestamp, topic, valueSerde
-
-
-
-
Field Detail
-
BYTES_KEY_SERIALIZER
static final BytesSerializer BYTES_KEY_SERIALIZER
-
BYTEARRAY_VALUE_SERIALIZER
static final ByteArraySerializer BYTEARRAY_VALUE_SERIALIZER
-
-
Method Detail
-
metrics
StreamsMetricsImpl metrics()
Description copied from interface:ProcessorContext
Returns Metrics instance.- Specified by:
metrics
in interfaceProcessorContext
- Returns:
- StreamsMetrics
-
setSystemTimeMs
void setSystemTimeMs(long timeMs)
- Parameters:
timeMs
- current wall-clock system timestamp in milliseconds
-
currentSystemTimeMs
long currentSystemTimeMs()
-
recordContext
ProcessorRecordContext recordContext()
Returns the currentRecordContext
- Returns:
- the current
RecordContext
-
setRecordContext
void setRecordContext(ProcessorRecordContext recordContext)
- Parameters:
recordContext
- theProcessorRecordContext
for the record about to be processes
-
setCurrentNode
void setCurrentNode(ProcessorNode<?,?> currentNode)
- Parameters:
currentNode
- the currentProcessorNode
-
currentNode
ProcessorNode<?,?> currentNode()
Get the currentProcessorNode
-
cache
ThreadCache cache()
Get the thread-global cache
-
initialize
void initialize()
Mark this context as being initialized
-
uninitialize
void uninitialize()
Mark this context as being uninitialized
-
taskType
Task.TaskType taskType()
- Returns:
- the type of task (active/standby/global) that this context corresponds to
-
transitionToActive
void transitionToActive(StreamTask streamTask, RecordCollector recordCollector, ThreadCache newCache)
Transition to active task and register a new task and cache to this processor context
-
transitionToStandby
void transitionToStandby(ThreadCache newCache)
Transition to standby task and register a dummy cache to this processor context
-
registerCacheFlushListener
void registerCacheFlushListener(String namespace, ThreadCache.DirtyEntryFlushListener listener)
Register a dirty entry flush listener for a particular namespace
-
getStateStore
default <T extends StateStore> T getStateStore(StoreBuilder<T> builder)
Get a correctly typed state store, given a handle on the original builder.
-
logChange
void logChange(String storeName, org.apache.kafka.common.utils.Bytes key, byte[] value, long timestamp)
-
-