AbstractTask
is the base implementation of the Task contract for tasks that FIXME.
Note
|
AbstractTask is a Java abstract class and cannot be created directly. It is created indirectly for the concrete AbstractTasks.
|
AbstractTask
has taskInitialized
flag that is on (i.e. true
) to mark when:
-
StandbyTask
has finished initializeStateStores successfully -
StreamTask
has finished initializeTopology
The taskInitialized
flag is used by the concrete AbstractTasks as an optimization when:
-
StandbyTask
is requested to close -
StreamTask
is requested to closeTopology
AbstractTask
has taskClosed
flag that is enabled (i.e. true
) to mark when StandbyTask and StreamTask have already been requested to close.
AbstractTask | Description |
---|---|
AbstractTask
takes the following to be created:
-
Assigned Kafka partitions
-
Kafka Consumer (
Consumer<byte[], byte[]>
)
AbstractTask
initializes the internal registries and counters.
Note
|
AbstractTask is a Java abstract class and cannot be created directly. It is created indirectly for the concrete AbstractTasks.
|
void closeStateManager(final boolean writeCheckpoint) throws ProcessorStateException
closeStateManager
…FIXME
Note
|
closeStateManager is used when…FIXME
|
boolean hasStateStores()
Note
|
hasStateStores is part of Task Contract to…FIXME.
|
hasStateStores
is positive (and returns true
) when ProcessorTopology has at least one local state store.
void flushState()
flushState
simply requests the ProcessorStateManager to flush.
Note
|
flushState is used exclusively when StreamTask is requested to commit (using the custom flushState).
|
Map<TopicPartition, Long> recordCollectorOffsets()
recordCollectorOffsets
…FIXME
Note
|
recordCollectorOffsets is used when…FIXME
|
void registerStateStores()
registerStateStores
simply exits when the ProcessorTopology has no state stores.
registerStateStores
requests the StateDirectory for the lock for the state directory of the task (by TaskId).
registerStateStores
prints out the following TRACE message to the logs:
Initializing state stores
registerStateStores
updateOffsetLimits.
In the end, for every StateStore in the ProcessorTopology, registerStateStores
prints out the following TRACE message to the logs:
Initializing store [name]
registerStateStores
requests the InternalProcessorContext to uninitialize and then requests the StateStore
to initialize (with the InternalProcessorContext and itself).
registerStateStores
throws a LockException
when requesting the StateDirectory for the lock for the state directory of the task failed:
[logPrefix]Failed to lock the state directory for task [id]
registerStateStores
throws a StreamsException
when requesting the StateDirectory for the lock for the state directory of the task failed with an IOException
:
[logPrefix]Fatal error while trying to lock the state directory for task [id]
Note
|
registerStateStores is used when the concrete Tasks (StandbyTask and StreamTask) are requested to initialize state stores.
|
Collection<TopicPartition> changelogPartitions()
Note
|
changelogPartitions is part of Task Contract to get the changelog partitions of a task.
|
changelogPartitions
simply requests the ProcessorStateManager for the changelog partitions.
StateStore getStore(final String name)
Note
|
getStore is part of the Task Contract to access the state store by name.
|
getStore
simply requests the ProcessorStateManager for the StateStore by name.
void updateOffsetLimits()
updateOffsetLimits
…FIXME
Note
|
|
void reinitializeStateStoresForPartitions(
Collection<TopicPartition> partitions)
reinitializeStateStoresForPartitions
simply requests the ProcessorStateManager to reinitializeStateStores for the input partitions
and the InternalProcessorContext.
Note
|
|
Map<TopicPartition, Long> activeTaskCheckpointableOffsets()
activeTaskCheckpointableOffsets
simply returns an empty collection (of checkpointable offsets).
Name | Description |
---|---|
|
|
|
|
|
Flag that controls whether Exactly-Once Support is enabled (
Used when (directly or indirectly as
|
|
|
|
Used when:
|