You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/01 22:12:26 UTC

[GitHub] [kafka] jolshan commented on a change in pull request #10892: KAFKA-13011: Update deleteTopics Admin API

jolshan commented on a change in pull request #10892:
URL: https://github.com/apache/kafka/pull/10892#discussion_r662621155



##########
File path: clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
##########
@@ -209,65 +209,59 @@ default CreateTopicsResult createTopics(Collection<NewTopic> newTopics) {
      * @return The DeleteTopicsResult.
      */
     default DeleteTopicsResult deleteTopics(Collection<String> topics) {
-        return deleteTopics(topics, new DeleteTopicsOptions());
+        return deleteTopics(TopicCollection.ofTopicNames(topics), new DeleteTopicsOptions());
     }
 
     /**
-     * Delete a batch of topics.
-     * <p>
-     * This operation is not transactional so it may succeed for some topics while fail for others.
-     * <p>
-     * It may take several seconds after the {@link DeleteTopicsResult} returns
-     * success for all the brokers to become aware that the topics are gone.
-     * During this time, {@link #listTopics()} and {@link #describeTopics(Collection)}
-     * may continue to return information about the deleted topics.
-     * <p>
-     * If delete.topic.enable is false on the brokers, deleteTopics will mark
-     * the topics for deletion, but not actually delete them. The futures will
-     * return successfully in this case.
+     * This is a convenience method for {@link #deleteTopics(TopicCollection, DeleteTopicsOptions)}
+     * with default options. See the overload for more details.
      * <p>
      * This operation is supported by brokers with version 0.10.1.0 or higher.
      *
      * @param topics  The topic names to delete.
      * @param options The options to use when deleting the topics.
      * @return The DeleteTopicsResult.
      */
-    DeleteTopicsResult deleteTopics(Collection<String> topics, DeleteTopicsOptions options);
-    
+    default DeleteTopicsResult deleteTopics(Collection<String> topics, DeleteTopicsOptions options) {
+        return deleteTopics(TopicCollection.ofTopicNames(topics), options);
+    }
+
     /**
-     * This is a convenience method for {@link #deleteTopicsWithIds(Collection, DeleteTopicsOptions)}
+     * This is a convenience method for {@link #deleteTopics(TopicCollection, DeleteTopicsOptions)}
      * with default options. See the overload for more details.
      * <p>
-     * This operation is supported by brokers with version 2.8.0 or higher.
+     * When using topic IDs, this operation is supported by brokers with version 3.0.0 or higher.

Review comment:
       Ah, it will need the controller to use topic IDs (IBP 2.8) to get a successful deletion. The 3.0.0 part was for the code to handle the request itself.




-- 
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