diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/Admin.java b/clients/src/main/java/org/apache/kafka/clients/admin/Admin.java index 7c2d80f39b306..cda3af2bccf80 100644 --- a/clients/src/main/java/org/apache/kafka/clients/admin/Admin.java +++ b/clients/src/main/java/org/apache/kafka/clients/admin/Admin.java @@ -199,12 +199,12 @@ default CreateTopicsResult createTopics(Collection newTopics) { */ CreateTopicsResult createTopics(Collection newTopics, CreateTopicsOptions options); - default CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map federatedTopics) { - return createFederatedTopicsZnode(federatedTopics, new CreateFederatedTopicsZnodeOptions()); + default CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map federatedTopics) { + return createFederatedTopicZnodes(federatedTopics, new CreateFederatedTopicZnodesOptions()); } - CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map federatedTopics, - CreateFederatedTopicsZnodeOptions options); + CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map federatedTopics, + CreateFederatedTopicZnodesOptions options); /** * This is a convenience method for {@link #deleteTopics(TopicCollection, DeleteTopicsOptions)} diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/CreateFederatedTopicsZnodeOptions.java b/clients/src/main/java/org/apache/kafka/clients/admin/CreateFederatedTopicZnodesOptions.java similarity index 83% rename from clients/src/main/java/org/apache/kafka/clients/admin/CreateFederatedTopicsZnodeOptions.java rename to clients/src/main/java/org/apache/kafka/clients/admin/CreateFederatedTopicZnodesOptions.java index bb022debf855d..545f485131d40 100644 --- a/clients/src/main/java/org/apache/kafka/clients/admin/CreateFederatedTopicsZnodeOptions.java +++ b/clients/src/main/java/org/apache/kafka/clients/admin/CreateFederatedTopicZnodesOptions.java @@ -22,12 +22,12 @@ /** - * Options for {@link Admin#createFederatedTopicsZnode(Map, CreateFederatedTopicsZnodeOptions)} (Collection)}. + * Options for {@link Admin#createFederatedTopicZnodes(Map, CreateFederatedTopicZnodesOptions)} (Collection)}. * * The API of this class is evolving, see {@link Admin} for details. */ @InterfaceStability.Evolving -public class CreateFederatedTopicsZnodeOptions extends AbstractOptions { +public class CreateFederatedTopicZnodesOptions extends AbstractOptions { private boolean retryOnQuotaViolation = true; /** @@ -36,7 +36,7 @@ public class CreateFederatedTopicsZnodeOptions extends AbstractOptions> future; - CreateOrDeleteFederatedTopicsZnodeResult(Map> future) { + CreateOrDeleteFederatedTopicZnodesResult(Map> future) { this.future = future; } diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java b/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java index 6021202d49418..6fd895d420142 100644 --- a/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java +++ b/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java @@ -1600,8 +1600,8 @@ public CreateTopicsResult createTopics(final Collection newTopics, } @Override - public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(final Map federatedTopics, - final CreateFederatedTopicsZnodeOptions options) { + public CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(final Map federatedTopics, + final CreateFederatedTopicZnodesOptions options) { final Map> topicFutures = new HashMap<>(federatedTopics.size()); final long now = time.milliseconds(); List topics = new ArrayList<>(); @@ -1609,7 +1609,7 @@ public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(final topics.add(new LiCreateFederatedTopicZnodesRequestData.FederatedTopics().setName(topic).setNamespace(namespace)); topicFutures.put(topic, new KafkaFutureImpl<>()); }); - runnable.call(new Call("createFederatedTopicsZnode", calcDeadlineMs(now, options.timeoutMs()), + runnable.call(new Call("createFederatedTopicZnodes", calcDeadlineMs(now, options.timeoutMs()), new ControllerNodeProvider()) { @Override AbstractRequest.Builder createRequest(int timeoutMs) { @@ -1635,7 +1635,7 @@ void handleFailure(Throwable throwable) { completeAllExceptionally(topicFutures.values(), throwable); } }, now); - return new CreateOrDeleteFederatedTopicsZnodeResult(new HashMap<>(topicFutures)); + return new CreateOrDeleteFederatedTopicZnodesResult(new HashMap<>(topicFutures)); } private Call getCreateTopicsCall(final CreateTopicsOptions options, diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/NoOpAdminClient.java b/clients/src/main/java/org/apache/kafka/clients/admin/NoOpAdminClient.java index f4150a7151d1f..da4d0d50ece66 100644 --- a/clients/src/main/java/org/apache/kafka/clients/admin/NoOpAdminClient.java +++ b/clients/src/main/java/org/apache/kafka/clients/admin/NoOpAdminClient.java @@ -47,8 +47,8 @@ public CreateTopicsResult createTopics(Collection newTopics, CreateTop } @Override - public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map federatedTopics, - CreateFederatedTopicsZnodeOptions options) { + public CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map federatedTopics, + CreateFederatedTopicZnodesOptions options) { return null; } diff --git a/clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java b/clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java index edfbe5600ed45..986f7e17619fc 100644 --- a/clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java +++ b/clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java @@ -329,8 +329,8 @@ synchronized public CreateTopicsResult createTopics(Collection newTopi } @Override - public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map federatedTopics, - CreateFederatedTopicsZnodeOptions options) { + public CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map federatedTopics, + CreateFederatedTopicZnodesOptions options) { throw new UnsupportedOperationException("Not implemented yet"); } diff --git a/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala index 9152ab5473493..406b086e4b07d 100644 --- a/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala +++ b/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala @@ -138,7 +138,7 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest { val federatedTopic = Map("federated-test-topic" -> "tracking").asJava // create the federated topic znode - client.createFederatedTopicsZnode(federatedTopic) + client.createFederatedTopicZnodes(federatedTopic) } @Test