io.kroxylicious.test.codec.BodyDecoder Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.kroxylicious.test.codec;
import org.apache.kafka.common.message.AddOffsetsToTxnRequestData;
import org.apache.kafka.common.message.AddOffsetsToTxnResponseData;
import org.apache.kafka.common.message.AddPartitionsToTxnRequestData;
import org.apache.kafka.common.message.AddPartitionsToTxnResponseData;
import org.apache.kafka.common.message.AllocateProducerIdsRequestData;
import org.apache.kafka.common.message.AllocateProducerIdsResponseData;
import org.apache.kafka.common.message.AlterClientQuotasRequestData;
import org.apache.kafka.common.message.AlterClientQuotasResponseData;
import org.apache.kafka.common.message.AlterConfigsRequestData;
import org.apache.kafka.common.message.AlterConfigsResponseData;
import org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData;
import org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData;
import org.apache.kafka.common.message.AlterPartitionRequestData;
import org.apache.kafka.common.message.AlterPartitionResponseData;
import org.apache.kafka.common.message.AlterReplicaLogDirsRequestData;
import org.apache.kafka.common.message.AlterReplicaLogDirsResponseData;
import org.apache.kafka.common.message.AlterUserScramCredentialsRequestData;
import org.apache.kafka.common.message.AlterUserScramCredentialsResponseData;
import org.apache.kafka.common.message.ApiVersionsRequestData;
import org.apache.kafka.common.message.ApiVersionsResponseData;
import org.apache.kafka.common.message.AssignReplicasToDirsRequestData;
import org.apache.kafka.common.message.AssignReplicasToDirsResponseData;
import org.apache.kafka.common.message.BeginQuorumEpochRequestData;
import org.apache.kafka.common.message.BeginQuorumEpochResponseData;
import org.apache.kafka.common.message.BrokerHeartbeatRequestData;
import org.apache.kafka.common.message.BrokerHeartbeatResponseData;
import org.apache.kafka.common.message.BrokerRegistrationRequestData;
import org.apache.kafka.common.message.BrokerRegistrationResponseData;
import org.apache.kafka.common.message.ConsumerGroupDescribeRequestData;
import org.apache.kafka.common.message.ConsumerGroupDescribeResponseData;
import org.apache.kafka.common.message.ConsumerGroupHeartbeatRequestData;
import org.apache.kafka.common.message.ConsumerGroupHeartbeatResponseData;
import org.apache.kafka.common.message.ControlledShutdownRequestData;
import org.apache.kafka.common.message.ControlledShutdownResponseData;
import org.apache.kafka.common.message.ControllerRegistrationRequestData;
import org.apache.kafka.common.message.ControllerRegistrationResponseData;
import org.apache.kafka.common.message.CreateAclsRequestData;
import org.apache.kafka.common.message.CreateAclsResponseData;
import org.apache.kafka.common.message.CreateDelegationTokenRequestData;
import org.apache.kafka.common.message.CreateDelegationTokenResponseData;
import org.apache.kafka.common.message.CreatePartitionsRequestData;
import org.apache.kafka.common.message.CreatePartitionsResponseData;
import org.apache.kafka.common.message.CreateTopicsRequestData;
import org.apache.kafka.common.message.CreateTopicsResponseData;
import org.apache.kafka.common.message.DeleteAclsRequestData;
import org.apache.kafka.common.message.DeleteAclsResponseData;
import org.apache.kafka.common.message.DeleteGroupsRequestData;
import org.apache.kafka.common.message.DeleteGroupsResponseData;
import org.apache.kafka.common.message.DeleteRecordsRequestData;
import org.apache.kafka.common.message.DeleteRecordsResponseData;
import org.apache.kafka.common.message.DeleteTopicsRequestData;
import org.apache.kafka.common.message.DeleteTopicsResponseData;
import org.apache.kafka.common.message.DescribeAclsRequestData;
import org.apache.kafka.common.message.DescribeAclsResponseData;
import org.apache.kafka.common.message.DescribeClientQuotasRequestData;
import org.apache.kafka.common.message.DescribeClientQuotasResponseData;
import org.apache.kafka.common.message.DescribeClusterRequestData;
import org.apache.kafka.common.message.DescribeClusterResponseData;
import org.apache.kafka.common.message.DescribeConfigsRequestData;
import org.apache.kafka.common.message.DescribeConfigsResponseData;
import org.apache.kafka.common.message.DescribeDelegationTokenRequestData;
import org.apache.kafka.common.message.DescribeDelegationTokenResponseData;
import org.apache.kafka.common.message.DescribeGroupsRequestData;
import org.apache.kafka.common.message.DescribeGroupsResponseData;
import org.apache.kafka.common.message.DescribeLogDirsRequestData;
import org.apache.kafka.common.message.DescribeLogDirsResponseData;
import org.apache.kafka.common.message.DescribeProducersRequestData;
import org.apache.kafka.common.message.DescribeProducersResponseData;
import org.apache.kafka.common.message.DescribeQuorumRequestData;
import org.apache.kafka.common.message.DescribeQuorumResponseData;
import org.apache.kafka.common.message.DescribeTopicPartitionsRequestData;
import org.apache.kafka.common.message.DescribeTopicPartitionsResponseData;
import org.apache.kafka.common.message.DescribeTransactionsRequestData;
import org.apache.kafka.common.message.DescribeTransactionsResponseData;
import org.apache.kafka.common.message.DescribeUserScramCredentialsRequestData;
import org.apache.kafka.common.message.DescribeUserScramCredentialsResponseData;
import org.apache.kafka.common.message.ElectLeadersRequestData;
import org.apache.kafka.common.message.ElectLeadersResponseData;
import org.apache.kafka.common.message.EndQuorumEpochRequestData;
import org.apache.kafka.common.message.EndQuorumEpochResponseData;
import org.apache.kafka.common.message.EndTxnRequestData;
import org.apache.kafka.common.message.EndTxnResponseData;
import org.apache.kafka.common.message.EnvelopeRequestData;
import org.apache.kafka.common.message.EnvelopeResponseData;
import org.apache.kafka.common.message.ExpireDelegationTokenRequestData;
import org.apache.kafka.common.message.ExpireDelegationTokenResponseData;
import org.apache.kafka.common.message.FetchRequestData;
import org.apache.kafka.common.message.FetchResponseData;
import org.apache.kafka.common.message.FetchSnapshotRequestData;
import org.apache.kafka.common.message.FetchSnapshotResponseData;
import org.apache.kafka.common.message.FindCoordinatorRequestData;
import org.apache.kafka.common.message.FindCoordinatorResponseData;
import org.apache.kafka.common.message.GetTelemetrySubscriptionsRequestData;
import org.apache.kafka.common.message.GetTelemetrySubscriptionsResponseData;
import org.apache.kafka.common.message.HeartbeatRequestData;
import org.apache.kafka.common.message.HeartbeatResponseData;
import org.apache.kafka.common.message.IncrementalAlterConfigsRequestData;
import org.apache.kafka.common.message.IncrementalAlterConfigsResponseData;
import org.apache.kafka.common.message.InitProducerIdRequestData;
import org.apache.kafka.common.message.InitProducerIdResponseData;
import org.apache.kafka.common.message.JoinGroupRequestData;
import org.apache.kafka.common.message.JoinGroupResponseData;
import org.apache.kafka.common.message.LeaderAndIsrRequestData;
import org.apache.kafka.common.message.LeaderAndIsrResponseData;
import org.apache.kafka.common.message.LeaveGroupRequestData;
import org.apache.kafka.common.message.LeaveGroupResponseData;
import org.apache.kafka.common.message.ListClientMetricsResourcesRequestData;
import org.apache.kafka.common.message.ListClientMetricsResourcesResponseData;
import org.apache.kafka.common.message.ListGroupsRequestData;
import org.apache.kafka.common.message.ListGroupsResponseData;
import org.apache.kafka.common.message.ListOffsetsRequestData;
import org.apache.kafka.common.message.ListOffsetsResponseData;
import org.apache.kafka.common.message.ListPartitionReassignmentsRequestData;
import org.apache.kafka.common.message.ListPartitionReassignmentsResponseData;
import org.apache.kafka.common.message.ListTransactionsRequestData;
import org.apache.kafka.common.message.ListTransactionsResponseData;
import org.apache.kafka.common.message.MetadataRequestData;
import org.apache.kafka.common.message.MetadataResponseData;
import org.apache.kafka.common.message.OffsetCommitRequestData;
import org.apache.kafka.common.message.OffsetCommitResponseData;
import org.apache.kafka.common.message.OffsetDeleteRequestData;
import org.apache.kafka.common.message.OffsetDeleteResponseData;
import org.apache.kafka.common.message.OffsetFetchRequestData;
import org.apache.kafka.common.message.OffsetFetchResponseData;
import org.apache.kafka.common.message.OffsetForLeaderEpochRequestData;
import org.apache.kafka.common.message.OffsetForLeaderEpochResponseData;
import org.apache.kafka.common.message.ProduceRequestData;
import org.apache.kafka.common.message.ProduceResponseData;
import org.apache.kafka.common.message.PushTelemetryRequestData;
import org.apache.kafka.common.message.PushTelemetryResponseData;
import org.apache.kafka.common.message.RenewDelegationTokenRequestData;
import org.apache.kafka.common.message.RenewDelegationTokenResponseData;
import org.apache.kafka.common.message.SaslAuthenticateRequestData;
import org.apache.kafka.common.message.SaslAuthenticateResponseData;
import org.apache.kafka.common.message.SaslHandshakeRequestData;
import org.apache.kafka.common.message.SaslHandshakeResponseData;
import org.apache.kafka.common.message.StopReplicaRequestData;
import org.apache.kafka.common.message.StopReplicaResponseData;
import org.apache.kafka.common.message.SyncGroupRequestData;
import org.apache.kafka.common.message.SyncGroupResponseData;
import org.apache.kafka.common.message.TxnOffsetCommitRequestData;
import org.apache.kafka.common.message.TxnOffsetCommitResponseData;
import org.apache.kafka.common.message.UnregisterBrokerRequestData;
import org.apache.kafka.common.message.UnregisterBrokerResponseData;
import org.apache.kafka.common.message.UpdateFeaturesRequestData;
import org.apache.kafka.common.message.UpdateFeaturesResponseData;
import org.apache.kafka.common.message.UpdateMetadataRequestData;
import org.apache.kafka.common.message.UpdateMetadataResponseData;
import org.apache.kafka.common.message.VoteRequestData;
import org.apache.kafka.common.message.VoteResponseData;
import org.apache.kafka.common.message.WriteTxnMarkersRequestData;
import org.apache.kafka.common.message.WriteTxnMarkersResponseData;
import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.ApiMessage;
import org.apache.kafka.common.protocol.Readable;
/**
* Decodes Kafka Readable into an ApiMessage
* Note: this class is automatically generated from a template
*/
public class BodyDecoder {
/**
* Creates a BodyDecoder
*/
private BodyDecoder() {
}
/**
* Decodes Kafka request Readable into an ApiMessage
* @param apiKey the api key of the message
* @param apiVersion the api version of the message
* @param accessor the accessor for the message bytes
* @return the ApiMessage
* @throws IllegalArgumentException if an unhandled ApiKey is encountered
*/
static ApiMessage decodeRequest(ApiKeys apiKey, short apiVersion, Readable accessor) {
switch (apiKey) {
case ADD_OFFSETS_TO_TXN:
return new AddOffsetsToTxnRequestData(accessor, apiVersion);
case ADD_PARTITIONS_TO_TXN:
return new AddPartitionsToTxnRequestData(accessor, apiVersion);
case ALLOCATE_PRODUCER_IDS:
return new AllocateProducerIdsRequestData(accessor, apiVersion);
case ALTER_CLIENT_QUOTAS:
return new AlterClientQuotasRequestData(accessor, apiVersion);
case ALTER_CONFIGS:
return new AlterConfigsRequestData(accessor, apiVersion);
case ALTER_PARTITION_REASSIGNMENTS:
return new AlterPartitionReassignmentsRequestData(accessor, apiVersion);
case ALTER_PARTITION:
return new AlterPartitionRequestData(accessor, apiVersion);
case ALTER_REPLICA_LOG_DIRS:
return new AlterReplicaLogDirsRequestData(accessor, apiVersion);
case ALTER_USER_SCRAM_CREDENTIALS:
return new AlterUserScramCredentialsRequestData(accessor, apiVersion);
case API_VERSIONS:
return new ApiVersionsRequestData(accessor, apiVersion);
case ASSIGN_REPLICAS_TO_DIRS:
return new AssignReplicasToDirsRequestData(accessor, apiVersion);
case BEGIN_QUORUM_EPOCH:
return new BeginQuorumEpochRequestData(accessor, apiVersion);
case BROKER_HEARTBEAT:
return new BrokerHeartbeatRequestData(accessor, apiVersion);
case BROKER_REGISTRATION:
return new BrokerRegistrationRequestData(accessor, apiVersion);
case CONSUMER_GROUP_DESCRIBE:
return new ConsumerGroupDescribeRequestData(accessor, apiVersion);
case CONSUMER_GROUP_HEARTBEAT:
return new ConsumerGroupHeartbeatRequestData(accessor, apiVersion);
case CONTROLLED_SHUTDOWN:
return new ControlledShutdownRequestData(accessor, apiVersion);
case CONTROLLER_REGISTRATION:
return new ControllerRegistrationRequestData(accessor, apiVersion);
case CREATE_ACLS:
return new CreateAclsRequestData(accessor, apiVersion);
case CREATE_DELEGATION_TOKEN:
return new CreateDelegationTokenRequestData(accessor, apiVersion);
case CREATE_PARTITIONS:
return new CreatePartitionsRequestData(accessor, apiVersion);
case CREATE_TOPICS:
return new CreateTopicsRequestData(accessor, apiVersion);
case DELETE_ACLS:
return new DeleteAclsRequestData(accessor, apiVersion);
case DELETE_GROUPS:
return new DeleteGroupsRequestData(accessor, apiVersion);
case DELETE_RECORDS:
return new DeleteRecordsRequestData(accessor, apiVersion);
case DELETE_TOPICS:
return new DeleteTopicsRequestData(accessor, apiVersion);
case DESCRIBE_ACLS:
return new DescribeAclsRequestData(accessor, apiVersion);
case DESCRIBE_CLIENT_QUOTAS:
return new DescribeClientQuotasRequestData(accessor, apiVersion);
case DESCRIBE_CLUSTER:
return new DescribeClusterRequestData(accessor, apiVersion);
case DESCRIBE_CONFIGS:
return new DescribeConfigsRequestData(accessor, apiVersion);
case DESCRIBE_DELEGATION_TOKEN:
return new DescribeDelegationTokenRequestData(accessor, apiVersion);
case DESCRIBE_GROUPS:
return new DescribeGroupsRequestData(accessor, apiVersion);
case DESCRIBE_LOG_DIRS:
return new DescribeLogDirsRequestData(accessor, apiVersion);
case DESCRIBE_PRODUCERS:
return new DescribeProducersRequestData(accessor, apiVersion);
case DESCRIBE_QUORUM:
return new DescribeQuorumRequestData(accessor, apiVersion);
case DESCRIBE_TOPIC_PARTITIONS:
return new DescribeTopicPartitionsRequestData(accessor, apiVersion);
case DESCRIBE_TRANSACTIONS:
return new DescribeTransactionsRequestData(accessor, apiVersion);
case DESCRIBE_USER_SCRAM_CREDENTIALS:
return new DescribeUserScramCredentialsRequestData(accessor, apiVersion);
case ELECT_LEADERS:
return new ElectLeadersRequestData(accessor, apiVersion);
case END_QUORUM_EPOCH:
return new EndQuorumEpochRequestData(accessor, apiVersion);
case END_TXN:
return new EndTxnRequestData(accessor, apiVersion);
case ENVELOPE:
return new EnvelopeRequestData(accessor, apiVersion);
case EXPIRE_DELEGATION_TOKEN:
return new ExpireDelegationTokenRequestData(accessor, apiVersion);
case FETCH:
return new FetchRequestData(accessor, apiVersion);
case FETCH_SNAPSHOT:
return new FetchSnapshotRequestData(accessor, apiVersion);
case FIND_COORDINATOR:
return new FindCoordinatorRequestData(accessor, apiVersion);
case GET_TELEMETRY_SUBSCRIPTIONS:
return new GetTelemetrySubscriptionsRequestData(accessor, apiVersion);
case HEARTBEAT:
return new HeartbeatRequestData(accessor, apiVersion);
case INCREMENTAL_ALTER_CONFIGS:
return new IncrementalAlterConfigsRequestData(accessor, apiVersion);
case INIT_PRODUCER_ID:
return new InitProducerIdRequestData(accessor, apiVersion);
case JOIN_GROUP:
return new JoinGroupRequestData(accessor, apiVersion);
case LEADER_AND_ISR:
return new LeaderAndIsrRequestData(accessor, apiVersion);
case LEAVE_GROUP:
return new LeaveGroupRequestData(accessor, apiVersion);
case LIST_CLIENT_METRICS_RESOURCES:
return new ListClientMetricsResourcesRequestData(accessor, apiVersion);
case LIST_GROUPS:
return new ListGroupsRequestData(accessor, apiVersion);
case LIST_OFFSETS:
return new ListOffsetsRequestData(accessor, apiVersion);
case LIST_PARTITION_REASSIGNMENTS:
return new ListPartitionReassignmentsRequestData(accessor, apiVersion);
case LIST_TRANSACTIONS:
return new ListTransactionsRequestData(accessor, apiVersion);
case METADATA:
return new MetadataRequestData(accessor, apiVersion);
case OFFSET_COMMIT:
return new OffsetCommitRequestData(accessor, apiVersion);
case OFFSET_DELETE:
return new OffsetDeleteRequestData(accessor, apiVersion);
case OFFSET_FETCH:
return new OffsetFetchRequestData(accessor, apiVersion);
case OFFSET_FOR_LEADER_EPOCH:
return new OffsetForLeaderEpochRequestData(accessor, apiVersion);
case PRODUCE:
return new ProduceRequestData(accessor, apiVersion);
case PUSH_TELEMETRY:
return new PushTelemetryRequestData(accessor, apiVersion);
case RENEW_DELEGATION_TOKEN:
return new RenewDelegationTokenRequestData(accessor, apiVersion);
case SASL_AUTHENTICATE:
return new SaslAuthenticateRequestData(accessor, apiVersion);
case SASL_HANDSHAKE:
return new SaslHandshakeRequestData(accessor, apiVersion);
case STOP_REPLICA:
return new StopReplicaRequestData(accessor, apiVersion);
case SYNC_GROUP:
return new SyncGroupRequestData(accessor, apiVersion);
case TXN_OFFSET_COMMIT:
return new TxnOffsetCommitRequestData(accessor, apiVersion);
case UNREGISTER_BROKER:
return new UnregisterBrokerRequestData(accessor, apiVersion);
case UPDATE_FEATURES:
return new UpdateFeaturesRequestData(accessor, apiVersion);
case UPDATE_METADATA:
return new UpdateMetadataRequestData(accessor, apiVersion);
case VOTE:
return new VoteRequestData(accessor, apiVersion);
case WRITE_TXN_MARKERS:
return new WriteTxnMarkersRequestData(accessor, apiVersion);
default:
throw new IllegalArgumentException("Unsupported RPC " + apiKey);
}
}
/**
* Decodes Kafka response Readable into an ApiMessage
* @param apiKey the api key of the message
* @param apiVersion the api version of the message
* @param accessor the accessor for the message bytes
* @return the ApiMessage
* @throws IllegalArgumentException if an unhandled ApiKey is encountered
*/
static ApiMessage decodeResponse(ApiKeys apiKey, short apiVersion, Readable accessor) {
switch (apiKey) {
case ADD_OFFSETS_TO_TXN:
return new AddOffsetsToTxnResponseData(accessor, apiVersion);
case ADD_PARTITIONS_TO_TXN:
return new AddPartitionsToTxnResponseData(accessor, apiVersion);
case ALLOCATE_PRODUCER_IDS:
return new AllocateProducerIdsResponseData(accessor, apiVersion);
case ALTER_CLIENT_QUOTAS:
return new AlterClientQuotasResponseData(accessor, apiVersion);
case ALTER_CONFIGS:
return new AlterConfigsResponseData(accessor, apiVersion);
case ALTER_PARTITION_REASSIGNMENTS:
return new AlterPartitionReassignmentsResponseData(accessor, apiVersion);
case ALTER_PARTITION:
return new AlterPartitionResponseData(accessor, apiVersion);
case ALTER_REPLICA_LOG_DIRS:
return new AlterReplicaLogDirsResponseData(accessor, apiVersion);
case ALTER_USER_SCRAM_CREDENTIALS:
return new AlterUserScramCredentialsResponseData(accessor, apiVersion);
case API_VERSIONS:
return new ApiVersionsResponseData(accessor, apiVersion);
case ASSIGN_REPLICAS_TO_DIRS:
return new AssignReplicasToDirsResponseData(accessor, apiVersion);
case BEGIN_QUORUM_EPOCH:
return new BeginQuorumEpochResponseData(accessor, apiVersion);
case BROKER_HEARTBEAT:
return new BrokerHeartbeatResponseData(accessor, apiVersion);
case BROKER_REGISTRATION:
return new BrokerRegistrationResponseData(accessor, apiVersion);
case CONSUMER_GROUP_DESCRIBE:
return new ConsumerGroupDescribeResponseData(accessor, apiVersion);
case CONSUMER_GROUP_HEARTBEAT:
return new ConsumerGroupHeartbeatResponseData(accessor, apiVersion);
case CONTROLLED_SHUTDOWN:
return new ControlledShutdownResponseData(accessor, apiVersion);
case CONTROLLER_REGISTRATION:
return new ControllerRegistrationResponseData(accessor, apiVersion);
case CREATE_ACLS:
return new CreateAclsResponseData(accessor, apiVersion);
case CREATE_DELEGATION_TOKEN:
return new CreateDelegationTokenResponseData(accessor, apiVersion);
case CREATE_PARTITIONS:
return new CreatePartitionsResponseData(accessor, apiVersion);
case CREATE_TOPICS:
return new CreateTopicsResponseData(accessor, apiVersion);
case DELETE_ACLS:
return new DeleteAclsResponseData(accessor, apiVersion);
case DELETE_GROUPS:
return new DeleteGroupsResponseData(accessor, apiVersion);
case DELETE_RECORDS:
return new DeleteRecordsResponseData(accessor, apiVersion);
case DELETE_TOPICS:
return new DeleteTopicsResponseData(accessor, apiVersion);
case DESCRIBE_ACLS:
return new DescribeAclsResponseData(accessor, apiVersion);
case DESCRIBE_CLIENT_QUOTAS:
return new DescribeClientQuotasResponseData(accessor, apiVersion);
case DESCRIBE_CLUSTER:
return new DescribeClusterResponseData(accessor, apiVersion);
case DESCRIBE_CONFIGS:
return new DescribeConfigsResponseData(accessor, apiVersion);
case DESCRIBE_DELEGATION_TOKEN:
return new DescribeDelegationTokenResponseData(accessor, apiVersion);
case DESCRIBE_GROUPS:
return new DescribeGroupsResponseData(accessor, apiVersion);
case DESCRIBE_LOG_DIRS:
return new DescribeLogDirsResponseData(accessor, apiVersion);
case DESCRIBE_PRODUCERS:
return new DescribeProducersResponseData(accessor, apiVersion);
case DESCRIBE_QUORUM:
return new DescribeQuorumResponseData(accessor, apiVersion);
case DESCRIBE_TOPIC_PARTITIONS:
return new DescribeTopicPartitionsResponseData(accessor, apiVersion);
case DESCRIBE_TRANSACTIONS:
return new DescribeTransactionsResponseData(accessor, apiVersion);
case DESCRIBE_USER_SCRAM_CREDENTIALS:
return new DescribeUserScramCredentialsResponseData(accessor, apiVersion);
case ELECT_LEADERS:
return new ElectLeadersResponseData(accessor, apiVersion);
case END_QUORUM_EPOCH:
return new EndQuorumEpochResponseData(accessor, apiVersion);
case END_TXN:
return new EndTxnResponseData(accessor, apiVersion);
case ENVELOPE:
return new EnvelopeResponseData(accessor, apiVersion);
case EXPIRE_DELEGATION_TOKEN:
return new ExpireDelegationTokenResponseData(accessor, apiVersion);
case FETCH:
return new FetchResponseData(accessor, apiVersion);
case FETCH_SNAPSHOT:
return new FetchSnapshotResponseData(accessor, apiVersion);
case FIND_COORDINATOR:
return new FindCoordinatorResponseData(accessor, apiVersion);
case GET_TELEMETRY_SUBSCRIPTIONS:
return new GetTelemetrySubscriptionsResponseData(accessor, apiVersion);
case HEARTBEAT:
return new HeartbeatResponseData(accessor, apiVersion);
case INCREMENTAL_ALTER_CONFIGS:
return new IncrementalAlterConfigsResponseData(accessor, apiVersion);
case INIT_PRODUCER_ID:
return new InitProducerIdResponseData(accessor, apiVersion);
case JOIN_GROUP:
return new JoinGroupResponseData(accessor, apiVersion);
case LEADER_AND_ISR:
return new LeaderAndIsrResponseData(accessor, apiVersion);
case LEAVE_GROUP:
return new LeaveGroupResponseData(accessor, apiVersion);
case LIST_CLIENT_METRICS_RESOURCES:
return new ListClientMetricsResourcesResponseData(accessor, apiVersion);
case LIST_GROUPS:
return new ListGroupsResponseData(accessor, apiVersion);
case LIST_OFFSETS:
return new ListOffsetsResponseData(accessor, apiVersion);
case LIST_PARTITION_REASSIGNMENTS:
return new ListPartitionReassignmentsResponseData(accessor, apiVersion);
case LIST_TRANSACTIONS:
return new ListTransactionsResponseData(accessor, apiVersion);
case METADATA:
return new MetadataResponseData(accessor, apiVersion);
case OFFSET_COMMIT:
return new OffsetCommitResponseData(accessor, apiVersion);
case OFFSET_DELETE:
return new OffsetDeleteResponseData(accessor, apiVersion);
case OFFSET_FETCH:
return new OffsetFetchResponseData(accessor, apiVersion);
case OFFSET_FOR_LEADER_EPOCH:
return new OffsetForLeaderEpochResponseData(accessor, apiVersion);
case PRODUCE:
return new ProduceResponseData(accessor, apiVersion);
case PUSH_TELEMETRY:
return new PushTelemetryResponseData(accessor, apiVersion);
case RENEW_DELEGATION_TOKEN:
return new RenewDelegationTokenResponseData(accessor, apiVersion);
case SASL_AUTHENTICATE:
return new SaslAuthenticateResponseData(accessor, apiVersion);
case SASL_HANDSHAKE:
return new SaslHandshakeResponseData(accessor, apiVersion);
case STOP_REPLICA:
return new StopReplicaResponseData(accessor, apiVersion);
case SYNC_GROUP:
return new SyncGroupResponseData(accessor, apiVersion);
case TXN_OFFSET_COMMIT:
return new TxnOffsetCommitResponseData(accessor, apiVersion);
case UNREGISTER_BROKER:
return new UnregisterBrokerResponseData(accessor, apiVersion);
case UPDATE_FEATURES:
return new UpdateFeaturesResponseData(accessor, apiVersion);
case UPDATE_METADATA:
return new UpdateMetadataResponseData(accessor, apiVersion);
case VOTE:
return new VoteResponseData(accessor, apiVersion);
case WRITE_TXN_MARKERS:
return new WriteTxnMarkersResponseData(accessor, apiVersion);
default:
throw new IllegalArgumentException("Unsupported RPC " + apiKey);
}
}
}