lianetm commented on code in PR #17549:
URL: https://github.com/apache/kafka/pull/17549#discussion_r1814798029


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -944,23 +941,20 @@ public boolean sameRequest(final OffsetFetchRequestState 
request) {
         public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
 
             OffsetFetchRequest.Builder builder;
-            if (memberInfo.memberId.isPresent() && 
memberInfo.memberEpoch.isPresent()) {
-                builder = new OffsetFetchRequest.Builder(
-                        groupId,
-                        memberInfo.memberId.get(),
-                        memberInfo.memberEpoch.get(),
-                        true,
-                        new ArrayList<>(this.requestedPartitions),
-                        throwOnFetchStableOffsetUnsupported);
-            } else {
-                // Building request without passing member ID/epoch to leave 
the logic to choose
-                // default values when not present on the request builder.
-                builder = new OffsetFetchRequest.Builder(
-                        groupId,
-                        true,
-                        new ArrayList<>(this.requestedPartitions),
-                        throwOnFetchStableOffsetUnsupported);
-            }
+            // Building request without passing member ID/epoch to leave the 
logic to choose
+            // default values when not present on the request builder.
+            builder = memberInfo.memberEpoch.map(integer -> new 
OffsetFetchRequest.Builder(
+                            groupId,
+                            memberInfo.memberId,
+                            integer,

Review Comment:
   nit: let's rename this var from "integer" to something clearer, maybe "epoch"



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