This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new c85e09f7a50 KAFKA-19060 Documented null edge cases in the Clients API
JavaDoc (#19393)
c85e09f7a50 is described below
commit c85e09f7a507e57cb6bc0cc597b5a1217b53eed6
Author: Ken Huang <[email protected]>
AuthorDate: Sun May 4 20:35:02 2025 +0800
KAFKA-19060 Documented null edge cases in the Clients API JavaDoc (#19393)
Some client APIs may return `null` values in the map, but this behavior
isn’t documented in the JavaDoc. We should update the JavaDoc to include
these edge cases.
Reviewers: Kirk True <[email protected]>, Jhen-Yung Hsu
<[email protected]>, PoAn Yang <[email protected]>, Chia-Ping Tsai
<[email protected]>
---
.../java/org/apache/kafka/clients/consumer/KafkaConsumer.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
index ae23c689de1..3a06e71335d 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
@@ -1563,8 +1563,8 @@ public class KafkaConsumer<K, V> implements Consumer<K,
V> {
* @param timestampsToSearch the mapping from partition to the timestamp
to look up.
*
* @return a mapping from partition to the timestamp and offset of the
first message with timestamp greater
- * than or equal to the target timestamp. {@code null} will be
returned for the partition if there is no
- * such message.
+ * than or equal to the target timestamp. If the timestamp and
offset for a specific partition cannot be found within
+ * the default timeout, and no corresponding message exists, the
entry in the returned map will be {@code null}
* @throws org.apache.kafka.common.errors.AuthenticationException if
authentication fails. See the exception for more details
* @throws org.apache.kafka.common.errors.AuthorizationException if not
authorized to the topic(s). See the exception for more details
* @throws IllegalArgumentException if the target timestamp is negative
@@ -1590,8 +1590,8 @@ public class KafkaConsumer<K, V> implements Consumer<K,
V> {
* @param timeout The maximum amount of time to await retrieval of the
offsets
*
* @return a mapping from partition to the timestamp and offset of the
first message with timestamp greater
- * than or equal to the target timestamp. {@code null} will be
returned for the partition if there is no
- * such message.
+ * than or equal to the target timestamp. If the timestamp and
offset for a specific partition cannot be found within
+ * timeout, and no corresponding message exists, the entry in the
returned map will be {@code null}
* @throws org.apache.kafka.common.errors.AuthenticationException if
authentication fails. See the exception for more details
* @throws org.apache.kafka.common.errors.AuthorizationException if not
authorized to the topic(s). See the exception for more details
* @throws IllegalArgumentException if the target timestamp is negative