vamossagar12 commented on code in PR #12561:
URL: https://github.com/apache/kafka/pull/12561#discussion_r957468730


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:
##########
@@ -584,9 +606,18 @@ private Map<String, ConnectorsAndTasks> 
performTaskRevocation(ConnectorsAndTasks
         Collection<WorkerLoad> existingWorkers = 
completeWorkerAssignment.stream()
                 .filter(wl -> wl.size() > 0)
                 .collect(Collectors.toList());
-        int existingWorkersNum = existingWorkers.size();
+
+        // existingWorkers => workers with load > 0.
+        // if existingWorkers is empty, no workers have any load.
+        int existingWorkersNum = existingWorkers.size(); // count of workers 
having non-zero load.
         int totalWorkersNum = completeWorkerAssignment.size();
-        int newWorkersNum = totalWorkersNum - existingWorkersNum;
+        int newWorkersNum = totalWorkersNum - existingWorkersNum; // <total 
workers - workers with non-0 load>
+        // if existingWorkersNum == 0, no workers have any load i.e all 
workers are new.
+        // newWorkersNum = 0 when all workers have non-zero load.

Review Comment:
   I need to remove the comments. It was only for my understanding 



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to