Skip to content

Commit 380cda9

Browse files
authored
KAFKA-20021 Document when Admin#createPartitions throws InvalidPartitionsException (#21245)
Refer to https://issues.apache.org/jira/browse/KAFKA-20021. The `Admin#createPartitions` method anticipates an `InvalidPartitionsException` when the requested partition count is less than or equal to the current partition count (i.e., decreasing partitions or keeping the same count is not allowed). However, this exception was missing from the Javadoc description of the returned `CreatePartitionsResult`, see https://kafka.apache.org/41/javadoc/org/apache/kafka/clients/admin/Admin.html#createPartitions. This PR adds `InvalidPartitionsException` to the Javadoc to clarify this behavior for users. Reviewers: Chia-Ping Tsai <[email protected]>
1 parent 04da4fb commit 380cda9

File tree

1 file changed

+2
-0
lines changed
  • clients/src/main/java/org/apache/kafka/clients/admin

1 file changed

+2
-0
lines changed

clients/src/main/java/org/apache/kafka/clients/admin/Admin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,8 @@ default CreatePartitionsResult createPartitions(Map<String, NewPartitions> newPa
665665
* replicas with the topics replication factor.</li>
666666
* <li>Subclasses of {@link org.apache.kafka.common.KafkaException}
667667
* if the request is invalid in some way.</li>
668+
* <li>{@link org.apache.kafka.common.errors.InvalidPartitionsException}
669+
* if the requested partition count is less than or equal to the current partition count.</li>
668670
* </ul>
669671
*
670672
* @param newPartitions The topics which should have new partitions created, and corresponding parameters

0 commit comments

Comments
 (0)