-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeye.proto
122 lines (100 loc) · 2 KB
/
keye.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
syntax = "proto3";
package pb;
option go_package = "github.com/murtaza-u/keye/internal/pb";
// Service Api consists of GET, PUT, DEL and WATCH RPC methods.
// Alongside the fundamental key/value arguments, these RPC methods can
// accept optional configuration parameters, allowing for a convenient
// and intuitive client API.
service Api {
rpc Get(GetParams) returns (GetResponse);
rpc Put(PutParams) returns (PutResponse);
rpc Del(DelParams) returns (DelResponse);
rpc Watch(WatchParams) returns (stream WatchResponse);
rpc Stats(Delta) returns (Measures);
rpc Backup(ChunkSize) returns (stream Chunk);
}
message KV {
string key = 1;
bytes val = 2;
}
message GetParams {
string key = 1;
optional GetOpts opts = 2;
}
message GetOpts {
bool regex = 1;
bool keys_only = 2;
}
message GetResponse {
repeated KV kvs = 1;
}
message PutParams {
string key = 1;
bytes val = 2;
optional PutOpts opts = 3;
}
message PutOpts {
bool regex = 1;
}
message PutResponse {
repeated string keys = 1;
}
message DelParams {
string key = 1;
optional DelOpts opts = 2;
}
message DelOpts {
bool regex = 1;
}
message DelResponse {
repeated string keys = 1;
}
message WatchParams {
string key = 1;
optional WatchOpts opts = 2;
}
message WatchOpts {
bool regex = 1;
}
message WatchResponse {
Event event = 1;
KV kv = 2;
}
enum Event {
EVENT_KEEPALIVE = 0;
EVENT_PUT = 1;
EVENT_DEL = 2;
}
message Delta {
int64 duration = 1;
}
message Measures {
TxStats TxStats = 1;
int32 FreePageN = 2;
int32 PendingPageN = 3;
int32 FreeAlloc = 4;
int32 FreelistInuse = 5;
int32 TxN = 6;
int32 OpenTxN = 7;
}
message TxStats {
int64 PageCount = 1;
int64 PageAlloc = 2;
int64 CursorCount = 3;
int64 NodeCount = 4;
int64 NodeDeref = 5;
int64 Rebalance = 6;
int64 RebalanceTime = 7;
int64 Split = 8;
int64 Spill = 9;
int64 SpillTime = 10;
int64 Write = 11;
int64 WriteTime = 12;
}
message Chunk {
bytes data = 1;
bool more = 2;
}
message ChunkSize {
int64 size = 1;
}