StandbyTask

StandbyTask is a concrete processor task that…​FIXME

StandbyTask is created when…​FIXME

StandbyTask is a concrete AbstractTask with isStandby flag on.

Tip

Enable ALL logging level for org.apache.kafka.streams.processor.internals.StandbyTask logger to see what happens inside.

Add the following line to log4j.properties:

log4j.logger.org.apache.kafka.streams.processor.internals.StandbyTask=ALL

closeSuspended Method

void closeSuspended(
  final boolean clean,
  final boolean isZombie,
  final RuntimeException e)
Note
closeSuspended is part of Task Contract to…​FIXME.

closeSuspended…​FIXME

Initializing State Stores — initializeStateStores Method

boolean initializeStateStores()
Note
initializeStateStores is part of Task Contract to initialize state stores.

initializeStateStores…​FIXME

Closing Task — close Method

void close(
  final boolean clean,
  final boolean isZombie)
Note
close is part of Task Contract to close the task.

close prints out the following DEBUG message to the logs:

Closing

With the input clean flag on, close commit followed by closeStateManager (with writeCheckpoint flag on when clean was on and commit was successful).

close marks the StandbyTask as closed (i.e. sets taskClosed to true).

close returns immediately if the StandbyTask has not been initialized yet, i.e. when StandbyTask has not been requested to initializeStateStores yet.

Note
The input isZombie flag is ignored (and therefore never used) as StandbyTask can never be a zombie.

initializeTopology Method

void initializeTopology()
Note
initializeTopology is part of Task Contract to…​FIXME.

initializeTopology does nothing (and is simply a noop).

Resuming Task — resume Method

void resume()
Note
resume is part of the Task Contract to…​FIXME.

resume…​FIXME

Creating StandbyTask Instance

StandbyTask takes the following to be created:

StandbyTask initializes the internal properties.

flushAndCheckpointState Internal Method

void flushAndCheckpointState()

flushAndCheckpointState…​FIXME

Note
flushAndCheckpointState is used when StandbyTask is requested to commit and suspend.

commit Method

void commit()
Note
commit is part of Task Contract to…​FIXME

commit…​FIXME

suspend Method

void suspend()
Note
suspend is part of Task Contract to…​FIXME

suspend…​FIXME

Updating Standby Replicas Of State Store (From Single Change Log Partition) — update Method

List<ConsumerRecord<byte[], byte[]>> update(
  final TopicPartition partition,
  final List<ConsumerRecord<byte[], byte[]>> records)

update prints out the following TRACE message to the logs:

Updating standby replicas of its state store for partition [partition]

update then simply requests the ProcessorStateManager to updateStandbyStates and returns the result.

Note
update is used exclusively when StreamThread is requested to maybeUpdateStandbyTasks.

Internal Properties

Name Description

processorContext

InternalProcessorContext

Used when…​FIXME

results matching ""

    No results matching ""