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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerUtils.java:
##########
@@ -141,4 +146,53 @@ public static <K, V> List<ConsumerInterceptor<K, V>> 
configuredConsumerIntercept
         return (List<ConsumerInterceptor<K, V>>) 
ClientUtils.configuredInterceptors(config, 
ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, ConsumerInterceptor.class);
     }
 
+    /**
+     * Update subscription state and metadata using the provided committed 
offsets:
+     * <li>Update partition offsets with the committed offsets</li>
+     * <li>Update the metadata with any newer leader epoch discovered in the 
committed offsets
+     * metadata</li>
+     * </p>
+     * This will ignore any partition included in the 
<code>offsetsAndMetadata</code> parameter that
+     * may no longer be assigned.
+     *
+     * @param offsetsAndMetadata Committed offsets and metadata to be used for 
updating the
+     *                           subscription state and metadata object.
+     * @param metadata           Metadata object to update with a new leader 
epoch if discovered in the
+     *                           committed offsets' metadata.
+     * @param subscriptions      Subscription state to update, setting 
partitions' offsets to the
+     *                           committed offsets.
+     * @return False if null <code>offsetsAndMetadata</code> is provided. True 
in any other case.

Review Comment:
   We won't, when calling this from the new implementation. But when calling it 
from the old consumer yes, `offsetsAndMetadata` can be null here (passed as 
null from the 
[fetchCommittedOffsets](https://github.com/apache/kafka/blob/f46db86d34f9e5fe1b0d7604306a5108a89c113e/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L996C51-L996C72)
 if it times out)



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