Skip to content

Task

Task is an abstraction of tasks.

Contract

Adding Records (to Active StreamTasks)

void addRecords(
  TopicPartition partition,
  Iterable<ConsumerRecord<byte[], byte[]>> records)

Adds records to StreamTasks (while StandbyTasks throw an IllegalStateException)

Used when:

changelogOffsets

Map<TopicPartition, Long> changelogOffsets()

changelogPartitions

Collection<TopicPartition> changelogPartitions()

clearTaskTimeout

void clearTaskTimeout()

closeClean

void closeClean()

closeCleanAndRecycleState

void closeCleanAndRecycleState()

closeDirty

void closeDirty()

commitNeeded

boolean commitNeeded()

committedOffsets

Map<TopicPartition, Long> committedOffsets()

completeRestoration

void completeRestoration(
  java.util.function.Consumer<Set<TopicPartition>> offsetResetter)

Used when:

getStore

StateStore getStore(
  String name)

Used when:

  • StreamThreadStateStoreProvider is requested for stores

highWaterMark

Map<TopicPartition, Long> highWaterMark()

TaskId

TaskId id()

initializeIfNeeded

void initializeIfNeeded()

inputPartitions

Set<TopicPartition> inputPartitions()

isActive

boolean isActive()

markChangelogAsCorrupted

void markChangelogAsCorrupted(
  Collection<TopicPartition> partitions)

maybeInitTaskTimeoutOrThrow

void maybeInitTaskTimeoutOrThrow(
  long currentWallClockMs,
  Exception cause)

maybePunctuateStreamTime

boolean maybePunctuateStreamTime()

Default: false

Used when:

maybePunctuateSystemTime

boolean maybePunctuateSystemTime()

Default: false

Used when:

needsInitializationOrRestoration

boolean needsInitializationOrRestoration()

Default: Whether this task is in CREATED or RESTORING state

Used when:

postCommit

void postCommit(
  boolean enforceCheckpoint)

prepareCommit

Map<TopicPartition, OffsetAndMetadata> prepareCommit()

Used when:

Processing Record

boolean process(
  long wallClockTime)

Default: false (and overriden in StreamTask)

Used when:

Resuming

void resume()

revive

void revive()

state

State state()

suspend

void suspend()

timeCurrentIdlingStarted

Optional<Long> timeCurrentIdlingStarted()

updateInputPartitions

void updateInputPartitions(
  Set<TopicPartition> topicPartitions,
  Map<String, List<String>> allTopologyNodesToSourceTopics)

Implementations

Back to top