Skip to content

Commit

Permalink
address naming comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kehuum committed Oct 27, 2023
1 parent 63e0102 commit d831433
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ public CreateTopicsResult createTopics(final Collection<NewTopic> newTopics,

@Override
public CreateOrDeleteFederatedTopicsZnodeResult createFederatedTopicsZnode(final Map<String, String> federatedTopics,
final CreateFederatedTopicsZnodeOptions options) {
final CreateFederatedTopicsZnodeOptions options) {
final Map<String, KafkaFutureImpl<Void>> topicFutures = new HashMap<>(federatedTopics.size());
final long now = time.milliseconds();
List<LiFederatedTopicCreateRequestData.FederatedTopics> topics = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public enum ApiKeys {
LI_COMBINED_CONTROL(ApiMessageType.LI_COMBINED_CONTROL, true),
LI_MOVE_CONTROLLER(ApiMessageType.LI_MOVE_CONTROLLER, true),

LI_FEDERATED_TOPIC_CREATE(ApiMessageType.LI_FEDERATED_TOPIC_CREATE, false, true);
LI_CREATE_FEDERATED_TOPIC_ZNODE(ApiMessageType.LI_CREATE_FEDERATED_TOPIC_ZNODES, false, true);

private static final Map<ApiMessageType.ListenerType, EnumSet<ApiKeys>> APIS_BY_LISTENER =
new EnumMap<>(ApiMessageType.ListenerType.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private static AbstractRequest doParseRequest(ApiKeys apiKey, short apiVersion,
return LiCombinedControlRequest.parse(buffer, apiVersion);
case LI_MOVE_CONTROLLER:
return LiMoveControllerRequest.parse(buffer, apiVersion);
case LI_FEDERATED_TOPIC_CREATE:
case LI_CREATE_FEDERATED_TOPIC_ZNODE:
return LiFederatedTopicCreateRequest.parse(buffer, apiVersion);
default:
throw new AssertionError(String.format("ApiKey %s is not currently handled in `parseRequest`, the " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static AbstractResponse parseResponse(ApiKeys apiKey, ByteBuffer response
return LiCombinedControlResponse.parse(responseBuffer, version);
case LI_MOVE_CONTROLLER:
return LiMoveControllerResponse.parse(responseBuffer, version);
case LI_FEDERATED_TOPIC_CREATE:
case LI_CREATE_FEDERATED_TOPIC_ZNODE:
return LiFederatedTopicCreateResponse.parse(responseBuffer, version);
default:
throw new AssertionError(String.format("ApiKey %s is not currently handled in `parseResponse`, the " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static class Builder extends AbstractRequest.Builder<LiFederatedTopicCrea
private final LiFederatedTopicCreateRequestData data;

public Builder(LiFederatedTopicCreateRequestData data, short allowedVersion) {
super(ApiKeys.LI_FEDERATED_TOPIC_CREATE, allowedVersion);
super(ApiKeys.LI_CREATE_FEDERATED_TOPIC_ZNODE, allowedVersion);
this.data = data;
}

Expand All @@ -48,7 +48,7 @@ public String toString() {
private final LiFederatedTopicCreateRequestData data;

LiFederatedTopicCreateRequest(LiFederatedTopicCreateRequestData data, short version) {
super(ApiKeys.LI_FEDERATED_TOPIC_CREATE, version);
super(ApiKeys.LI_CREATE_FEDERATED_TOPIC_ZNODE, version);
this.data = data;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class LiFederatedTopicCreateResponse extends AbstractResponse {
private final short version;

public LiFederatedTopicCreateResponse(LiFederatedTopicCreateResponseData data, short version) {
super(ApiKeys.LI_FEDERATED_TOPIC_CREATE);
super(ApiKeys.LI_CREATE_FEDERATED_TOPIC_ZNODE);
this.data = data;
this.version = version;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/kafka/server/KafkaApis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class KafkaApis(val requestChannel: RequestChannel,
case ApiKeys.LI_CONTROLLED_SHUTDOWN_SKIP_SAFETY_CHECK => handleLiControlledShutdownSkipSafetyCheck(request)
case ApiKeys.LI_COMBINED_CONTROL => handleLiCombinedControlRequest(request, requestLocal)
case ApiKeys.LI_MOVE_CONTROLLER => handleMoveControllerRequest(request)
case ApiKeys.LI_FEDERATED_TOPIC_CREATE => maybeForwardToController(request, handleMarkFederatedTopicRequest)
case ApiKeys.LI_CREATE_FEDERATED_TOPIC_ZNODE => maybeForwardToController(request, handleMarkFederatedTopicRequest)
case _ => throw new IllegalStateException(s"No handler for request api key ${request.header.apiKey}")
}
} catch {
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ class RequestQuotaTest extends BaseRequestTest {
case ApiKeys.LI_MOVE_CONTROLLER =>
new LiMoveControllerRequest.Builder(new LiMoveControllerRequestData(), ApiKeys.LI_MOVE_CONTROLLER.latestVersion)

case ApiKeys.LI_FEDERATED_TOPIC_CREATE =>
new LiFederatedTopicCreateRequest.Builder(new LiFederatedTopicCreateRequestData(), ApiKeys.LI_FEDERATED_TOPIC_CREATE.latestVersion)
case ApiKeys.LI_CREATE_FEDERATED_TOPIC_ZNODE =>
new LiFederatedTopicCreateRequest.Builder(new LiFederatedTopicCreateRequestData(), ApiKeys.LI_CREATE_FEDERATED_TOPIC_ZNODE.latestVersion)

case _ =>
throw new IllegalArgumentException("Unsupported API key " + apiKey)
Expand Down

0 comments on commit d831433

Please sign in to comment.