You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/03 02:02:43 UTC

[GitHub] [kafka] showuon commented on a diff in pull request #11983: KAFKA-13763 (2): Refactor IncrementalCooperativeAssignor for improved unit testing

showuon commented on code in PR #11983:
URL: https://github.com/apache/kafka/pull/11983#discussion_r863325064


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:
##########
@@ -336,13 +332,16 @@ ClusterAssignment performTaskAssignment(
         log.debug("Incremental connector assignments: {}", incrementalConnectorAssignments);
         log.debug("Incremental task assignments: {}", incrementalTaskAssignments);
 
+        Map<String, Collection<String>> revokedConnectors = transformValues(toRevoke, ConnectorsAndTasks::connectors);
+        Map<String, Collection<ConnectorTaskId>> revokedTasks = transformValues(toRevoke, ConnectorsAndTasks::tasks);
+
         return new ClusterAssignment(
                 incrementalConnectorAssignments,
                 incrementalTaskAssignments,
-                transformValues(toRevoke, ConnectorsAndTasks::connectors),
-                transformValues(toRevoke, ConnectorsAndTasks::tasks),
-                connectorAssignments,
-                taskAssignments
+                revokedConnectors,
+                revokedTasks,
+                diff(connectorAssignments, revokedConnectors),
+                diff(taskAssignments, revokedTasks)

Review Comment:
   I think the `connectorAssignments` should be equal to `diff(connectorAssignments, revokedConnectors)` and `taskAssignments == diff(taskAssignments, revokedTasks)`, because in L279:
   https://github.com/apache/kafka/pull/11983/files#diff-e24067b121eb960feebfa099bd9c30382e330eaf5db39302a9d7a50e29b3acb4R279-R283
   
   We already removed the revoked connectors/tasks. Is my understanding correct?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org