You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "m1a2st (via GitHub)" <gi...@apache.org> on 2025/04/06 13:30:46 UTC
[PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
m1a2st opened a new pull request, #19393:
URL: https://github.com/apache/kafka/pull/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.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #19393:
URL: https://github.com/apache/kafka/pull/19393#discussion_r2061407189
##########
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. If the offset for a specific partition cannot be
Review Comment:
the returned value is inconsistent between classic consumer and async consumer. I have opened https://issues.apache.org/jira/browse/KAFKA-19205 to trace it. this PR should be pending for the ticket
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #19393:
URL: https://github.com/apache/kafka/pull/19393#issuecomment-2849178967
@m1a2st please update PR according to the fix of #19578
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "kirktrue (via GitHub)" <gi...@apache.org>.
kirktrue commented on code in PR #19393:
URL: https://github.com/apache/kafka/pull/19393#discussion_r2049779243
##########
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. If the offset for a specific partition cannot be
+ * found or the timeout is zero, the corresponding value will be {@code null}
Review Comment:
```suggestion
* @return The earliest available offsets for the given partitions. If the offset for a specific partition cannot be
* found or the timeout is zero, its entry in the returned map will be {@code null}
```
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1684,7 +1687,8 @@ 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. If the offset for a specific partition cannot be found or the
+ * timeout is zero, the corresponding value will be {@code null}
Review Comment:
```suggestion
* @return The end offsets for the given partitions. If the offset for a specific partition cannot be found or the
* timeout is zero, its entry in the returned map will be {@code null}
```
##########
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. If the offset for a specific partition cannot be
+ * found or the timeout is zero, the corresponding value will be {@code null}
Review Comment:
What do you think of this?
```suggestion
* @return The earliest available offsets for the given partitions. If the offset for a specific partition cannot be
* found within the default timeout, its entry in the returned map will be {@code null}
```
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1658,7 +1660,8 @@ 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. If the offset for a specific partition cannot be found or the
+ * timeout is zero, the corresponding value will be {@code null}
Review Comment:
```suggestion
* @return The end offsets for the given partitions. If the offset for a specific partition cannot be found within the default
* timeout, its entry in the returned map will be {@code null}
```
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on PR #19393:
URL: https://github.com/apache/kafka/pull/19393#issuecomment-2783697038
Hello @kirktrue, if you have free cycle, PTAL
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on PR #19393:
URL: https://github.com/apache/kafka/pull/19393#issuecomment-2820100352
Thanks for @chia7712 comments, addressed 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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #19393:
URL: https://github.com/apache/kafka/pull/19393
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on code in PR #19393:
URL: https://github.com/apache/kafka/pull/19393#discussion_r2030586173
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1658,7 +1660,8 @@ 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. If the offset for a specific partition cannot be found or the
+ * timeout is zero, the corresponding value will be {@code null}
Review Comment:
Some paragraphs have periods, while others do not, such as in existing JavaDocs. We should make them all consistent (this can be addressed in another PR).
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on code in PR #19393:
URL: https://github.com/apache/kafka/pull/19393#discussion_r2030586173
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1658,7 +1660,8 @@ 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. If the offset for a specific partition cannot be found or the
+ * timeout is zero, the corresponding value will be {@code null}
Review Comment:
Some paragraphs have periods, while others do not, for existing JavaDocs. I think we should make them all consistent (this can be addressed in another PR).
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #19393:
URL: https://github.com/apache/kafka/pull/19393#issuecomment-2817223866
@m1a2st could you please update docs for `offsetsForTimes` as well?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on PR #19393:
URL: https://github.com/apache/kafka/pull/19393#issuecomment-2816679715
Thanks for @kirktrue comments, addressed all :)
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on code in PR #19393:
URL: https://github.com/apache/kafka/pull/19393#discussion_r2030586173
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1658,7 +1660,8 @@ 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. If the offset for a specific partition cannot be found or the
+ * timeout is zero, the corresponding value will be {@code null}
Review Comment:
Some paragraphs have periods, while others do not, for existing JavaDocs. I think we could make them all consistent (this can be addressed in another PR).
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19060 Documented null edge cases in the Clients API JavaDoc [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st commented on code in PR #19393:
URL: https://github.com/apache/kafka/pull/19393#discussion_r2031149018
##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1658,7 +1660,8 @@ 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. If the offset for a specific partition cannot be found or the
+ * timeout is zero, the corresponding value will be {@code null}
Review Comment:
Sure, but I won't address this changes in this PR.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org