lianetm commented on code in PR #19578:
URL: https://github.com/apache/kafka/pull/19578#discussion_r2071621283
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1634,7 +1635,8 @@ public Map<TopicPartition, Long>
beginningOffsets(Collection<TopicPartition> par
* @param partitions the partitions to get the earliest offsets
* @param timeout The maximum amount of time to await retrieval of the
beginning offsets
*
- * @return The earliest available offsets for the given partitions
+ * @return The earliest available offsets for the given partitions, and it
will return empty map if the offsets
+ * cannot be retrieved within the timeout
Review Comment:
actually, it will return empty map "if zero timeout is provided". If offsets
cannot be retrieved within the timeout, with a timeout > 0, it will throw
TimeoutException. (Sorry it was really me initially using the "within the
timeout" phrase)
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1613,7 +1613,8 @@ public Map<TopicPartition, OffsetAndTimestamp>
offsetsForTimes(Map<TopicPartitio
* @see #seekToBeginning(Collection)
*
* @param partitions the partitions to get the earliest offsets.
- * @return The earliest available offsets for the given partitions
+ * @return The earliest available offsets for the given partitions, and it
will return empty map if the offsets
+ * cannot be retrieved within the timeout
Review Comment:
this one does not take timeout as param really (uses the default api
timeout), so we could leave it as it was (@return The earliest available
offsets for the given partitions). The TimeoutExc behaviour is already
explained further down on the throws clause for it. WDYT?
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1658,7 +1660,7 @@ public Map<TopicPartition, Long>
beginningOffsets(Collection<TopicPartition> par
* @see #seekToEnd(Collection)
*
* @param partitions the partitions to get the end offsets.
- * @return The end offsets for the given partitions.
+ * @return The end offsets for the given partitions, and it will return
empty map if the offsets cannot be retrieved within the timeout
Review Comment:
As above, should we revert the change here because it uses the default api
timeout?
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1684,7 +1686,7 @@ public Map<TopicPartition, Long>
endOffsets(Collection<TopicPartition> partition
* @param partitions the partitions to get the end offsets.
* @param timeout The maximum amount of time to await retrieval of the end
offsets
*
- * @return The end offsets for the given partitions.
+ * @return The end offsets for the given partitions, and it will return
empty map if the offsets cannot be retrieved within the timeout
Review Comment:
```suggestion
* @return The end offsets for the given partitions, and it will return
empty map if zero timeout is provided
```
--
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]