jolshan commented on code in PR #13901:
URL: https://github.com/apache/kafka/pull/13901#discussion_r1244508147


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/ConsumerGroup.java:
##########
@@ -423,6 +456,47 @@ public Map<String, TopicMetadata> 
computeSubscriptionMetadata(
         return Collections.unmodifiableMap(newSubscriptionMetadata);
     }
 
+    /**
+     * Updates the next metadata refresh time.
+     *
+     * @param nextTimeMs The next time in milliseconds.
+     * @param groupEpoch The associated group epoch.
+     */
+    public void setNextMetadataRefreshTime(
+        long nextTimeMs,
+        int groupEpoch
+    ) {
+        this.nextMetadataRefreshTime = new TimeAndEpoch(nextTimeMs, 
groupEpoch);
+    }
+
+    /**
+     * Resets the next metadata refresh.
+     */
+    public void resetNextMetadataRefreshTime() {
+        this.nextMetadataRefreshTime = TimeAndEpoch.EMPTY;
+    }
+
+    /**
+     * Checks if a metadata refresh is required. A refresh is required in two 
cases:
+     * 1) The next update time is smaller or equals to the current time;
+     * 2) The group epoch associated with the next update time is smaller than

Review Comment:
   This is also the case when we reset the refreshMetadata time right? 



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