-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdata_loading.fbs
77 lines (58 loc) · 2.2 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Call flatc -c data_loading.fbs to generate c++ file
namespace kv_server;
enum KeyValueMutationType:byte { Update = 0, Delete = 1 }
table StringValue { 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]; }
table UInt32Set { value:[uint]; }
table UInt64Set { value:[ulong]; }
union Value { StringValue, StringSet, UInt32Set, UInt64Set }
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;
// Required. Version number.
version:int64;
}
table ShardMappingRecord {
// Required. Logical shard number.
logical_shard:int32;
// Required. Physical shard number.
physical_shard:int32;
}
union Record {
KeyValueMutationRecord,
UserDefinedFunctionsConfig,
ShardMappingRecord
}
table DataRecord {
record:Record;
}
root_type DataRecord;