Interface Task
-
- All Known Implementing Classes:
AbstractTask
,StandbyTask
,StreamTask
public interface Task
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Task.State
static class
Task.TaskType
-
Field Summary
Fields Modifier and Type Field Description static long
LATEST_OFFSET
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addRecords(TopicPartition partition, Iterable<ConsumerRecord<byte[],byte[]>> records)
Map<TopicPartition,Long>
changelogOffsets()
Collection<TopicPartition>
changelogPartitions()
void
closeClean()
Must be idempotent.void
closeCleanAndRecycleState()
Attempt a clean close but do not close the underlying statevoid
closeDirty()
Must be idempotent.boolean
commitNeeded()
default boolean
commitRequested()
void
completeRestoration()
StateStore
getStore(String name)
TaskId
id()
void
initializeIfNeeded()
Set<TopicPartition>
inputPartitions()
boolean
isActive()
boolean
isClosed()
void
markChangelogAsCorrupted(Collection<TopicPartition> partitions)
default boolean
maybePunctuateStreamTime()
default boolean
maybePunctuateSystemTime()
default boolean
needsInitializationOrRestoration()
void
postCommit()
Map<TopicPartition,OffsetAndMetadata>
prepareCommit()
default boolean
process(long wallClockTime)
default Map<TopicPartition,Long>
purgeableOffsets()
default void
recordProcessBatchTime(long processBatchTime)
default void
recordProcessTimeRatioAndBufferSize(long allTaskProcessMs, long now)
void
resume()
void
revive()
Revive a closed task to a created one; should never throw an exceptionTask.State
state()
void
suspend()
void
update(Set<TopicPartition> topicPartitions, Map<String,List<String>> allTopologyNodesToSourceTopics)
Updates input partitions and topology after rebalance
-
-
-
Field Detail
-
LATEST_OFFSET
static final long LATEST_OFFSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
id
TaskId id()
-
state
Task.State state()
-
needsInitializationOrRestoration
default boolean needsInitializationOrRestoration()
-
isActive
boolean isActive()
-
isClosed
boolean isClosed()
-
initializeIfNeeded
void initializeIfNeeded()
- Throws:
LockException
- could happen when multi-threads within the single instance, could retryStreamsException
- fatal error, should close the thread
-
completeRestoration
void completeRestoration()
- Throws:
StreamsException
- fatal error, should close the thread
-
addRecords
void addRecords(TopicPartition partition, Iterable<ConsumerRecord<byte[],byte[]>> records)
-
commitNeeded
boolean commitNeeded()
-
prepareCommit
Map<TopicPartition,OffsetAndMetadata> prepareCommit()
- Throws:
StreamsException
- fatal error, should close the thread
-
postCommit
void postCommit()
-
suspend
void suspend()
-
resume
void resume()
- Throws:
StreamsException
- fatal error, should close the thread
-
closeClean
void closeClean()
Must be idempotent.
-
closeDirty
void closeDirty()
Must be idempotent.
-
update
void update(Set<TopicPartition> topicPartitions, Map<String,List<String>> allTopologyNodesToSourceTopics)
Updates input partitions and topology after rebalance
-
closeCleanAndRecycleState
void closeCleanAndRecycleState()
Attempt a clean close but do not close the underlying state
-
revive
void revive()
Revive a closed task to a created one; should never throw an exception
-
getStore
StateStore getStore(String name)
-
inputPartitions
Set<TopicPartition> inputPartitions()
-
changelogPartitions
Collection<TopicPartition> changelogPartitions()
- Returns:
- any changelog partitions associated with this task
-
changelogOffsets
Map<TopicPartition,Long> changelogOffsets()
- Returns:
- the offsets of all the changelog partitions associated with this task, indicating the current positions of the logged state stores of the task.
-
markChangelogAsCorrupted
void markChangelogAsCorrupted(Collection<TopicPartition> partitions)
-
purgeableOffsets
default Map<TopicPartition,Long> purgeableOffsets()
-
recordProcessBatchTime
default void recordProcessBatchTime(long processBatchTime)
-
recordProcessTimeRatioAndBufferSize
default void recordProcessTimeRatioAndBufferSize(long allTaskProcessMs, long now)
-
process
default boolean process(long wallClockTime)
-
commitRequested
default boolean commitRequested()
-
maybePunctuateStreamTime
default boolean maybePunctuateStreamTime()
-
maybePunctuateSystemTime
default boolean maybePunctuateSystemTime()
-
-