KAFKA-20089 : clients - update javadocs -- while topic being created in background#21959
KAFKA-20089 : clients - update javadocs -- while topic being created in background#21959chia7712 merged 3 commits intoapache:trunkfrom
Conversation
|
@chia7712 may I request your review pls. |
| val creatableTopicResponses = creatableTopics.keySet.toSeq.map { topic => | ||
| new MetadataResponseTopic() | ||
| .setErrorCode(Errors.UNKNOWN_TOPIC_OR_PARTITION.code) | ||
| .setErrorCode(Errors.LEADER_NOT_AVAILABLE.code) |
There was a problem hiding this comment.
Modifying the returned error likely requires a KIP. For now, my preference is to simply update the partitionsFor javadoc. It might cause some friction for users who treated the ZK-mode bug as a feature, but it aligns better with the intended API contract.
There was a problem hiding this comment.
I mean, some users tend to rely on this non-standard behavior, and it's time we wake them up :)
There was a problem hiding this comment.
Got it. I shall revert the code and add this javadoc to partitionsFor in KafkaConsumer
- @return The list of partitions, which will be empty when the given topic is not found.
- Note: when {@code auto.create.topics.enable} is {@code true}, this method may
- return an empty list even though the topic is being auto-created in the background.
- Callers should not assume the topic does not exist based solely on an empty result.
Is this ok?
There was a problem hiding this comment.
Thank you. Pushed that javadoc.
nileshkumar3
left a comment
There was a problem hiding this comment.
Thanks for the documentation update. LGTM !
| * | ||
| * @return The list of partitions, which will be empty when the given topic is not found | ||
| * @return The list of partitions, which will be empty when the given topic is not found. | ||
| * Note: when {@code auto.create.topics.enable} is {@code true}, this method may |
There was a problem hiding this comment.
Should it mention allow.auto.create.topics as well?
There was a problem hiding this comment.
Good point. Updated.
| * | ||
| * @return The list of partitions, which will be empty when the given topic is not found | ||
| * @return The list of partitions, which will be empty when the given topic is not found. | ||
| * Note: when {@code auto.create.topics.enable} is {@code true}, this method may |
https://issues.apache.org/jira/browse/KAFKA-20089
Changing the error code needs a kip. For now updating javadocs. A kip
will be proposed later.
Reviewers: Chia-Ping Tsai chia7712@gmail.com