TheNeuralBit commented on a change in pull request #15890:
URL: https://github.com/apache/beam/pull/15890#discussion_r765251834



##########
File path: 
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFn.java
##########
@@ -290,6 +290,7 @@ public GrowableOffsetRangeTracker restrictionTracker(
     return new GrowableOffsetRangeTracker(restriction.getFrom(), offsetPoller);
   }
 
+  @SuppressWarnings("PreferJavaTimeOverload")

Review comment:
       I dug into the test failure that you reported, the reason it works with 
`poll(long)` and not `poll(Duration)` is that we create our own MockConsumer, 
which only overrides `poll(long)`. If we just change this line to 
`poll(Duration)`: 
https://github.com/apache/beam/blob/414707077bb1f2689017d54076184c0b7d64955c/sdks/java/io/kafka/src/test/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFnTest.java#L147
   
   It will work for both cases. (Since MockConsumer.poll(long) defers to 
poll(Duration): 
https://github.com/apache/kafka/blob/2.4.1/clients/src/main/java/org/apache/kafka/clients/consumer/MockConsumer.java#L157-L159)




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