rmetzger commented on code in PR #292:
URL: 
https://github.com/apache/flink-connector-kafka/pull/292#discussion_r3781773306


##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/reader/KafkaPartitionSplitReader.java:
##########
@@ -278,8 +280,25 @@ KafkaConsumer<byte[], byte[]> consumer() {
         return consumer;
     }
 
+    @VisibleForTesting
+    Duration getPollTimeout() {
+        return pollTimeout;
+    }
+
     // --------------- private helper method ----------------------
 
+    private static Duration parsePollTimeout(Properties props) {
+        long pollTimeoutMs =
+                KafkaSourceOptions.getOption(
+                        props, KafkaSourceOptions.POLL_TIMEOUT_MS, 
Long::parseLong);
+        Preconditions.checkArgument(
+                pollTimeoutMs > 0,
+                "Property %s should be positive, but is %s",

Review Comment:
   Why can't the poll timeout be 0? Kafka forbids only negative poll timeouts, 
and I think having a 0 timeout is a valid use-case



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