Class StandbyTask
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.AbstractTask
-
- org.apache.kafka.streams.processor.internals.StandbyTask
-
- All Implemented Interfaces:
Task
public class StandbyTask extends AbstractTask implements Task
A StandbyTask
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.kafka.streams.processor.internals.Task
Task.State, Task.TaskType
-
-
Field Summary
-
Fields inherited from class org.apache.kafka.streams.processor.internals.AbstractTask
id, inputPartitions, stateDirectory, stateMgr, topology
-
Fields inherited from interface org.apache.kafka.streams.processor.internals.Task
LATEST_OFFSET
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRecords(TopicPartition partition, Iterable<ConsumerRecord<byte[],byte[]>> records)
Map<TopicPartition,Long>
changelogOffsets()
void
closeClean()
Must be idempotent.void
closeCleanAndRecycleState()
Attempt a clean close but do not close the underlying statevoid
closeDirty()
Must be idempotent.boolean
commitNeeded()
void
completeRestoration()
void
initializeIfNeeded()
boolean
isActive()
void
postCommit()
Map<TopicPartition,OffsetAndMetadata>
prepareCommit()
Flush stores before a commitvoid
resume()
void
suspend()
String
toString()
Produces a string representation containing useful information about a Task.String
toString(String indent)
Produces a string representation containing useful information about a Task starting with the given indent.-
Methods inherited from class org.apache.kafka.streams.processor.internals.AbstractTask
changelogPartitions, getStore, id, inputPartitions, isClosed, markChangelogAsCorrupted, revive, state, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.kafka.streams.processor.internals.Task
changelogPartitions, commitRequested, getStore, id, inputPartitions, isClosed, markChangelogAsCorrupted, maybePunctuateStreamTime, maybePunctuateSystemTime, needsInitializationOrRestoration, process, purgeableOffsets, recordProcessBatchTime, recordProcessTimeRatioAndBufferSize, revive, state, update
-
-
-
-
Method Detail
-
initializeIfNeeded
public void initializeIfNeeded()
- Specified by:
initializeIfNeeded
in interfaceTask
- Throws:
StreamsException
- fatal error, should close the thread
-
completeRestoration
public void completeRestoration()
- Specified by:
completeRestoration
in interfaceTask
-
prepareCommit
public Map<TopicPartition,OffsetAndMetadata> prepareCommit()
Flush stores before a commit- Specified by:
prepareCommit
in interfaceTask
- Throws:
StreamsException
- fatal error, should close the thread
-
postCommit
public void postCommit()
- Specified by:
postCommit
in interfaceTask
-
closeClean
public void closeClean()
Description copied from interface:Task
Must be idempotent.- Specified by:
closeClean
in interfaceTask
-
closeDirty
public void closeDirty()
Description copied from interface:Task
Must be idempotent.- Specified by:
closeDirty
in interfaceTask
-
closeCleanAndRecycleState
public void closeCleanAndRecycleState()
Description copied from interface:Task
Attempt a clean close but do not close the underlying state- Specified by:
closeCleanAndRecycleState
in interfaceTask
-
commitNeeded
public boolean commitNeeded()
- Specified by:
commitNeeded
in interfaceTask
-
changelogOffsets
public Map<TopicPartition,Long> changelogOffsets()
- Specified by:
changelogOffsets
in interfaceTask
- Returns:
- the offsets of all the changelog partitions associated with this task, indicating the current positions of the logged state stores of the task.
-
addRecords
public void addRecords(TopicPartition partition, Iterable<ConsumerRecord<byte[],byte[]>> records)
- Specified by:
addRecords
in interfaceTask
-
toString
public String toString()
Produces a string representation containing useful information about a Task. This is useful in debugging scenarios.
-
-