Class ClientState
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.assignment.ClientState
-
public class ClientState extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<TopicPartition>
TOPIC_PARTITION_COMPARATOR
-
Constructor Summary
Constructors Constructor Description ClientState()
ClientState(Set<TaskId> previousActiveTasks, Set<TaskId> previousStandbyTasks, Map<TaskId,Long> taskLagTotals, int capacity)
-
Method Summary
-
-
-
Field Detail
-
TOPIC_PARTITION_COMPARATOR
public static final Comparator<TopicPartition> TOPIC_PARTITION_COMPARATOR
-
-
Method Detail
-
copy
public ClientState copy()
-
incrementCapacity
public void incrementCapacity()
-
activeTaskCount
public int activeTaskCount()
-
assignActiveTasks
public void assignActiveTasks(Collection<TaskId> tasks)
-
assignActive
public void assignActive(TaskId task)
-
unassignActive
public void unassignActive(TaskId task)
-
assignStandby
public void assignStandby(TaskId task)
-
assignedTaskCount
public int assignedTaskCount()
-
previousOwnerForPartition
public String previousOwnerForPartition(TopicPartition partition)
-
addOwnedPartitions
public void addOwnedPartitions(Collection<TopicPartition> ownedPartitions, String consumer)
-
addPreviousTasksAndOffsetSums
public void addPreviousTasksAndOffsetSums(String consumerId, Map<TaskId,Long> taskOffsetSums)
-
initializePrevTasks
public void initializePrevTasks(Map<TopicPartition,TaskId> taskForPartitionMap)
-
computeTaskLags
public void computeTaskLags(UUID uuid, Map<TaskId,Long> allTaskEndOffsetSums)
Compute the lag for each stateful task, including tasks this client did not previously have.
-
lagFor
public long lagFor(TaskId task)
Returns the total lag across all logged stores in the task. Equal to the end offset sum if this client did not have any state for this task on disk.- Returns:
- end offset sum - offset sum Task.LATEST_OFFSET if this was previously an active running task on this client
-
-