-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata_loading.fbs
60 lines (44 loc) · 1.88 KB
/
data_loading.fbs
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
// Call flatc -c data_loading.fbs to generate c++ file
namespace kv_server;
enum KeyValueMutationType:byte { Update = 0, Delete = 1 }
table String { value:string; }
// For set values:
// (1) `Update` mutation creates the set if one doesn't exist,
// otherwise inserts the elements into the existing set.
// (2) `Delete` mutation removes the elements from existing set.
table StringSet { value:[string]; }
union Value { String, StringSet }
table KeyValueMutationRecord {
// Required. For updates, the value will overwrite the previous value, if any.
mutation_type: KeyValueMutationType;
// Required. Used to represent the commit time of the record. In cases where 2
// records of the same key are compared, the one with a larger logical time
// is considered newer. There is no constraints on what format the time must
// be other than that a larger number represents a newer timestamp. For sets,
// all elements will have the same timestamp.
logical_commit_time:int64;
// Required.
key:string;
// Required.
value:Value;
}
enum UserDefinedFunctionsLanguage:byte { Javascript = 0 }
table UserDefinedFunctionsConfig {
// Required. Language of the user-defined function.
language:UserDefinedFunctionsLanguage;
// Required. Code snippet containing the user-defined function.
code_snippet:string;
// Required. Handler name is the entry point for user-defined function
// execution.
handler_name:string;
// Required. Used to represent the commit time of the record. In cases where 2
// records of the same key are compared, the one with a larger logical time
// is considered newer. There is no constraints on what format the time must
// be other than that a larger number represents a newer timestamp.
logical_commit_time:int64;
}
union Record { KeyValueMutationRecord, UserDefinedFunctionsConfig }
table DataRecord {
record:Record;
}
root_type DataRecord;