Class TaskManager
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.TaskManager
-
public class TaskManager extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidexecuteAndMaybeSwallow(boolean clean, java.lang.Runnable runnable, java.lang.String name, org.slf4j.Logger log)static voidexecuteAndMaybeSwallow(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.voidhandleAssignment(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.UUIDprocessId()voidsetPartitionResetter(java.util.function.Consumer<java.util.Set<org.apache.kafka.common.TopicPartition>> resetter)java.lang.StringtoString()Produces a string representation containing useful information about the TaskManager.java.lang.StringtoString(java.lang.String indent)
-
-
-
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 intryToLockAllNonEmptyTaskDirectories(). 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:
toStringin classjava.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)
-
-