msn-tldr commented on code in PR #15323:
URL: https://github.com/apache/kafka/pull/15323#discussion_r1486639832


##########
clients/src/main/java/org/apache/kafka/clients/MetadataCache.java:
##########
@@ -113,14 +116,28 @@ Optional<Node> nodeById(int id) {
         return Optional.ofNullable(nodes.get(id));
     }
 
-    Cluster cluster() {
+    public Cluster cluster() {
         if (clusterInstance == null) {
             throw new IllegalStateException("Cached Cluster instance should 
not be null, but was.");
         } else {
             return clusterInstance;
         }
     }
 
+    /**
+     * Get leader-epoch for partition.
+     * @param tp partition
+     * @return leader-epoch if known, else return optional.empty()
+     */
+    public Optional<Integer> leaderEpochFor(TopicPartition tp) {

Review Comment:
   done



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