chia7712 commented on code in PR #23313:
URL: https://github.com/apache/kafka/pull/23313#discussion_r3949896352
##########
streams/src/testFixtures/java/org/apache/kafka/streams/processor/internals/assignment/AssignmentTestUtils.java:
##########
@@ -1002,12 +1002,39 @@ static SortedMap<ProcessId, ClientState>
copyClientStateMap(final Map<ProcessId,
.collect(
Collectors.toMap(
Entry::getKey,
- entry -> new ClientState(entry.getValue())
+ entry -> copyClientState(entry.getValue())
)
)
);
}
+ static ClientState clientState(final Set<TaskId> previousActiveTasks,
+ final Set<TaskId> previousStandbyTasks,
+ final Map<TaskId, Long> taskLagTotals,
+ final int capacity) {
+ return clientState(previousActiveTasks, previousStandbyTasks,
taskLagTotals, capacity, null);
+ }
+
+ static ClientState clientState(final Set<TaskId> previousActiveTasks,
+ final Set<TaskId> previousStandbyTasks,
+ final Map<TaskId, Long> taskLagTotals,
+ final int capacity,
+ final ProcessId processId) {
+ final ClientState clientState = new ClientState(processId, capacity);
+ clientState.addPreviousActiveTasks(previousActiveTasks);
+ clientState.addPreviousStandbyTasks(previousStandbyTasks);
+ clientState.taskLagTotals().putAll(taskLagTotals);
Review Comment:
Maybe we could have a package-private setter for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]