TaiJuWu commented on code in PR #17584:
URL: https://github.com/apache/kafka/pull/17584#discussion_r1816120081


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -948,7 +957,16 @@ public Map<TopicPartition, OffsetAndMetadata> 
fetchCommittedOffsets(final Set<To
                 pendingCommittedOffsetRequest = null;
 
                 if (future.succeeded()) {
-                    return future.value();
+                    if (!isReuseSubsetRequest) {
+                        return future.value();
+                    }
+                    Map<TopicPartition, OffsetAndMetadata> results = new 
HashMap<>(future.value().size());
+                    future.value().forEach((key, value) -> {
+                        if (partitions.contains(key)) {
+                            results.put(key, value);
+                        }
+                    });

Review Comment:
   Since `fetchCommittedOffsets` allow returning `null` when timeout, we can't 
use stream api.
   Ref: 
https://github.com/apache/kafka/blob/940298a5281bea6549034c7dc2d3f4d74961f4a1/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L924



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

Reply via email to