-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapollo.proto
More file actions
368 lines (317 loc) · 6.36 KB
/
Copy pathapollo.proto
File metadata and controls
368 lines (317 loc) · 6.36 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
syntax = "proto3";
// **************************************************************
//
// Apollo PDU Descriptions.
//
// **************************************************************
message ApolloPdu {
Version version = 1;
uint32 transaction_id = 2;
oneof procedure {
Error error = 3;
Response response = 4;
CreateTable create_table = 5;
DeleteTable delete_table = 6;
OpenTable open_table = 7;
CloseTable close_table = 8;
TableInfo table_info = 9;
Read read = 10;
Write write = 11;
Update update = 12;
Delete delete = 13;
ReadRange read_range = 14;
ReadRangeN read_range_n = 15;
BatchWrite batch_write = 16;
First first = 17;
Last last = 18;
Seek seek = 19;
Next next = 20;
Prev prev = 21;
AddIndex add_index = 22;
RemoveIndex remove_index = 23;
IndexRead index_read = 24;
}
}
// **************************************************************
//
// Apollo Procedure Definitions.
//
// **************************************************************
message BatchWrite {
string table_name = 1;
repeated Field delete_keys = 2;
repeated KeyColumnsPair write_kvps = 3;
}
message CloseTable {
string table_name = 1;
}
message CreateTable {
string table_name = 1;
repeated string keys = 2;
repeated TableOption table_options = 3;
}
message Delete {
string table_name = 1;
repeated Field key = 2;
}
message DeleteTable {
string table_name = 1;
}
message Error {
oneof cause {
string transport = 1;
string protocol = 2;
string system = 3;
string misc = 4;
}
}
message OpenTable {
string table_name = 1;
}
message Read {
string table_name = 1;
repeated Field key = 2;
}
message ReadRange {
string table_name = 1;
repeated Field start_key = 2;
repeated Field end_key = 3;
uint32 limit = 4;
}
message ReadRangeN {
string table_name = 1;
repeated Field start_key = 2;
uint32 n = 3;
}
message Response {
oneof result {
string ok = 1;
Fields columns = 2;
KeyColumnsPair key_columns_pair = 3;
KeyColumnsList key_columns_list = 4;
Fields proplist = 5;
KcpIt kcp_it = 6;
Keys keys = 7;
}
bool more_data_to_be_sent = 7;
}
message TableInfo {
string table_name = 1;
repeated string attributes = 2;
}
message Update {
string table_name = 1;
repeated Field key = 2;
repeated UpdateOperation update_operation = 3;
}
message Write {
string table_name = 1;
repeated Field key = 2;
repeated Field columns = 3;
}
message First {
string table_name = 1;
}
message Last {
string table_name = 1;
}
message Seek {
string table_name = 1;
repeated Field key = 2;
}
message Next {
bytes it =1;
}
message Prev {
bytes it = 1;
}
message AddIndex {
string table_name = 1;
repeated IndexConfig config = 2;
}
message RemoveIndex {
string table_name = 1;
repeated string columns = 2;
}
message IndexRead {
string table_name = 1;
string column_name = 2;
string term = 3;
int64 limit = 4;
}
// **************************************************************
//
// Common IE Definitions.
//
// **************************************************************
enum CharFilter {
NFC = 0;
NFD = 1;
NFKC = 2;
NFKD = 3;
}
enum Comparator {
DESCENDING = 0;
ASCENDING = 1;
}
message Continuation {
bool complete = 1;
repeated Field key = 2;
}
enum DataModel {
KV = 0;
ARRAY = 1;
MAP = 2;
}
message Field {
string name = 1;
oneof value {
bool boolean = 2;
int64 int = 3;
bytes binary = 4;
bytes null = 5;
double double = 6;
string string = 7;
}
}
message FieldNames {
repeated string field_names = 1;
}
message Fields {
repeated Field fields = 1;
}
enum HashingMethod {
VIRTUALNODES = 0;
CONSISTENT = 1;
UNIFORM = 2;
RENDEZVOUS = 3;
}
message IndexConfig {
string column = 1;
IndexOptions options = 2;
}
message IndexOptions {
CharFilter char_filter = 1;
Tokenizer tokenizer = 2;
TokenFilter token_filter = 3;
}
message KeyColumnsPair {
repeated Field key = 1;
repeated Field columns = 2;
}
message KeyColumnsList {
repeated KeyColumnsPair list = 1;
Continuation continuation = 2;
}
message Keys {
repeated Fields keys = 1;
}
message KcpIt {
KeyColumnsPair key_columns_pair = 1;
bytes it = 2;
}
message TableOption {
oneof opt {
Type type = 1;
DataModel data_model = 2;
Wrapper wrapper = 3;
Wrapper mem_wrapper = 4;
Tda tda = 5;
Comparator comparator = 6;
bool time_series = 7;
uint32 num_of_shards = 8;
bool distributed = 9;
uint32 replication_factor = 10;
FieldNames hash_exlude = 11;
HashingMethod hashing_method = 12;
uint32 ttl = 13;
}
}
message Tda {
uint32 num_of_buckets = 1;
oneof time_margin {
uint32 seconds = 2;
uint32 minutes = 3;
uint32 hours = 4;
}
string ts_field = 5;
TimeUnit precision = 6;
}
enum TimeUnit {
SECOND = 0;
MILLISECOND = 1;
MICROSECOND = 2;
NANOSECOND = 3;
}
message TokenFilter {
TokenTransform transform = 1;
repeated string add = 2;
repeated string delete = 3;
TokenStats stats = 4;
}
enum Tokenizer {
UNICODE_WORD_BOUNDARIES = 0;
}
enum TokenStats {
NOSTATS = 0;
UNIQUE = 1;
FREQUENCY = 2;
POSITION = 3;
}
enum TokenTransform {
LOWERCASE = 0;
UPPERCASE = 1;
CASEFOLD = 2;
}
enum Type {
LEVELDB = 0;
MEMLEVELDB = 1;
LEVELDBWRAPPED = 2;
MEMLEVELDBWRAPPED = 3;
LEVELDBTDA = 4;
MEMLEVELDBTDA = 5;
ROCKSDB = 6;
}
message UpdateInstruction {
enum Instruction {
INCREMENT = 0;
OVERWRITE = 7;
}
Instruction instruction = 8;
// empty bytes denote nil. proto3 defaults to 0 for numeric values
// thus, we use bytes to distinguish if 0 is explictly set.
bytes threshold = 14; // encoded big endian uint32
bytes set_value = 15; // encoded big endian uint32
}
message UpdateOperation {
string field = 1;
UpdateInstruction update_instruction = 2;
Value value = 3;
Value default_value = 4;
}
message Value {
oneof value {
bool boolean = 1;
int64 int = 2;
bytes binary = 3;
bytes null = 4;
double double = 5;
string string = 6;
}
}
message Version {
uint32 major = 1;
uint32 minor = 2;
}
message Wrapper {
uint32 num_of_buckets = 1;
oneof time_margin {
uint32 seconds = 2;
uint32 minutes = 3;
uint32 hours = 4;
}
oneof size_margin {
uint32 megabytes = 5;
uint32 gigabytes = 6;
}
}