forked from BTrDB/btrdb-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbtrdb.proto
More file actions
445 lines (425 loc) · 10.5 KB
/
btrdb.proto
File metadata and controls
445 lines (425 loc) · 10.5 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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
syntax = "proto3";
//Version 5.0
package v5api;
service BTrDB {
rpc RawValues(RawValuesParams) returns (stream RawValuesResponse);
rpc ArrowRawValues(RawValuesParams) returns (stream ArrowRawValuesResponse);
rpc ArrowMultiValues(ArrowMultiValuesParams) returns (stream ArrowMultiValuesResponse);
rpc AlignedWindows(AlignedWindowsParams) returns (stream AlignedWindowsResponse);
rpc ArrowAlignedWindows(AlignedWindowsParams) returns (stream ArrowAlignedWindowsResponse);
rpc Windows(WindowsParams) returns (stream WindowsResponse);
rpc ArrowWindows(WindowsParams) returns (stream ArrowWindowsResponse);
rpc StreamInfo(StreamInfoParams) returns (StreamInfoResponse);
rpc SetStreamAnnotations(SetStreamAnnotationsParams) returns (SetStreamAnnotationsResponse);
rpc SetStreamTags(SetStreamTagsParams) returns (SetStreamTagsResponse);
rpc Create(CreateParams) returns (CreateResponse);
rpc ListCollections(ListCollectionsParams) returns (stream ListCollectionsResponse);
rpc LookupStreams(LookupStreamsParams) returns (stream LookupStreamsResponse);
rpc Nearest(NearestParams) returns (NearestResponse);
rpc Changes(ChangesParams) returns (stream ChangesResponse);
rpc Insert(InsertParams) returns (InsertResponse);
rpc ArrowInsert(ArrowInsertParams) returns (InsertResponse);
rpc Delete(DeleteParams) returns (DeleteResponse);
rpc Info(InfoParams) returns (InfoResponse);
rpc FaultInject(FaultInjectParams) returns (FaultInjectResponse);
rpc Flush(FlushParams) returns (FlushResponse);
rpc Obliterate(ObliterateParams) returns (ObliterateResponse);
rpc GetMetadataUsage(MetadataUsageParams) returns (MetadataUsageResponse);
rpc GenerateCSV(GenerateCSVParams) returns (stream GenerateCSVResponse);
rpc SQLQuery(SQLQueryParams) returns (stream SQLQueryResponse);
rpc Subscribe(stream SubscriptionUpdate) returns (stream SubscriptionResp);
//rpc SetCompactionConfig(SetCompactionConfigParams) returns (SetCompactionConfigResponse);
//rpc GetCompactionConfig(GetCompactionConfigParams) returns (GetCompactionConfigResponse);
}
message RawValuesParams {
bytes uuid = 1;
sfixed64 start = 2;
sfixed64 end = 3;
uint64 versionMajor = 4;
}
message RawValuesResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
repeated RawPoint values = 4;
}
message ArrowRawValuesResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
bytes arrowBytes = 4;
}
message ArrowMultiValuesParams {
repeated bytes uuid = 1;
repeated uint64 versionMajor = 2;
sfixed64 start = 3;
sfixed64 end = 4;
int64 snapPeriodNs = 5;
}
message ArrowMultiValuesResponse {
Status stat = 1;
bytes arrowBytes = 2;
}
message RawPointVec {
sfixed64 time = 1;
repeated double value = 2;
};
message AlignedWindowsParams {
bytes uuid = 1;
sfixed64 start = 2;
sfixed64 end = 3;
uint64 versionMajor = 4;
uint32 pointWidth = 5;
}
message AlignedWindowsResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
repeated StatPoint values = 4;
}
message ArrowAlignedWindowsResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
bytes arrowBytes = 4;
}
message WindowsParams {
bytes uuid = 1;
sfixed64 start = 2;
sfixed64 end = 3;
uint64 versionMajor = 4;
uint64 width = 5;
uint32 depth = 6;
}
message WindowsResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
repeated StatPoint values = 4;
}
message ArrowWindowsResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
bytes arrowBytes = 4;
}
message StreamInfoParams {
bytes uuid = 1;
bool omitVersion = 2;
bool omitDescriptor = 3;
Role role = 100;
}
message StreamInfoResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
StreamDescriptor descriptor = 4;
}
message StreamDescriptor {
bytes uuid = 1;
string collection = 2;
repeated KeyOptValue tags = 3;
repeated KeyOptValue annotations = 4;
uint64 propertyVersion = 5;
}
message SetStreamAnnotationsParams {
bytes uuid = 1;
uint64 expectedPropertyVersion = 2;
repeated KeyOptValue changes = 3;
repeated string removals = 4;
}
message SetStreamAnnotationsResponse {
Status stat = 1;
}
message SetStreamTagsParams {
bytes uuid = 1;
uint64 expectedPropertyVersion = 2;
repeated KeyOptValue tags = 3;
string collection = 4;
repeated string remove = 5;
}
message SetStreamTagsResponse {
Status stat = 1;
}
message CreateParams {
bytes uuid = 1;
string collection = 2;
repeated KeyOptValue tags = 3;
repeated KeyOptValue annotations = 4;
}
message CreateResponse {
Status stat = 1;
}
message MetadataUsageParams {
string prefix = 1;
Role role = 100;
}
message MetadataUsageResponse {
Status stat = 1;
repeated KeyCount tags = 2;
repeated KeyCount annotations = 3;
}
message KeyCount {
string key = 1;
uint64 count = 2;
}
message ListCollectionsParams {
string prefix = 1;
Role role = 100;
}
message ListCollectionsResponse {
Status stat = 1;
repeated string collections = 2;
}
message LookupStreamsParams {
string collection = 1;
bool isCollectionPrefix = 2;
repeated KeyOptValue tags = 3;
repeated KeyOptValue annotations = 4;
Role role = 100;
}
message LookupStreamsResponse {
Status stat = 1;
repeated StreamDescriptor results = 2;
}
message NearestParams {
bytes uuid = 1;
sfixed64 time = 2;
uint64 versionMajor = 3;
bool backward = 4;
}
message NearestResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
RawPoint value = 4;
}
message ChangesParams {
bytes uuid = 1;
uint64 fromMajor = 2;
uint64 toMajor = 3;
uint32 resolution = 4;
}
message ChangesResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
repeated ChangedRange ranges = 4;
}
enum MergePolicy {
NEVER = 0; // Never merge
EQUAL = 1; // Merge identical (key, value) pairs
RETAIN = 2; // When timestamps are equal, keep old value
REPLACE = 3; // When timestamps are equal, keep new value
}
message RoundSpec {
oneof spec {
int32 bits = 2;
}
}
message InsertParams {
bytes uuid = 1;
bool sync = 2;
MergePolicy merge_policy = 4;
RoundSpec rounding=5;
repeated RawPoint values = 3;
}
message ArrowInsertParams {
bytes uuid = 1;
bool sync = 2;
MergePolicy merge_policy = 3;
RoundSpec rounding = 4;
bytes arrowBytes = 5;
}
message InsertResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
}
message DeleteParams {
bytes uuid = 1;
sfixed64 start = 2;
sfixed64 end = 3;
}
message DeleteResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
}
message InfoParams {
}
message InfoResponse {
Status stat = 1;
Mash mash = 2;
uint32 majorVersion = 3;
uint32 minorVersion = 4;
string build = 5;
ProxyInfo proxy = 6;
}
message ProxyInfo {
repeated string proxyEndpoints = 1;
}
message FaultInjectParams {
uint64 type = 1;
bytes params = 2;
}
message FaultInjectResponse {
Status stat = 1;
bytes rv = 2;
}
message FlushParams {
bytes uuid = 1;
}
message FlushResponse {
Status stat = 1;
uint64 versionMajor = 2;
uint64 versionMinor = 3;
}
message ObliterateParams {
bytes uuid = 1;
}
message ObliterateResponse {
Status stat = 1;
}
message RawPoint {
sfixed64 time = 1;
double value = 2;
}
message StatPoint {
sfixed64 time = 1;
double min = 2;
double mean = 3;
double max = 4;
fixed64 count = 5;
double stddev = 6;
}
message ChangedRange {
sfixed64 start = 1;
sfixed64 end = 2;
}
message Status {
uint32 code = 1;
string msg = 2;
Mash mash = 3;
}
message Mash {
int64 revision = 1;
string leader = 2;
int64 leaderRevision = 3;
int64 totalWeight = 4;
bool healthy = 5;
double unmapped = 6;
repeated Member members = 7;
}
message Member {
uint32 hash = 1;
string nodename = 2;
bool up = 3;
bool in = 4;
bool enabled = 5;
int64 start = 6;
int64 end = 7;
int64 weight = 8;
double readPreference = 9;
string httpEndpoints = 10;
string grpcEndpoints = 11;
}
message KeyOptValue {
string key = 1;
OptValue val = 2;
}
message OptValue {
string value = 1;
}
message KeyValue {
string key = 1;
string value = 2;
}
message StreamCSVConfig {
uint64 version = 1;
string label = 2;
bytes uuid = 3;
}
message GenerateCSVParams {
enum QueryType {
ALIGNED_WINDOWS_QUERY = 0;
WINDOWS_QUERY = 1;
RAW_QUERY = 2;
}
QueryType queryType = 1;
int64 startTime = 2;
int64 endTime = 3;
uint64 windowSize = 4;
uint32 depth = 5;
bool includeVersions = 6;
repeated StreamCSVConfig streams = 7;
}
message GenerateCSVResponse {
Status stat = 1;
bool isHeader = 2;
repeated string row = 3;
}
message SQLQueryParams {
string query = 1;
repeated string params = 2;
Role role = 100;
}
message SQLQueryResponse {
Status stat = 1;
repeated bytes SQLQueryRow = 2;
}
message Role {
string name = 1;
}
message SetCompactionConfigParams {
//Which stream to configure
bytes uuid = 1;
//Accessing versions LESS than this is not allowed
uint64 CompactedVersion = 2;
//For every timestamp >= Start and < End in this list,
//we cannot traverse the tree < Resolution.
// Ranges cannot overlap, and a range can never have its resolution PW increased
// (it is okay to decrease a range PW and it is okay to merge two adjacent ranges
// if the new range has <= resolution)
repeated ReducedResolutionRange reducedResolutionRanges = 3;
uint64 unused0 = 4;
}
message SetCompactionConfigResponse {
Status stat = 1;
}
message GetCompactionConfigParams {
//Which stream to query
bytes uuid = 1;
}
message GetCompactionConfigResponse {
Status stat = 1;
//The latest version of the stream, as returned by StreamInfo
uint64 LatestMajorVersion = 2;
//Accessing versions LESS than this is not allowed
uint64 CompactedVersion = 3;
//For every timestamp >= Start and < End in this list,
//we cannot traverse the tree < Resolution.
// Ranges cannot overlap, and a range can never have its resolution PW increased
// (it is okay to decrease a range PW and it is okay to merge two adjacent ranges
// if the new range has <= resolution)
repeated ReducedResolutionRange reducedResolutionRanges = 4;
uint64 unused0 = 5;
}
message ReducedResolutionRange {
int64 Start = 1;
int64 End = 2;
uint32 Resolution = 3;
}
enum SubscriptionUpdateOp {
ADD_UUIDS = 0;
REMOVE_UUIDS = 1;
}
message SubscriptionUpdate {
SubscriptionUpdateOp op = 1;
repeated bytes uuid = 2;
}
message SubscriptionResp {
Status stat = 1;
bytes uuid = 2;
bytes arrowBytes = 3;
}