Class TaskManager


  • public class TaskManager
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void executeAndMaybeSwallow​(boolean clean, java.lang.Runnable runnable, java.lang.String name, org.slf4j.Logger log)  
      static void executeAndMaybeSwallow​(boolean clean, java.lang.Runnable runnable, java.util.function.Consumer<java.lang.RuntimeException> actionIfClean, java.util.function.Consumer<java.lang.RuntimeException> actionIfNotClean)  
      java.util.Map<TaskId,​java.lang.Long> getTaskOffsetSums()
      Compute the offset total summed across all stores in a task.
      void handleAssignment​(java.util.Map<TaskId,​java.util.Set<org.apache.kafka.common.TopicPartition>> activeTasks, java.util.Map<TaskId,​java.util.Set<org.apache.kafka.common.TopicPartition>> standbyTasks)  
      java.util.UUID processId()  
      void setPartitionResetter​(java.util.function.Consumer<java.util.Set<org.apache.kafka.common.TopicPartition>> resetter)  
      java.lang.String toString()
      Produces a string representation containing useful information about the TaskManager.
      java.lang.String toString​(java.lang.String indent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • processId

        public java.util.UUID processId()
      • handleAssignment

        public void handleAssignment​(java.util.Map<TaskId,​java.util.Set<org.apache.kafka.common.TopicPartition>> activeTasks,
                                     java.util.Map<TaskId,​java.util.Set<org.apache.kafka.common.TopicPartition>> standbyTasks)
        Throws:
        TaskMigratedException - if the task producer got fenced (EOS only)
        StreamsException - fatal error while creating / initializing the task public for upgrade testing only
      • getTaskOffsetSums

        public java.util.Map<TaskId,​java.lang.Long> getTaskOffsetSums()
        Compute the offset total summed across all stores in a task. Includes offset sum for any tasks we own the lock for, which includes assigned and unassigned tasks we locked in tryToLockAllNonEmptyTaskDirectories(). Does not include stateless or non-logged tasks.
      • toString

        public java.lang.String toString()
        Produces a string representation containing useful information about the TaskManager. This is useful in debugging scenarios.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the TaskManager instance.
      • toString

        public java.lang.String toString​(java.lang.String indent)
      • executeAndMaybeSwallow

        public static void executeAndMaybeSwallow​(boolean clean,
                                                  java.lang.Runnable runnable,
                                                  java.util.function.Consumer<java.lang.RuntimeException> actionIfClean,
                                                  java.util.function.Consumer<java.lang.RuntimeException> actionIfNotClean)
      • executeAndMaybeSwallow

        public static void executeAndMaybeSwallow​(boolean clean,
                                                  java.lang.Runnable runnable,
                                                  java.lang.String name,
                                                  org.slf4j.Logger log)
      • setPartitionResetter

        public void setPartitionResetter​(java.util.function.Consumer<java.util.Set<org.apache.kafka.common.TopicPartition>> resetter)