Interface Task

    • Method Detail

      • 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 retry
        StreamsException - fatal error, should close the thread
      • completeRestoration

        void completeRestoration()
        Throws:
        StreamsException - fatal error, should close the thread
      • addRecords

        void addRecords​(org.apache.kafka.common.TopicPartition partition,
                        java.lang.Iterable<org.apache.kafka.clients.consumer.ConsumerRecord<byte[],​byte[]>> records)
      • commitNeeded

        boolean commitNeeded()
      • prepareCommit

        java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.clients.consumer.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​(java.util.Set<org.apache.kafka.common.TopicPartition> topicPartitions,
                    java.util.Map<java.lang.String,​java.util.List<java.lang.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​(java.lang.String name)
      • inputPartitions

        java.util.Set<org.apache.kafka.common.TopicPartition> inputPartitions()
      • changelogPartitions

        java.util.Collection<org.apache.kafka.common.TopicPartition> changelogPartitions()
        Returns:
        any changelog partitions associated with this task
      • changelogOffsets

        java.util.Map<org.apache.kafka.common.TopicPartition,​java.lang.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​(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
      • purgeableOffsets

        default java.util.Map<org.apache.kafka.common.TopicPartition,​java.lang.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()