Interface InternalProcessorContext
-
- All Superinterfaces:
ProcessorContext
- All Known Implementing Classes:
AbstractProcessorContext,GlobalProcessorContextImpl,ProcessorContextImpl
public interface InternalProcessorContext extends ProcessorContext
For internal use so we can update theRecordContextand currentProcessorNodewhen we are forwarding items that have been evicted or flushed fromThreadCache
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.kafka.common.serialization.ByteArraySerializerBYTEARRAY_VALUE_SERIALIZERstatic org.apache.kafka.common.serialization.BytesSerializerBYTES_KEY_SERIALIZER
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ThreadCachecache()Get the thread-global cacheProcessorNode<?,?>currentNode()Get the currentProcessorNodelongcurrentSystemTimeMs()default <T extends StateStore>
TgetStateStore(StoreBuilder<T> builder)Get a correctly typed state store, given a handle on the original builder.voidinitialize()Mark this context as being initializedvoidlogChange(java.lang.String storeName, org.apache.kafka.common.utils.Bytes key, byte[] value, long timestamp)StreamsMetricsImplmetrics()Returns Metrics instance.ProcessorRecordContextrecordContext()Returns the currentRecordContextvoidregisterCacheFlushListener(java.lang.String namespace, ThreadCache.DirtyEntryFlushListener listener)Register a dirty entry flush listener for a particular namespacevoidsetCurrentNode(ProcessorNode<?,?> currentNode)voidsetRecordContext(ProcessorRecordContext recordContext)voidsetSystemTimeMs(long timeMs)Task.TaskTypetaskType()voidtransitionToActive(StreamTask streamTask, RecordCollector recordCollector, ThreadCache newCache)Transition to active task and register a new task and cache to this processor contextvoidtransitionToStandby(ThreadCache newCache)Transition to standby task and register a dummy cache to this processor contextvoiduninitialize()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
-
-
-
-
Method Detail
-
metrics
StreamsMetricsImpl metrics()
Description copied from interface:ProcessorContextReturns Metrics instance.- Specified by:
metricsin 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- theProcessorRecordContextfor 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(java.lang.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(java.lang.String storeName, org.apache.kafka.common.utils.Bytes key, byte[] value, long timestamp)
-
-