chia7712 commented on code in PR #23313:
URL: https://github.com/apache/kafka/pull/23313#discussion_r3930703010
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/ClientState.java:
##########
@@ -90,44 +89,7 @@ public ClientState(final ProcessId processId, final
Map<String, String> clientTa
taskLagTotals = new TreeMap<>();
this.capacity = capacity;
this.processId = processId;
- this.clientTags = unmodifiableMap(clientTags);
- }
-
- // For testing only
- public ClientState(final Set<TaskId> previousActiveTasks,
- final Set<TaskId> previousStandbyTasks,
- final Map<TaskId, Long> taskLagTotals,
- final Map<String, String> clientTags,
- final int capacity) {
- this(previousActiveTasks, previousStandbyTasks, taskLagTotals,
clientTags, capacity, null);
- }
-
- // For testing only
- public ClientState(final Set<TaskId> previousActiveTasks,
- final Set<TaskId> previousStandbyTasks,
- final Map<TaskId, Long> taskLagTotals,
- final Map<String, String> clientTags,
- final int capacity,
- final ProcessId processId) {
- this.previousStandbyTasks.setTaskIds(unmodifiableSet(new
TreeSet<>(previousStandbyTasks)));
- this.previousActiveTasks.setTaskIds(unmodifiableSet(new
TreeSet<>(previousActiveTasks)));
- taskOffsetSums = Map.of();
- this.taskLagTotals = unmodifiableMap(taskLagTotals);
- this.capacity = capacity;
- this.clientTags = unmodifiableMap(clientTags);
- this.processId = processId;
- }
-
- // For testing only
- public ClientState(final ClientState clientState) {
- this(
- new HashSet<>(clientState.previousActiveTasks.taskIds()),
- new HashSet<>(clientState.previousStandbyTasks.taskIds()),
- clientState.taskLagTotals,
- clientState.clientTags,
- clientState.capacity,
- clientState.processId
- );
+ this.clientTags = new TreeMap<>(clientTags);
Review Comment:
It appears `clientTags` should stay immutable :)
--
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]