Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ba101e0

Browse files
committedNov 17, 2024
set up protobuf file for gRPC so I can do inter-node communication
1 parent 28c84d2 commit ba101e0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
 

‎proto/data_migration.proto

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
syntax = "proto3";
2+
3+
option go_package = "github.com/tferdous17/genesis/proto";
4+
5+
service DataMigrationService {
6+
rpc MigrateKeyValuePairs(KeyValueMigrationRequest) returns (KeyValueMigrationResponse);
7+
}
8+
9+
message KeyValueMigrationRequest {
10+
string source_node_addr = 1;
11+
string dest_node_addr = 2;
12+
repeated KVPair kv_pairs = 3;
13+
}
14+
15+
message KeyValueMigrationResponse {
16+
bool success = 1;
17+
string error_msg = 2;
18+
repeated MigrationResult migration_results = 3;
19+
}
20+
21+
message MigrationResult {
22+
string key = 1;
23+
bool success = 2;
24+
string error_msg = 3;
25+
}
26+
27+
message KVPair {
28+
Record record = 1;
29+
}
30+
31+
message Header {
32+
uint32 checksum = 1;
33+
uint32 tombstone = 2;
34+
uint32 timestamp = 3;
35+
uint32 key_size = 4;
36+
uint32 value_size = 5;
37+
}
38+
39+
message Record {
40+
Header header = 1;
41+
string key = 2;
42+
string value = 3;
43+
uint32 record_size = 4;
44+
}
45+
46+

0 commit comments

Comments
 (0)
Please sign in to comment.