Repository navigation
Expand file tree
/
Copy pathkvs_cluster.proto
More file actions
110 lines (79 loc) · 2.06 KB
/
Copy pathkvs_cluster.proto
File metadata and controls
110 lines (79 loc) · 2.06 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// gRPC service definition for a "kvs_cluster",
// with string key/value pairs kept on the server.
// Compilation:
// protoc -I=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` kvs_cluster1.proto
// protoc -I=. --cpp_out=. kvs_cluster.proto
syntax = "proto3";
package kvs_cluster;
service KVS_cluster_service {
// Get the value stored on the server for a given key
rpc get (GetValueRequest) returns (GetValueReply) {}
// Put the server's value for a given key
rpc put (PutValueRequest) returns (PutValueReply) {}
// CPut the server's value for a given key
rpc cput (CPutValueRequest) returns (CPutValueReply) {}
// Delete the server's value for a given key
rpc del (DeleteValueRequest) returns (DeleteValueReply) {}
rpc selfAddr (SendSelfAddrRequest) returns (SendSelfAddrReply) {}
rpc clusterMaster (GetMasterInitRequest) returns (GetMasterInitReply) {}
rpc get_update (GetUpdateRequest) returns (GetUpdateReply) {}
rpc diediedie (DieRequest) returns (DieReply) {}
}
message DieRequest {
}
message DieReply {
}
message GetUpdateRequest {
string key = 1;
string val = 2;
}
message GetUpdateReply {
}
message SendSelfAddrRequest {
}
message SendSelfAddrReply {
string addr = 1;
}
message GetMasterInitRequest {
}
message GetMasterInitReply {
string ret = 1;
}
message GetValueRequest {
string row = 1;
string col = 2;
}
message GetValueReply {
// Empty string returned when key not found on the server.
string value = 1;
}
message PutValueRequest {
string row = 1;
string col = 2;
string value = 3;
}
message PutValueReply {
// Returns 1 on success, 0 on failure.
// int32 val = 1;
string value = 1;
}
message CPutValueRequest {
string row = 1;
string col = 2;
string value1 = 3;
string value2 = 4;
}
message CPutValueReply {
// Returns 1 on success, 0 on failure.
// int32 val = 1;
string value = 1;
}
message DeleteValueRequest {
string row = 1;
string col = 2;
}
message DeleteValueReply {
// Returns 1 on success, 0 on failure.
// int32 val = 1;
string value = 1;
}