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 voidaddRecords(org.apache.kafka.common.TopicPartition partition, java.lang.Iterable<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>> records)java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long>changelogOffsets()voidcloseClean()Must be idempotent.voidcloseCleanAndRecycleState()Attempt a clean close but do not close the underlying statevoidcloseDirty()Must be idempotent.booleancommitNeeded()voidcompleteRestoration()voidinitializeIfNeeded()booleanisActive()voidpostCommit()java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata>prepareCommit()Flush stores before a commitvoidresume()voidsuspend()java.lang.StringtoString()Produces a string representation containing useful information about a Task.java.lang.StringtoString(java.lang.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:
initializeIfNeededin interfaceTask- Throws:
StreamsException- fatal error, should close the thread
-
completeRestoration
public void completeRestoration()
- Specified by:
completeRestorationin interfaceTask
-
prepareCommit
public java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> prepareCommit()
Flush stores before a commit- Specified by:
prepareCommitin interfaceTask- Throws:
StreamsException- fatal error, should close the thread
-
postCommit
public void postCommit()
- Specified by:
postCommitin interfaceTask
-
closeClean
public void closeClean()
Description copied from interface:TaskMust be idempotent.- Specified by:
closeCleanin interfaceTask
-
closeDirty
public void closeDirty()
Description copied from interface:TaskMust be idempotent.- Specified by:
closeDirtyin interfaceTask
-
closeCleanAndRecycleState
public void closeCleanAndRecycleState()
Description copied from interface:TaskAttempt a clean close but do not close the underlying state- Specified by:
closeCleanAndRecycleStatein interfaceTask
-
commitNeeded
public boolean commitNeeded()
- Specified by:
commitNeededin interfaceTask
-
changelogOffsets
public java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> changelogOffsets()
- Specified by:
changelogOffsetsin 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(org.apache.kafka.common.TopicPartition partition, java.lang.Iterable<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]>> records)- Specified by:
addRecordsin interfaceTask
-
toString
public java.lang.String toString()
Produces a string representation containing useful information about a Task. This is useful in debugging scenarios.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the StreamTask instance.
-
toString
public java.lang.String toString(java.lang.String indent)
Produces a string representation containing useful information about a Task starting with the given indent. This is useful in debugging scenarios.- Returns:
- A string representation of the Task instance.
-
-