aboutsummaryrefslogtreecommitdiff
path: root/weed/pb/mq_schema.proto
blob: 15b68981c63d9fa3f208ef094fccf76bcc49ae1f (plain)
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
syntax = "proto3";

package schema_pb;

option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb";

///////////////////////////
// Topic definition
///////////////////////////

message Topic {
    string namespace = 1;
    string name = 2;
}
message Partition {
    int32 ring_size = 1;
    int32 range_start = 2;
    int32 range_stop = 3;
    int64 unix_time_ns = 4;
}

message Offset {
    Topic topic = 1;
    repeated PartitionOffset partition_offsets = 2;
}

enum PartitionOffsetStartType {
    EARLIEST = 0;
    EARLIEST_IN_MEMORY = 1;
    LATEST = 2;
}

message PartitionOffset {
    Partition partition = 1;
    int64 start_ts_ns = 2;
    int64 stop_ts_ns = 3;
    PartitionOffsetStartType start_type = 4;
}

///////////////////////////
// schema definition
///////////////////////////

message RecordType {
    repeated Field fields = 1;
}

message Field {
    string name = 1;
    int32 field_index = 2;
    Type type = 3;
    bool is_repeated = 4;
    bool is_required = 5;
}

message Type {
    oneof kind {
        ScalarType scalar_type = 1;
        RecordType record_type = 2;
        ListType list_type = 3;
    }
}

enum ScalarType {
    BOOL = 0;
    INT32 = 1;
    INT64 = 3;
    FLOAT = 4;
    DOUBLE = 5;
    BYTES = 6;
    STRING = 7;
}

message ListType {
    Type element_type = 1;
}

///////////////////////////
// value definition
///////////////////////////
message RecordValue {
    map<string, Value> fields = 1;
}
message Value {
    oneof kind {
        bool bool_value = 1;
        int32 int32_value = 2;
        int64 int64_value = 3;
        float float_value = 4;
        double double_value = 5;
        bytes bytes_value = 6;
        string string_value = 7;
        ListValue list_value = 14;
        RecordValue record_value = 15;
    }
}
message ListValue {
    repeated Value values = 1;
}