kirktrue commented on code in PR #20324:
URL: https://github.com/apache/kafka/pull/20324#discussion_r2579327327


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java:
##########
@@ -879,8 +879,26 @@ public synchronized Set<TopicPartition> 
partitionsNeedingReset(long nowMs) {
         return collectPartitions(state -> state.awaitingReset() && 
!state.awaitingRetryBackoff(nowMs));
     }
 
-    public synchronized Set<TopicPartition> partitionsNeedingValidation(long 
nowMs) {
-        return collectPartitions(state -> state.awaitingValidation() && 
!state.awaitingRetryBackoff(nowMs));
+    public synchronized Map<TopicPartition, FetchPosition> 
partitionsNeedingValidation(long nowMs) {
+        Map<TopicPartition, FetchPosition> result = new HashMap<>();
+
+        assignment.forEach((tp, tps) -> {
+            if (tps.awaitingValidation() && !tps.awaitingRetryBackoff(nowMs) 
&& tps.position != null) {
+                result.put(tp, tps.position);
+            }
+        });
+
+        return result;
+    }
+
+    public synchronized boolean hasPartitionsNeedingValidation(long nowMs) {

Review Comment:
   I will submit a PR to remove it.



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