lucasbru commented on code in PR #20730:
URL: https://github.com/apache/kafka/pull/20730#discussion_r2447299933
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -1471,6 +1472,30 @@ private static boolean
areOwnedTasksContainedInAssignedTasks(
return true;
}
+ /**
+ * Checks whether all the tasks contained in the list are included in the
provided assignment with epochs.
+ *
+ * @param ownedTasks The tasks provided by the streams group
member in the request.
+ * @param assignedTasksWithEpochs The tasks that the member should have
(with epochs).
+ * @return A boolean indicating whether the owned partitions are a subset
or not.
+ */
+ private static boolean areOwnedTasksContainedInAssignedTasksWithEpochs(
+ List<StreamsGroupHeartbeatRequestData.TaskIds> ownedTasks,
+ Map<String, Map<Integer, Integer>> assignedTasksWithEpochs
+ ) {
+ if (ownedTasks == null) return false;
Review Comment:
If owned tasks is null, we do not know tasks the member believes it owns, so
we return. I updated the javadoc to make this, clearer
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -1471,6 +1472,30 @@ private static boolean
areOwnedTasksContainedInAssignedTasks(
return true;
}
+ /**
+ * Checks whether all the tasks contained in the list are included in the
provided assignment with epochs.
+ *
+ * @param ownedTasks The tasks provided by the streams group
member in the request.
+ * @param assignedTasksWithEpochs The tasks that the member should have
(with epochs).
+ * @return A boolean indicating whether the owned partitions are a subset
or not.
+ */
+ private static boolean areOwnedTasksContainedInAssignedTasksWithEpochs(
+ List<StreamsGroupHeartbeatRequestData.TaskIds> ownedTasks,
+ Map<String, Map<Integer, Integer>> assignedTasksWithEpochs
+ ) {
+ if (ownedTasks == null) return false;
Review Comment:
If owned tasks is null, we do not know which tasks the member believes it
owns, so we return. I updated the javadoc to make this, clearer
--
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]