skaundinya15 commented on a change in pull request #10962:
URL: https://github.com/apache/kafka/pull/10962#discussion_r664800832



##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/OffsetFetchRequest.java
##########
@@ -174,6 +315,28 @@ public boolean isAllPartitions() {
         return data.topics() == ALL_TOPIC_PARTITIONS;
     }
 
+    public boolean isAllPartitionsForGroup(String groupId) {
+        OffsetFetchRequestGroup group = data
+            .groupIds()
+            .stream()
+            .filter(g -> g.groupId().equals(groupId))
+            .collect(toSingleton());
+        return group.topics() == ALL_TOPIC_PARTITIONS_BATCH;
+    }
+
+    // Custom collector to filter a single element
+    private <T> Collector<T, ?, T> toSingleton() {

Review comment:
       Would this be a test for single group requests with v8? I have added 
that case to the existing single group tests for older versions in 
`OffsetFetchRequestTest.scala` and will push those changes shortly. Is there 
another type of test you were thinking of?




-- 
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