-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeyvalue.proto
87 lines (67 loc) · 1.35 KB
/
keyvalue.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
79
80
81
82
83
84
85
86
87
syntax = "proto3";
package keyvalue;
service KVStore {
rpc GetKey (KeyRequest) returns (KeyValueReply) {}
rpc PutKey (KeyValueRequest) returns (KeyValueReply) {}
rpc DeleteKey (KeyRequest) returns (KeyValueReply) {}
rpc DistMethod (DistRequest) returns (DistReply) {}
}
service ServerComm {
rpc Join (JoinRequest) returns (JoinReply) {}
rpc Share_id (IdPortMessage) returns (IdResponse) {}
rpc Share_key (KeyRequestRange) returns (KVCollection) {}
}
message DistRequest {
int64 type = 1;
int64 key = 2;
string value = 3;
}
message DistReply {
int64 type = 1;
int64 key = 2;
string value = 3;
string message = 4;
int64 success = 5;
}
message IdPortMessage {
int64 id = 1;
string port = 2;
}
message IdResponse {
string message = 1;
}
message JoinRequest {
int64 id = 1;
string port = 2;
}
message JoinReply {
repeated IdPortMessage id_port = 1;
}
message KeyRequestRange {
int64 id = 1;
int64 start = 2;
int64 end = 3;
}
message Keyval {
string key = 1;
string value = 2;
}
message KVCollection {
repeated Keyval kv_vals = 1;
}
message KeyRequest {
string key = 1;
int64 timestamp = 2;
}
message KeyValueRequest {
string key = 1;
string value = 2;
int64 timestamp = 3;
}
message KeyValueReply {
string key = 1;
string value = 2;
string message = 3;
int32 status = 4;
int64 timestamp = 5;
}