Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7c6ada5
Skip redundant `toStruct()` step when serializing requests that. rely…
ijuma Sep 28, 2019
bc333a7
Skip redundant `toStruct` when serializing responses that rely on aut…
ijuma Sep 28, 2019
10b01b9
Add ignorable to TopicAuthorizedOperation and ClusterAuthorizedOperat…
ijuma Sep 30, 2019
7f66cda
More ignorable
ijuma Sep 30, 2019
8be8cef
Add missing whitespace
ijuma Sep 30, 2019
a84d3d8
Move `message()` to `AbstractRequestResponse` and document it
ijuma Sep 30, 2019
17af66b
Use `toSend` instead of `serializeWithHeader` in `SaslClientAuthentic…
ijuma Sep 30, 2019
9a93b0b
Don't rely on `Struct` directly when parsing requests in the broker
ijuma Oct 1, 2019
859041a
Avoid intermediate structs when deserializing in the broker
ijuma Oct 1, 2019
98dbf1d
Avoid intermediate Struct when deserializing responses
ijuma Oct 2, 2019
daa6dbb
Add back removed tests, modify them to test parsing from buffers inst…
ijuma Oct 2, 2019
a36bbb3
Avoid `toStruct` for request/response header if the request/response …
ijuma Oct 3, 2019
a1bf993
Add `toString` to `ResponseHeader`
ijuma Oct 3, 2019
e00cace
Use diamond
ijuma Oct 3, 2019
56cba5f
Remove unnecessary boxing/unboxing
ijuma Oct 3, 2019
5e0f689
Use assertThrows to simplify code
ijuma Oct 3, 2019
d6cb097
Hacky test fix
ijuma Oct 3, 2019
9317347
Add comment
ijuma Oct 3, 2019
1b07c53
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Oct 9, 2019
f57d04d
WIP
ijuma Oct 10, 2019
186aad4
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Apr 28, 2020
ebf63f7
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Apr 29, 2020
4e4f665
WIP
ijuma Jun 12, 2020
1869826
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Jun 12, 2020
00204bc
WIP
ijuma Jul 27, 2020
c430055
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Jul 27, 2020
5d24335
Fix merge
ijuma Dec 1, 2020
d834f14
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Dec 2, 2020
fb876a1
Minor style fixes
ijuma Dec 2, 2020
2e36e92
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Dec 2, 2020
18d9096
Complete reimplementation of WriteTxnMarkersResponse
ijuma Dec 3, 2020
0b8ea15
AbstractResponse toString no longer requires version
ijuma Dec 3, 2020
aa1735f
Various minor fixes
ijuma Dec 3, 2020
fe9eccb
Complete implementation of AlterClientQuotasRequest/Response
ijuma Dec 3, 2020
5b7695b
Minor style fixes
ijuma Dec 3, 2020
d5cbad3
Revert SaslAuthenticateRequest.Builder.toString change as it could le…
ijuma Dec 3, 2020
02a98d8
Fix bug introduced in previous commit where handleProduceRequest did …
ijuma Dec 3, 2020
5023f3e
Minor style fixes
ijuma Dec 3, 2020
6a20dab
Complete implementation of DescribeConfigsResponse
ijuma Dec 3, 2020
ff108fa
Fix existing bug in ProduceRequest uncovered by AbstractResponse.toSt…
ijuma Dec 3, 2020
bf7f76d
Style fix
ijuma Dec 3, 2020
0ad34fb
Fix NPEs in DeleteAclsResponse and DescribeAclsResponse
ijuma Dec 3, 2020
dee6874
RequestResponseTest fixes
ijuma Dec 3, 2020
b17d1bf
Fix NetworkClientTest failures
ijuma Dec 3, 2020
830d46c
Fix KafkaApisTest failures and rename errors to errorsByProducerId fo…
ijuma Dec 3, 2020
8e719a4
Minor style fix
ijuma Dec 3, 2020
de995be
Fix RequestResponseTest and error message in DescribeClientQuotasRequest
ijuma Dec 3, 2020
ce9bd0b
Fix DeleteAclsResponseTest
ijuma Dec 3, 2020
d3c8fa6
Fix EndTxnResponseTest
ijuma Dec 3, 2020
b7490af
Remove TestUtils.serializeMessage in favor of MessageTestUtil.message…
ijuma Dec 3, 2020
55a6110
Fix LeaveGroupResponseTest
ijuma Dec 3, 2020
7ad198f
Minor fixes
ijuma Dec 3, 2020
cfbbede
Test fixes/improvements
ijuma Dec 3, 2020
f05f217
Merge remote-tracking branch 'apache-github/trunk' into skip-to-struc…
ijuma Dec 3, 2020
4829f7c
Fix MetadataRequestTest failure
ijuma Dec 4, 2020
420a74d
Use SendBuilder in AbstractRequest/Response
ijuma Dec 4, 2020
cfd0c66
Fix request size returned by parseRequest
ijuma Dec 4, 2020
de6dca1
Revert correlation id verification order change
ijuma Dec 4, 2020
ad0e0d5
Revert MetadataResponse.json change
ijuma Dec 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public ApiKeys apiKey() {
}

public RequestHeader makeHeader(short version) {
short requestApiKey = requestBuilder.apiKey().id;
ApiKeys requestApiKey = apiKey();
return new RequestHeader(
new RequestHeaderData()
.setRequestApiKey(requestApiKey)
.setRequestApiKey(requestApiKey.id)
.setRequestApiVersion(version)
.setClientId(clientId)
.setCorrelationId(correlationId),
ApiKeys.forId(requestApiKey).requestHeaderVersion(version));
requestApiKey.requestHeaderVersion(version));
}

public AbstractRequest.Builder<?> requestBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,8 @@ private void handleCompletedReceives(List<ClientResponse> responses, long now) {
InFlightRequest req = inFlightRequests.completeNext(source);

AbstractResponse response = parseResponse(receive.payload(), req.header);
if (throttleTimeSensor != null) {
throttleTimeSensor.record(response.throttleTimeMs());
}
if (throttleTimeSensor != null)
throttleTimeSensor.record(response.throttleTimeMs(), now);

if (log.isDebugEnabled()) {
log.debug("Received {} response from node {} for request with header {}: {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,7 @@ private void handleResponses(long now, List<ClientResponse> responses) {
try {
call.handleResponse(response.responseBody());
if (log.isTraceEnabled())
log.trace("{} got response {}", call,
response.responseBody().toString(response.requestHeader().apiVersion()));
log.trace("{} got response {}", call, response.responseBody());
} catch (Throwable t) {
if (log.isTraceEnabled())
log.trace("{} handleResponse failed with {}", call, prettyPrintException(t));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.kafka.common.record.MemoryRecords;
import org.apache.kafka.common.record.MultiRecordsSend;
import org.apache.kafka.common.requests.RequestHeader;
import org.apache.kafka.common.requests.RequestUtils;
import org.apache.kafka.common.requests.ResponseHeader;
import org.apache.kafka.common.utils.ByteUtils;

Expand Down Expand Up @@ -181,7 +182,7 @@ public Send build() {
public static Send buildRequestSend(
String destination,
RequestHeader header,
ApiMessage apiRequest
Message apiRequest
) {
return buildSend(
destination,
Expand All @@ -195,7 +196,7 @@ public static Send buildRequestSend(
public static Send buildResponseSend(
String destination,
ResponseHeader header,
ApiMessage apiResponse,
Message apiResponse,
short apiVersion
) {
return buildSend(
Expand All @@ -209,16 +210,13 @@ public static Send buildResponseSend(

private static Send buildSend(
String destination,
ApiMessage header,
Message header,
short headerVersion,
ApiMessage apiMessage,
Message apiMessage,
short apiVersion
) {
ObjectSerializationCache serializationCache = new ObjectSerializationCache();
Comment thread
chia7712 marked this conversation as resolved.
MessageSizeAccumulator messageSize = new MessageSizeAccumulator();

header.addSize(messageSize, serializationCache, headerVersion);
apiMessage.addSize(messageSize, serializationCache, apiVersion);
MessageSizeAccumulator messageSize = RequestUtils.size(serializationCache, header, headerVersion, apiMessage, apiVersion);

int totalSize = messageSize.totalSize();
int sizeExcludingZeroCopyFields = totalSize - messageSize.zeroCopySize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
package org.apache.kafka.common.requests;

import org.apache.kafka.common.errors.UnsupportedVersionException;
import org.apache.kafka.common.message.FetchRequestData;
import org.apache.kafka.common.message.AlterIsrRequestData;
import org.apache.kafka.common.message.ProduceRequestData;
import org.apache.kafka.common.network.NetworkSend;
import org.apache.kafka.common.network.Send;
import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.protocol.Message;
import org.apache.kafka.common.protocol.ObjectSerializationCache;
import org.apache.kafka.common.protocol.SendBuilder;

import java.nio.ByteBuffer;
import java.util.Map;
Expand Down Expand Up @@ -79,13 +77,13 @@ public T build() {
}

private final short version;
public final ApiKeys api;
private final ApiKeys apiKey;

public AbstractRequest(ApiKeys api, short version) {
if (!api.isVersionSupported(version))
throw new UnsupportedVersionException("The " + api + " protocol does not support version " + version);
public AbstractRequest(ApiKeys apiKey, short version) {
if (!apiKey.isVersionSupported(version))
throw new UnsupportedVersionException("The " + apiKey + " protocol does not support version " + version);
this.version = version;
this.api = api;
this.apiKey = apiKey;
}

/**
Expand All @@ -95,21 +93,33 @@ public short version() {
return version;
}

public Send toSend(String destination, RequestHeader header) {
return new NetworkSend(destination, serialize(header));
public ApiKeys apiKey() {
return apiKey;
}

/**
* Use with care, typically {@link #toSend(String, RequestHeader)} should be used instead.
*/
public ByteBuffer serialize(RequestHeader header) {
return RequestUtils.serialize(header.toStruct(), toStruct());
public final Send toSend(String destination, RequestHeader header) {
return SendBuilder.buildRequestSend(destination, header, data());
}

// Visible for testing
public final ByteBuffer serializeWithHeader(RequestHeader header) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving this method to test code? MessageTestUtil could be a good place.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto for following "Visible for testing" code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, this method is duplicate to TestUtils#serializeRequestHeader

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method serializes the request with the header while the test method serializes the header only. So, not a duplicate, right? Personally, I think it's useful for the class to be symmetric: it can parse from a buffer and serialize to a buffer. Do you have a concern that it may be misused?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a reasonable argument that serializeBody is the counterpart to parse though and this particular method doesn't have to be here. I can buy that.

@chia7712 chia7712 Dec 4, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a concern that it may be misused?

yes. Also the various serialization methods are a bit chaos to me :(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move all testing-only serialization to a single utils (in test scope). I grep "static ByteBuffer" + "request/response" and MessageUtils, MessageTestUtil, RequestUtils and TestUtils have similar method interface.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a refactoring that consolidates the logic around Send. But I think that would be best done in a separate PR since this PR is really massive. Since these methods are all in internal classes and are only used by tests, I suggest we keep them as they are for now and tackle these nits in the follow up PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have these changes locally, so I can submit them immediately after.

return RequestUtils.serialize(header.data(), header.headerVersion(), data(), version);
}

protected abstract Message data();

// Visible for testing
public final ByteBuffer serializeBody() {
return RequestUtils.serialize(null, (short) 0, data(), version);
}

protected abstract Struct toStruct();
// Visible for testing
final int sizeInBytes() {
return data().size(new ObjectSerializationCache(), version);
}

public String toString(boolean verbose) {
return toStruct().toString();
return data().toString();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this toString variety still useful?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. Do you think it's not?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, what do you mean by variety? The verbose boolean? Yes, that is useful for things like fetch and produce.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems only ProduceRequest does produce verbose string. Maybe we can remove the toString(boolean verbose) as most requests does not generate verbose string. Also, ProduceRequest should override toString() to generate a verbose string always.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The verbosity flag is used for request logging. Produce and fetch are the most important ones. The rest can be ignored. I don't see the benefit in removing this functionality.

}

@Override
Expand Down Expand Up @@ -144,126 +154,131 @@ public Map<Errors, Integer> errorCounts(Throwable e) {
/**
* Factory method for getting a request object based on ApiKey ID and a version
*/
public static AbstractRequest parseRequest(ApiKeys apiKey, short apiVersion, Struct struct) {
public static RequestAndSize parseRequest(ApiKeys apiKey, short apiVersion, ByteBuffer buffer) {
int bufferSize = buffer.remaining();
return new RequestAndSize(doParseRequest(apiKey, apiVersion, buffer), bufferSize);
}

private static AbstractRequest doParseRequest(ApiKeys apiKey, short apiVersion, ByteBuffer buffer) {
switch (apiKey) {
case PRODUCE:
return new ProduceRequest(new ProduceRequestData(struct, apiVersion), apiVersion);
return ProduceRequest.parse(buffer, apiVersion);
case FETCH:
return new FetchRequest(new FetchRequestData(struct, apiVersion), apiVersion);
return FetchRequest.parse(buffer, apiVersion);
case LIST_OFFSETS:
return new ListOffsetRequest(struct, apiVersion);
return ListOffsetRequest.parse(buffer, apiVersion);
case METADATA:
return new MetadataRequest(struct, apiVersion);
return MetadataRequest.parse(buffer, apiVersion);
case OFFSET_COMMIT:
return new OffsetCommitRequest(struct, apiVersion);
return OffsetCommitRequest.parse(buffer, apiVersion);
case OFFSET_FETCH:
return new OffsetFetchRequest(struct, apiVersion);
return OffsetFetchRequest.parse(buffer, apiVersion);
case FIND_COORDINATOR:
return new FindCoordinatorRequest(struct, apiVersion);
return FindCoordinatorRequest.parse(buffer, apiVersion);
case JOIN_GROUP:
return new JoinGroupRequest(struct, apiVersion);
return JoinGroupRequest.parse(buffer, apiVersion);
case HEARTBEAT:
return new HeartbeatRequest(struct, apiVersion);
return HeartbeatRequest.parse(buffer, apiVersion);
case LEAVE_GROUP:
return new LeaveGroupRequest(struct, apiVersion);
return LeaveGroupRequest.parse(buffer, apiVersion);
case SYNC_GROUP:
return new SyncGroupRequest(struct, apiVersion);
return SyncGroupRequest.parse(buffer, apiVersion);
case STOP_REPLICA:
return new StopReplicaRequest(struct, apiVersion);
return StopReplicaRequest.parse(buffer, apiVersion);
case CONTROLLED_SHUTDOWN:
return new ControlledShutdownRequest(struct, apiVersion);
return ControlledShutdownRequest.parse(buffer, apiVersion);
case UPDATE_METADATA:
return new UpdateMetadataRequest(struct, apiVersion);
return UpdateMetadataRequest.parse(buffer, apiVersion);
case LEADER_AND_ISR:
return new LeaderAndIsrRequest(struct, apiVersion);
return LeaderAndIsrRequest.parse(buffer, apiVersion);
case DESCRIBE_GROUPS:
return new DescribeGroupsRequest(struct, apiVersion);
return DescribeGroupsRequest.parse(buffer, apiVersion);
case LIST_GROUPS:
return new ListGroupsRequest(struct, apiVersion);
return ListGroupsRequest.parse(buffer, apiVersion);
case SASL_HANDSHAKE:
return new SaslHandshakeRequest(struct, apiVersion);
return SaslHandshakeRequest.parse(buffer, apiVersion);
case API_VERSIONS:
return new ApiVersionsRequest(struct, apiVersion);
return ApiVersionsRequest.parse(buffer, apiVersion);
case CREATE_TOPICS:
return new CreateTopicsRequest(struct, apiVersion);
return CreateTopicsRequest.parse(buffer, apiVersion);
case DELETE_TOPICS:
return new DeleteTopicsRequest(struct, apiVersion);
return DeleteTopicsRequest.parse(buffer, apiVersion);
case DELETE_RECORDS:
return new DeleteRecordsRequest(struct, apiVersion);
return DeleteRecordsRequest.parse(buffer, apiVersion);
case INIT_PRODUCER_ID:
return new InitProducerIdRequest(struct, apiVersion);
return InitProducerIdRequest.parse(buffer, apiVersion);
case OFFSET_FOR_LEADER_EPOCH:
return new OffsetsForLeaderEpochRequest(struct, apiVersion);
return OffsetsForLeaderEpochRequest.parse(buffer, apiVersion);
case ADD_PARTITIONS_TO_TXN:
return new AddPartitionsToTxnRequest(struct, apiVersion);
return AddPartitionsToTxnRequest.parse(buffer, apiVersion);
case ADD_OFFSETS_TO_TXN:
return new AddOffsetsToTxnRequest(struct, apiVersion);
return AddOffsetsToTxnRequest.parse(buffer, apiVersion);
case END_TXN:
return new EndTxnRequest(struct, apiVersion);
return EndTxnRequest.parse(buffer, apiVersion);
case WRITE_TXN_MARKERS:
return new WriteTxnMarkersRequest(struct, apiVersion);
return WriteTxnMarkersRequest.parse(buffer, apiVersion);
case TXN_OFFSET_COMMIT:
return new TxnOffsetCommitRequest(struct, apiVersion);
return TxnOffsetCommitRequest.parse(buffer, apiVersion);
case DESCRIBE_ACLS:
return new DescribeAclsRequest(struct, apiVersion);
return DescribeAclsRequest.parse(buffer, apiVersion);
case CREATE_ACLS:
return new CreateAclsRequest(struct, apiVersion);
return CreateAclsRequest.parse(buffer, apiVersion);
case DELETE_ACLS:
return new DeleteAclsRequest(struct, apiVersion);
return DeleteAclsRequest.parse(buffer, apiVersion);
case DESCRIBE_CONFIGS:
return new DescribeConfigsRequest(struct, apiVersion);
return DescribeConfigsRequest.parse(buffer, apiVersion);
case ALTER_CONFIGS:
return new AlterConfigsRequest(struct, apiVersion);
return AlterConfigsRequest.parse(buffer, apiVersion);
case ALTER_REPLICA_LOG_DIRS:
return new AlterReplicaLogDirsRequest(struct, apiVersion);
return AlterReplicaLogDirsRequest.parse(buffer, apiVersion);
case DESCRIBE_LOG_DIRS:
return new DescribeLogDirsRequest(struct, apiVersion);
return DescribeLogDirsRequest.parse(buffer, apiVersion);
case SASL_AUTHENTICATE:
return new SaslAuthenticateRequest(struct, apiVersion);
return SaslAuthenticateRequest.parse(buffer, apiVersion);
case CREATE_PARTITIONS:
return new CreatePartitionsRequest(struct, apiVersion);
return CreatePartitionsRequest.parse(buffer, apiVersion);
case CREATE_DELEGATION_TOKEN:
return new CreateDelegationTokenRequest(struct, apiVersion);
return CreateDelegationTokenRequest.parse(buffer, apiVersion);
case RENEW_DELEGATION_TOKEN:
return new RenewDelegationTokenRequest(struct, apiVersion);
return RenewDelegationTokenRequest.parse(buffer, apiVersion);
case EXPIRE_DELEGATION_TOKEN:
return new ExpireDelegationTokenRequest(struct, apiVersion);
return ExpireDelegationTokenRequest.parse(buffer, apiVersion);
case DESCRIBE_DELEGATION_TOKEN:
return new DescribeDelegationTokenRequest(struct, apiVersion);
return DescribeDelegationTokenRequest.parse(buffer, apiVersion);
case DELETE_GROUPS:
return new DeleteGroupsRequest(struct, apiVersion);
return DeleteGroupsRequest.parse(buffer, apiVersion);
case ELECT_LEADERS:
return new ElectLeadersRequest(struct, apiVersion);
return ElectLeadersRequest.parse(buffer, apiVersion);
case INCREMENTAL_ALTER_CONFIGS:
return new IncrementalAlterConfigsRequest(struct, apiVersion);
return IncrementalAlterConfigsRequest.parse(buffer, apiVersion);
case ALTER_PARTITION_REASSIGNMENTS:
return new AlterPartitionReassignmentsRequest(struct, apiVersion);
return AlterPartitionReassignmentsRequest.parse(buffer, apiVersion);
case LIST_PARTITION_REASSIGNMENTS:
return new ListPartitionReassignmentsRequest(struct, apiVersion);
return ListPartitionReassignmentsRequest.parse(buffer, apiVersion);
case OFFSET_DELETE:
return new OffsetDeleteRequest(struct, apiVersion);
return OffsetDeleteRequest.parse(buffer, apiVersion);
case DESCRIBE_CLIENT_QUOTAS:
return new DescribeClientQuotasRequest(struct, apiVersion);
return DescribeClientQuotasRequest.parse(buffer, apiVersion);
case ALTER_CLIENT_QUOTAS:
return new AlterClientQuotasRequest(struct, apiVersion);
return AlterClientQuotasRequest.parse(buffer, apiVersion);
case DESCRIBE_USER_SCRAM_CREDENTIALS:
return new DescribeUserScramCredentialsRequest(struct, apiVersion);
return DescribeUserScramCredentialsRequest.parse(buffer, apiVersion);
case ALTER_USER_SCRAM_CREDENTIALS:
return new AlterUserScramCredentialsRequest(struct, apiVersion);
return AlterUserScramCredentialsRequest.parse(buffer, apiVersion);
case VOTE:
return new VoteRequest(struct, apiVersion);
return VoteRequest.parse(buffer, apiVersion);
case BEGIN_QUORUM_EPOCH:
return new BeginQuorumEpochRequest(struct, apiVersion);
return BeginQuorumEpochRequest.parse(buffer, apiVersion);
case END_QUORUM_EPOCH:
return new EndQuorumEpochRequest(struct, apiVersion);
return EndQuorumEpochRequest.parse(buffer, apiVersion);
case DESCRIBE_QUORUM:
return new DescribeQuorumRequest(struct, apiVersion);
return DescribeQuorumRequest.parse(buffer, apiVersion);
case ALTER_ISR:
return new AlterIsrRequest(new AlterIsrRequestData(struct, apiVersion), apiVersion);
return AlterIsrRequest.parse(buffer, apiVersion);
case UPDATE_FEATURES:
return new UpdateFeaturesRequest(struct, apiVersion);
return UpdateFeaturesRequest.parse(buffer, apiVersion);
case ENVELOPE:
return new EnvelopeRequest(struct, apiVersion);
return EnvelopeRequest.parse(buffer, apiVersion);
default:
throw new AssertionError(String.format("ApiKey %s is not currently handled in `parseRequest`, the " +
"code should be updated to do so.", apiKey));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
*/
package org.apache.kafka.common.requests;

public interface AbstractRequestResponse {

}
public interface AbstractRequestResponse { }
Loading