mz_persist/mnt/build/debug/build/mz-persist-c5c91103a8a4686c/out/mz_persist.gen.persist.rs
1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ProtoU64Antichain {
4 #[prost(uint64, repeated, tag = "1")]
5 pub elements: ::prost::alloc::vec::Vec<u64>,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct ProtoU64Description {
9 #[prost(message, optional, tag = "1")]
10 pub lower: ::core::option::Option<ProtoU64Antichain>,
11 #[prost(message, optional, tag = "2")]
12 pub upper: ::core::option::Option<ProtoU64Antichain>,
13 #[prost(message, optional, tag = "3")]
14 pub since: ::core::option::Option<ProtoU64Antichain>,
15}
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct ProtoBatchPartInline {
18 #[prost(enumeration = "ProtoBatchFormat", tag = "1")]
19 pub format: i32,
20 /// TraceBatchParts can contain partial data for a given trace batch, and so
21 /// this desc means only that the records contained in this part have to
22 /// abide by the constraints in the description. There may be other parts
23 /// for the same trace batch with the same description. However, there will
24 /// be only one trace batch with the same description and index.
25 #[prost(message, optional, tag = "2")]
26 pub desc: ::core::option::Option<ProtoU64Description>,
27 #[prost(uint64, tag = "3")]
28 pub index: u64,
29 /// Optional metadata for the `format`.
30 #[prost(oneof = "proto_batch_part_inline::FormatMetadata", tags = "4")]
31 pub format_metadata: ::core::option::Option<proto_batch_part_inline::FormatMetadata>,
32}
33/// Nested message and enum types in `ProtoBatchPartInline`.
34pub mod proto_batch_part_inline {
35 /// Optional metadata for the `format`.
36 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
37 pub enum FormatMetadata {
38 /// Metadata for the structured format with `\[(K, V, T, D, K_S, V_S)\]`.
39 #[prost(uint64, tag = "4")]
40 StructuredMigration(u64),
41 }
42}
43#[derive(serde::Serialize)]
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct ProtoColumnarRecords {
46 #[prost(uint64, tag = "1")]
47 pub len: u64,
48 #[prost(int32, repeated, tag = "2")]
49 pub key_offsets: ::prost::alloc::vec::Vec<i32>,
50 #[prost(bytes = "bytes", tag = "3")]
51 pub key_data: ::prost::bytes::Bytes,
52 #[prost(int32, repeated, tag = "4")]
53 pub val_offsets: ::prost::alloc::vec::Vec<i32>,
54 #[prost(bytes = "bytes", tag = "5")]
55 pub val_data: ::prost::bytes::Bytes,
56 #[prost(int64, repeated, tag = "6")]
57 pub timestamps: ::prost::alloc::vec::Vec<i64>,
58 #[prost(int64, repeated, tag = "7")]
59 pub diffs: ::prost::alloc::vec::Vec<i64>,
60 #[prost(message, optional, tag = "8")]
61 pub key_structured: ::core::option::Option<
62 ::mz_persist_types::arrow::ProtoArrayData,
63 >,
64 #[prost(message, optional, tag = "9")]
65 pub val_structured: ::core::option::Option<
66 ::mz_persist_types::arrow::ProtoArrayData,
67 >,
68}
69#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
70#[repr(i32)]
71pub enum ProtoBatchFormat {
72 Unknown = 0,
73 /// Arrow, which we'd use for the local blob cache if we use it, gets a
74 /// structure like `\[(K, V, T, D)\]` so that we could mmap it and use it
75 /// directly as our in-mem batches (which have this structure).
76 ArrowKvtd = 1,
77 /// We have more flexibility with Parquet. Initially we'll start with the
78 /// same `\[(K, V, T, D)\]` as our in-mem batches. Another option would be
79 /// something like `\[(K, [(V, [(T, D)\])])]`, which would only store each
80 /// key's and each val's data once (this is similar to the
81 /// \[differential_dataflow::trace::layers::Trie\] structure of
82 /// \[differential_dataflow::trace::implementations::ord::OrdValBatch\]).
83 ///
84 /// Which is better probably comes down to how much duplication we expect of
85 /// keys and vals in a batch as well as how big the batches are (the trie
86 /// structure introduces more columns, so has some amount of overhead).
87 ///
88 /// For unsealed batches, we have a better chance of duplicates than trace,
89 /// but we probably don't want to pay the cost of converting between the
90 /// in-mem `\[(K, V, T, D)\]` representation and anything else (to keep the hot
91 /// path clean). Unsealed batches are also likely to be our smallest. For
92 /// this reason, they'll probably always stay as ParquetKvtd.
93 ///
94 /// For trace batches, we consolidate them before writing them out, so we're
95 /// guaranteed to get nothing from the V level of the trie. For duplicate
96 /// keys, we'll probably get a good amount of benefit from column specific
97 /// compression, and I'd like to exhaust that direction first before dealing
98 /// with a trie-like column structure.
99 ParquetKvtd = 2,
100 /// Parquet format that understands the structure of the inner data. See the
101 /// `metadata` field on `ProtoBatchPartInline` for more information about
102 /// how this data is structured in Parquet.
103 ///
104 /// For example, the initial use of this format will contain the columns
105 /// `\[(K, V, T, D, K_S, V_S)\]` where `K_S` and `V_S` are structured versions
106 /// of the opaque data stored in `K` and `V`, respectively. Eventually we'll
107 /// stop writing `K` and `V` and migrate entirely to `K_S` and `V_S`.
108 ParquetStructured = 3,
109}
110impl ProtoBatchFormat {
111 /// String value of the enum field names used in the ProtoBuf definition.
112 ///
113 /// The values are not transformed in any way and thus are considered stable
114 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
115 pub fn as_str_name(&self) -> &'static str {
116 match self {
117 Self::Unknown => "Unknown",
118 Self::ArrowKvtd => "ArrowKVTD",
119 Self::ParquetKvtd => "ParquetKvtd",
120 Self::ParquetStructured => "ParquetStructured",
121 }
122 }
123 /// Creates an enum from field names used in the ProtoBuf definition.
124 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
125 match value {
126 "Unknown" => Some(Self::Unknown),
127 "ArrowKVTD" => Some(Self::ArrowKvtd),
128 "ParquetKvtd" => Some(Self::ParquetKvtd),
129 "ParquetStructured" => Some(Self::ParquetStructured),
130 _ => None,
131 }
132 }
133}