-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkv.proto
78 lines (67 loc) · 1.57 KB
/
kv.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
syntax = "proto3";
message PutRequest {
uint32 id = 1;
uint32 key = 2;
string value = 3;
uint32 consistency_level = 4;
}
message GetRequest {
uint32 id = 1;
uint32 key = 2;
uint32 consistency_level = 3;
string value = 4;
double timestamp = 5;
}
message CordResponse {
uint32 id = 1;
uint32 key = 2;
bool status = 3;
string value = 4;
double timestamp = 5;
}
message ReplicaResponse {
uint32 id = 1;
uint32 key = 2;
string value = 3;
bool status = 4;
double timestamp = 5; // unix timestamp;. String okay? Or int32 or int64?
repeated ReplicaRequest hinted_handoff = 6;
}
message ReplicaRequest {
uint32 id = 1;
uint32 key = 2;
string value = 3;
double timestamp = 4;
uint32 operation = 5; // 0--> Read, 1-->Write
}
message ErrorMessage {
string msg = 1;
}
message ReadRepair{
uint32 key = 1;
string value = 2;
double timestamp = 3;
}
message HintedHandoff{
uint32 key = 1;
string value = 2;
double timestamp = 3;
}
message DisplayKV{
bool status = 1;
}
message HeartBeat{ // Used to check whether 'Node' is offline/online
bool status = 1;
}
message KVMessage {
oneof kv_message {
PutRequest put_request = 1;
GetRequest get_request = 2;
CordResponse cord_response = 3;
ReplicaRequest replica_request = 4;
ReplicaResponse replica_response = 5;
ErrorMessage error_message = 6;
DisplayKV display_kvstore = 7; // User friendly message for displaying KV on comsole.
HeartBeat heart_beat = 8;
}
}