Skip to content

Commit b484594

Browse files
committed
manual changes + update
1 parent 05faf83 commit b484594

File tree

4 files changed

+298
-310
lines changed

4 files changed

+298
-310
lines changed

test/generated/input.proto

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
option java_package = "org.apache.pulsar.common.api.proto";
2323
option optimize_for = LITE_RUNTIME;
2424

25+
message KeyValue {
26+
required string key = 1;
27+
required string value = 2;
28+
}
29+
2530
message Schema {
2631
enum Type {
2732
None = 0;
@@ -64,12 +69,7 @@
6469
optional int32 batch_size = 6;
6570

6671
// For the chunk message id, we need to specify the first chunk message id.
67-
optional MessageIdData first_chunk_message_id = 7;
68-
}
69-
70-
message KeyValue {
71-
required string key = 1;
72-
required string value = 2;
72+
// optional MessageIdData first_chunk_message_id = 7;
7373
}
7474

7575
message KeyLongValue {
@@ -267,6 +267,15 @@
267267
v21 = 21; // Carry the AUTO_CONSUME schema to the Broker after this version
268268
}
269269

270+
// Please also add a new enum for the class "PulsarClientException.FailedFeatureCheck" when adding a new feature flag.
271+
message FeatureFlags {
272+
optional bool supports_auth_refresh = 1 [default = false];
273+
optional bool supports_broker_entry_metadata = 2 [default = false];
274+
optional bool supports_partial_producer = 3 [default = false];
275+
optional bool supports_topic_watchers = 4 [default = false];
276+
optional bool supports_get_partitioned_metadata_without_auto_creation = 5 [default = false];
277+
}
278+
270279
message CommandConnect {
271280
required string client_version = 1; // The version of the client. Proxy should forward client's client_version.
272281
optional AuthMethod auth_method = 2; // Deprecated. Use "auth_method_name" instead.
@@ -295,22 +304,19 @@
295304
optional string proxy_version = 11; // Version of the proxy. Should only be forwarded by a proxy.
296305
}
297306

298-
// Please also add a new enum for the class "PulsarClientException.FailedFeatureCheck" when adding a new feature flag.
299-
message FeatureFlags {
300-
optional bool supports_auth_refresh = 1 [default = false];
301-
optional bool supports_broker_entry_metadata = 2 [default = false];
302-
optional bool supports_partial_producer = 3 [default = false];
303-
optional bool supports_topic_watchers = 4 [default = false];
304-
optional bool supports_get_partitioned_metadata_without_auto_creation = 5 [default = false];
305-
}
306-
307307
message CommandConnected {
308308
required string server_version = 1;
309309
optional int32 protocol_version = 2 [default = 0];
310310
optional int32 max_message_size = 3;
311311
optional FeatureFlags feature_flags = 4;
312312
}
313313

314+
// To support mutual authentication type, such as Sasl, reuse this command to mutual auth.
315+
message AuthData {
316+
optional string auth_method_name = 1;
317+
optional bytes auth_data = 2;
318+
}
319+
314320
message CommandAuthResponse {
315321
optional string client_version = 1; // The version of the client. Proxy should forward client's client_version.
316322
optional AuthData response = 2;
@@ -323,12 +329,6 @@
323329
optional int32 protocol_version = 3 [default = 0];
324330
}
325331

326-
// To support mutual authentication type, such as Sasl, reuse this command to mutual auth.
327-
message AuthData {
328-
optional string auth_method_name = 1;
329-
optional bytes auth_data = 2;
330-
}
331-
332332
enum KeySharedMode {
333333
AUTO_SPLIT = 0;
334334
STICKY = 1;
@@ -419,13 +419,13 @@
419419
}
420420

421421
message CommandPartitionedTopicMetadataResponse {
422-
enum LookupType {
422+
enum CLookupType {
423423
Success = 0;
424424
Failed = 1;
425425
}
426426
optional uint32 partitions = 1; // Optional in case of error
427427
required uint64 request_id = 2;
428-
optional LookupType response = 3;
428+
optional CLookupType response = 3;
429429
optional ServerError error = 4;
430430
optional string message = 5;
431431
}
@@ -962,7 +962,7 @@
962962
}
963963

964964
message BaseCommand {
965-
enum Type {
965+
enum BaseCommandType {
966966
CONNECT = 2;
967967
CONNECTED = 3;
968968
SUBSCRIBE = 4;
@@ -1055,7 +1055,7 @@
10551055
}
10561056

10571057

1058-
required Type type = 1;
1058+
required BaseCommandType type = 1;
10591059

10601060
optional CommandConnect connect = 2;
10611061
optional CommandConnected connected = 3;

test/generated/output.proto

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
syntax = "proto2";
2+
message KeyValue {
3+
required string key = 1;
4+
required string value = 2;
5+
}
26
message Schema {
37
enum Type {
48
None = 0;
@@ -36,11 +40,6 @@ message MessageIdData {
3640
optional int32 batch_index = 4 [default = -1];
3741
repeated int64 ack_set = 5;
3842
optional int32 batch_size = 6;
39-
optional MessageIdData first_chunk_message_id = 7;
40-
}
41-
message KeyValue {
42-
required string key = 1;
43-
required string value = 2;
4443
}
4544
message KeyLongValue {
4645
required string key = 1;
@@ -171,6 +170,13 @@ enum ProtocolVersion {
171170
v20 = 20;
172171
v21 = 21;
173172
}
173+
message FeatureFlags {
174+
optional bool supports_auth_refresh = 1 [default = false];
175+
optional bool supports_broker_entry_metadata = 2 [default = false];
176+
optional bool supports_partial_producer = 3 [default = false];
177+
optional bool supports_topic_watchers = 4 [default = false];
178+
optional bool supports_get_partitioned_metadata_without_auto_creation = 5 [default = false];
179+
}
174180
message CommandConnect {
175181
required string client_version = 1;
176182
optional AuthMethod auth_method = 2;
@@ -184,19 +190,16 @@ message CommandConnect {
184190
optional FeatureFlags feature_flags = 10;
185191
optional string proxy_version = 11;
186192
}
187-
message FeatureFlags {
188-
optional bool supports_auth_refresh = 1 [default = false];
189-
optional bool supports_broker_entry_metadata = 2 [default = false];
190-
optional bool supports_partial_producer = 3 [default = false];
191-
optional bool supports_topic_watchers = 4 [default = false];
192-
optional bool supports_get_partitioned_metadata_without_auto_creation = 5 [default = false];
193-
}
194193
message CommandConnected {
195194
required string server_version = 1;
196195
optional int32 protocol_version = 2 [default = 0];
197196
optional int32 max_message_size = 3;
198197
optional FeatureFlags feature_flags = 4;
199198
}
199+
message AuthData {
200+
optional string auth_method_name = 1;
201+
optional bytes auth_data = 2;
202+
}
200203
message CommandAuthResponse {
201204
optional string client_version = 1;
202205
optional AuthData response = 2;
@@ -207,10 +210,6 @@ message CommandAuthChallenge {
207210
optional AuthData challenge = 2;
208211
optional int32 protocol_version = 3 [default = 0];
209212
}
210-
message AuthData {
211-
optional string auth_method_name = 1;
212-
optional bytes auth_data = 2;
213-
}
214213
enum KeySharedMode {
215214
AUTO_SPLIT = 0;
216215
STICKY = 1;
@@ -260,13 +259,13 @@ message CommandPartitionedTopicMetadata {
260259
optional bool metadata_auto_creation_enabled = 6 [default = true];
261260
}
262261
message CommandPartitionedTopicMetadataResponse {
263-
enum LookupType {
262+
enum CLookupType {
264263
Success = 0;
265264
Failed = 1;
266265
}
267266
optional uint32 partitions = 1;
268267
required uint64 request_id = 2;
269-
optional LookupType response = 3;
268+
optional CLookupType response = 3;
270269
optional ServerError error = 4;
271270
optional string message = 5;
272271
}
@@ -633,7 +632,7 @@ message CommandEndTxnOnSubscriptionResponse {
633632
optional string message = 5;
634633
}
635634
message BaseCommand {
636-
enum Type {
635+
enum BaseCommandType {
637636
CONNECT = 2;
638637
CONNECTED = 3;
639638
SUBSCRIBE = 4;
@@ -693,7 +692,7 @@ message BaseCommand {
693692
WATCH_TOPIC_LIST_CLOSE = 67;
694693
TOPIC_MIGRATED = 68;
695694
}
696-
required Type type = 1;
695+
required BaseCommandType type = 1;
697696
optional CommandConnect connect = 2;
698697
optional CommandConnected connected = 3;
699698
optional CommandSubscribe subscribe = 4;

0 commit comments

Comments
 (0)