Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use a custom OptionalU64 to replace optional uint64 #26

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
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
20 changes: 13 additions & 7 deletions src/curp-command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ option java_package = "com.curp.protobuf";
option java_outer_classname = "CommandProto";
option java_multiple_files = true;

// For compatibility of gRPC implementations that do not support the `optional`
// keyword
message OptionalU64 {
uint64 value = 1;
}

message ProposeId {
uint64 client_id = 1;
uint64 seq_num = 2;
Expand Down Expand Up @@ -50,8 +56,8 @@ message CmdResult {
// Please add comments above your error if you want to extend more :)
message CurpError {
message Redirect {
optional uint64 leader_id = 1;
uint64 term = 2;
OptionalU64 leader_id = 1;
uint64 term = 2;
}
oneof err {
// When a command conflicts with the server SP.
Expand Down Expand Up @@ -128,11 +134,11 @@ message FetchClusterRequest {
}

message FetchClusterResponse {
optional uint64 leader_id = 1;
uint64 term = 2;
uint64 cluster_id = 3;
repeated Member members = 4;
uint64 cluster_version = 5;
OptionalU64 leader_id = 1;
uint64 term = 2;
uint64 cluster_id = 3;
repeated Member members = 4;
uint64 cluster_version = 5;
}

message FetchReadStateRequest {
Expand Down