Skip to content

Commit

Permalink
topicsznode to topicznodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kehuum committed Oct 27, 2023
1 parent aff0561 commit 12294d0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ default CreateTopicsResult createTopics(Collection<NewTopic> newTopics) {
*/
CreateTopicsResult createTopics(Collection<NewTopic> newTopics, CreateTopicsOptions options);

default CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map<String, String> federatedTopics) {
return createFederatedTopicsZnode(federatedTopics, new CreateFederatedTopicsZnodeOptions());
default CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map<String, String> federatedTopics) {
return createFederatedTopicZnodes(federatedTopics, new CreateFederatedTopicZnodesOptions());
}

CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map<String, String> federatedTopics,
CreateFederatedTopicsZnodeOptions options);
CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map<String, String> federatedTopics,
CreateFederatedTopicZnodesOptions options);

/**
* This is a convenience method for {@link #deleteTopics(TopicCollection, DeleteTopicsOptions)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CreateFederatedTopicsZnodeOptions> {
public class CreateFederatedTopicZnodesOptions extends AbstractOptions<CreateFederatedTopicZnodesOptions> {
private boolean retryOnQuotaViolation = true;

/**
Expand All @@ -36,15 +36,15 @@ public class CreateFederatedTopicsZnodeOptions extends AbstractOptions<CreateFed
*
*/
// This method is retained to keep binary compatibility with 0.11
public CreateFederatedTopicsZnodeOptions timeoutMs(Integer timeoutMs) {
public CreateFederatedTopicZnodesOptions timeoutMs(Integer timeoutMs) {
this.timeoutMs = timeoutMs;
return this;
}

/**
* Set to true if quota violation should be automatically retried.
*/
public CreateFederatedTopicsZnodeOptions retryOnQuotaViolation(boolean retryOnQuotaViolation) {
public CreateFederatedTopicZnodesOptions retryOnQuotaViolation(boolean retryOnQuotaViolation) {
this.retryOnQuotaViolation = retryOnQuotaViolation;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
* The API of this class is evolving, see {@link Admin} for details.
*/
@InterfaceStability.Evolving
public class CreateOrDeleteFederatedTopicsZnodeResult {
public class CreateOrDeleteFederatedTopicZnodesResult {
private final Map<String, KafkaFuture<Void>> future;

CreateOrDeleteFederatedTopicsZnodeResult(Map<String, KafkaFuture<Void>> future) {
CreateOrDeleteFederatedTopicZnodesResult(Map<String, KafkaFuture<Void>> future) {
this.future = future;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1600,16 +1600,16 @@ public CreateTopicsResult createTopics(final Collection<NewTopic> newTopics,
}

@Override
public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(final Map<String, String> federatedTopics,
final CreateFederatedTopicsZnodeOptions options) {
public CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(final Map<String, String> federatedTopics,
final CreateFederatedTopicZnodesOptions options) {
final Map<String, KafkaFutureImpl<Void>> topicFutures = new HashMap<>(federatedTopics.size());
final long now = time.milliseconds();
List<LiCreateFederatedTopicZnodesRequestData.FederatedTopics> topics = new ArrayList<>();
federatedTopics.forEach((topic, namespace) -> {
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) {
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public CreateTopicsResult createTopics(Collection<NewTopic> newTopics, CreateTop
}

@Override
public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map<String, String> federatedTopics,
CreateFederatedTopicsZnodeOptions options) {
public CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map<String, String> federatedTopics,
CreateFederatedTopicZnodesOptions options) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ synchronized public CreateTopicsResult createTopics(Collection<NewTopic> newTopi
}

@Override
public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(Map<String, String> federatedTopics,
CreateFederatedTopicsZnodeOptions options) {
public CreateOrDeleteFederatedTopicZnodesResult createFederatedTopicZnodes(Map<String, String> federatedTopics,
CreateFederatedTopicZnodesOptions options) {
throw new UnsupportedOperationException("Not implemented yet");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 12294d0

Please sign in to comment.