20
20
import org .apache .kafka .common .message .ApiVersionsResponseData ;
21
21
import org .apache .kafka .common .protocol .types .Schema ;
22
22
import org .apache .kafka .common .protocol .types .Type ;
23
- import org .apache .kafka .common .record .RecordBatch ;
24
23
25
24
import java .util .ArrayList ;
26
25
import java .util .Arrays ;
@@ -67,11 +66,11 @@ public enum ApiKeys {
67
66
DELETE_RECORDS (ApiMessageType .DELETE_RECORDS ),
68
67
INIT_PRODUCER_ID (ApiMessageType .INIT_PRODUCER_ID ),
69
68
OFFSET_FOR_LEADER_EPOCH (ApiMessageType .OFFSET_FOR_LEADER_EPOCH ),
70
- ADD_PARTITIONS_TO_TXN (ApiMessageType .ADD_PARTITIONS_TO_TXN , false , RecordBatch . MAGIC_VALUE_V2 , false ),
71
- ADD_OFFSETS_TO_TXN (ApiMessageType .ADD_OFFSETS_TO_TXN , false , RecordBatch . MAGIC_VALUE_V2 , false ),
72
- END_TXN (ApiMessageType .END_TXN , false , RecordBatch . MAGIC_VALUE_V2 , false ),
73
- WRITE_TXN_MARKERS (ApiMessageType .WRITE_TXN_MARKERS , true , RecordBatch . MAGIC_VALUE_V2 , false ),
74
- TXN_OFFSET_COMMIT (ApiMessageType .TXN_OFFSET_COMMIT , false , RecordBatch . MAGIC_VALUE_V2 , false ),
69
+ ADD_PARTITIONS_TO_TXN (ApiMessageType .ADD_PARTITIONS_TO_TXN , false , false ),
70
+ ADD_OFFSETS_TO_TXN (ApiMessageType .ADD_OFFSETS_TO_TXN , false , false ),
71
+ END_TXN (ApiMessageType .END_TXN , false , false ),
72
+ WRITE_TXN_MARKERS (ApiMessageType .WRITE_TXN_MARKERS , true , false ),
73
+ TXN_OFFSET_COMMIT (ApiMessageType .TXN_OFFSET_COMMIT , false , false ),
75
74
DESCRIBE_ACLS (ApiMessageType .DESCRIBE_ACLS ),
76
75
CREATE_ACLS (ApiMessageType .CREATE_ACLS , false , true ),
77
76
DELETE_ACLS (ApiMessageType .DELETE_ACLS , false , true ),
@@ -95,19 +94,19 @@ public enum ApiKeys {
95
94
ALTER_CLIENT_QUOTAS (ApiMessageType .ALTER_CLIENT_QUOTAS , false , true ),
96
95
DESCRIBE_USER_SCRAM_CREDENTIALS (ApiMessageType .DESCRIBE_USER_SCRAM_CREDENTIALS ),
97
96
ALTER_USER_SCRAM_CREDENTIALS (ApiMessageType .ALTER_USER_SCRAM_CREDENTIALS , false , true ),
98
- VOTE (ApiMessageType .VOTE , true , RecordBatch . MAGIC_VALUE_V0 , false ),
99
- BEGIN_QUORUM_EPOCH (ApiMessageType .BEGIN_QUORUM_EPOCH , true , RecordBatch . MAGIC_VALUE_V0 , false ),
100
- END_QUORUM_EPOCH (ApiMessageType .END_QUORUM_EPOCH , true , RecordBatch . MAGIC_VALUE_V0 , false ),
101
- DESCRIBE_QUORUM (ApiMessageType .DESCRIBE_QUORUM , true , RecordBatch . MAGIC_VALUE_V0 , true ),
97
+ VOTE (ApiMessageType .VOTE , true , false ),
98
+ BEGIN_QUORUM_EPOCH (ApiMessageType .BEGIN_QUORUM_EPOCH , true , false ),
99
+ END_QUORUM_EPOCH (ApiMessageType .END_QUORUM_EPOCH , true , false ),
100
+ DESCRIBE_QUORUM (ApiMessageType .DESCRIBE_QUORUM , true , true ),
102
101
ALTER_PARTITION (ApiMessageType .ALTER_PARTITION , true ),
103
102
UPDATE_FEATURES (ApiMessageType .UPDATE_FEATURES , true , true ),
104
- ENVELOPE (ApiMessageType .ENVELOPE , true , RecordBatch . MAGIC_VALUE_V0 , false ),
105
- FETCH_SNAPSHOT (ApiMessageType .FETCH_SNAPSHOT , false , RecordBatch . MAGIC_VALUE_V0 , false ),
103
+ ENVELOPE (ApiMessageType .ENVELOPE , true , false ),
104
+ FETCH_SNAPSHOT (ApiMessageType .FETCH_SNAPSHOT , false , false ),
106
105
DESCRIBE_CLUSTER (ApiMessageType .DESCRIBE_CLUSTER ),
107
106
DESCRIBE_PRODUCERS (ApiMessageType .DESCRIBE_PRODUCERS ),
108
- BROKER_REGISTRATION (ApiMessageType .BROKER_REGISTRATION , true , RecordBatch . MAGIC_VALUE_V0 , false ),
109
- BROKER_HEARTBEAT (ApiMessageType .BROKER_HEARTBEAT , true , RecordBatch . MAGIC_VALUE_V0 , false ),
110
- UNREGISTER_BROKER (ApiMessageType .UNREGISTER_BROKER , false , RecordBatch . MAGIC_VALUE_V0 , true ),
107
+ BROKER_REGISTRATION (ApiMessageType .BROKER_REGISTRATION , true , false ),
108
+ BROKER_HEARTBEAT (ApiMessageType .BROKER_HEARTBEAT , true , false ),
109
+ UNREGISTER_BROKER (ApiMessageType .UNREGISTER_BROKER , false , true ),
111
110
DESCRIBE_TRANSACTIONS (ApiMessageType .DESCRIBE_TRANSACTIONS ),
112
111
LIST_TRANSACTIONS (ApiMessageType .LIST_TRANSACTIONS ),
113
112
ALLOCATE_PRODUCER_IDS (ApiMessageType .ALLOCATE_PRODUCER_IDS , true , true ),
@@ -123,8 +122,8 @@ public enum ApiKeys {
123
122
SHARE_GROUP_DESCRIBE (ApiMessageType .SHARE_GROUP_DESCRIBE ),
124
123
SHARE_FETCH (ApiMessageType .SHARE_FETCH ),
125
124
SHARE_ACKNOWLEDGE (ApiMessageType .SHARE_ACKNOWLEDGE ),
126
- ADD_RAFT_VOTER (ApiMessageType .ADD_RAFT_VOTER , false , RecordBatch . MAGIC_VALUE_V0 , true ),
127
- REMOVE_RAFT_VOTER (ApiMessageType .REMOVE_RAFT_VOTER , false , RecordBatch . MAGIC_VALUE_V0 , true ),
125
+ ADD_RAFT_VOTER (ApiMessageType .ADD_RAFT_VOTER , false , true ),
126
+ REMOVE_RAFT_VOTER (ApiMessageType .REMOVE_RAFT_VOTER , false , true ),
128
127
UPDATE_RAFT_VOTER (ApiMessageType .UPDATE_RAFT_VOTER ),
129
128
INITIALIZE_SHARE_GROUP_STATE (ApiMessageType .INITIALIZE_SHARE_GROUP_STATE , true ),
130
129
READ_SHARE_GROUP_STATE (ApiMessageType .READ_SHARE_GROUP_STATE , true ),
@@ -165,9 +164,6 @@ public enum ApiKeys {
165
164
/** indicates if this is a ClusterAction request used only by brokers */
166
165
public final boolean clusterAction ;
167
166
168
- /** indicates the minimum required inter broker magic required to support the API */
169
- public final byte minRequiredInterBrokerMagic ;
170
-
171
167
/** indicates whether the API is enabled for forwarding */
172
168
public final boolean forwardable ;
173
169
@@ -180,24 +176,18 @@ public enum ApiKeys {
180
176
}
181
177
182
178
ApiKeys (ApiMessageType messageType , boolean clusterAction ) {
183
- this (messageType , clusterAction , RecordBatch .MAGIC_VALUE_V0 , false );
184
- }
185
-
186
- ApiKeys (ApiMessageType messageType , boolean clusterAction , boolean forwardable ) {
187
- this (messageType , clusterAction , RecordBatch .MAGIC_VALUE_V0 , forwardable );
179
+ this (messageType , clusterAction , false );
188
180
}
189
181
190
182
ApiKeys (
191
183
ApiMessageType messageType ,
192
184
boolean clusterAction ,
193
- byte minRequiredInterBrokerMagic ,
194
185
boolean forwardable
195
186
) {
196
187
this .messageType = messageType ;
197
188
this .id = messageType .apiKey ();
198
189
this .name = messageType .name ;
199
190
this .clusterAction = clusterAction ;
200
- this .minRequiredInterBrokerMagic = minRequiredInterBrokerMagic ;
201
191
this .requiresDelayedAllocation = forwardable || shouldRetainsBufferReference (messageType .requestSchemas ());
202
192
this .forwardable = forwardable ;
203
193
}
0 commit comments