philipnee commented on code in PR #13380:
URL: https://github.com/apache/kafka/pull/13380#discussion_r1139651358


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -137,31 +144,40 @@ CompletableFuture<ClientResponse> sendAutoCommit(final 
Map<TopicPartition, Offse
                     }
                     return null;
                 });
-        return future;
     }
 
-    public void clientPoll(final long currentTimeMs) {
-        this.autoCommitState.ifPresent(t -> t.ack(currentTimeMs));
+    /**
+     * Handles {@link 
org.apache.kafka.clients.consumer.internals.events.CommitApplicationEvent}. It 
creates an
+     * {@link UnsentOffsetCommitRequest} and enqueue it to send later.
+     */
+    public CompletableFuture<ClientResponse> addOffsetCommitRequest(final 
Map<TopicPartition, OffsetAndMetadata> offsets) {
+        return pendingRequests.addOffsetCommitRequest(offsets);
     }
 
-    // Visible for testing
-    Queue<StagedCommit> stagedCommits() {
-        return this.stagedCommits;
+    /**
+     * Handles {@link 
org.apache.kafka.clients.consumer.internals.events.OffsetFetchApplicationEvent}.
 It creates an
+     * {@link UnsentOffsetFetchRequest} and enqueue it to send later.
+     */
+    public CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> 
addOffsetFetchRequest(final Set<TopicPartition> partitions) {
+        return pendingRequests.addOffsetFetchRequest(partitions);
+    }
+
+    public void clientPoll(final long currentTimeMs) {
+        this.autoCommitState.ifPresent(t -> t.ack(currentTimeMs));
     }
 
-    private class StagedCommit {
+    private class UnsentOffsetCommitRequest {

Review Comment:
   Rename to make naming consistent



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