risingwave_pb/
common.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Status {
5    #[prost(enumeration = "status::Code", tag = "1")]
6    pub code: i32,
7    #[prost(string, tag = "2")]
8    pub message: ::prost::alloc::string::String,
9}
10/// Nested message and enum types in `Status`.
11pub mod status {
12    #[derive(prost_helpers::AnyPB)]
13    #[derive(
14        Clone,
15        Copy,
16        Debug,
17        PartialEq,
18        Eq,
19        Hash,
20        PartialOrd,
21        Ord,
22        ::prost::Enumeration
23    )]
24    #[repr(i32)]
25    pub enum Code {
26        Unspecified = 0,
27        Ok = 1,
28        UnknownWorker = 2,
29    }
30    impl Code {
31        /// String value of the enum field names used in the ProtoBuf definition.
32        ///
33        /// The values are not transformed in any way and thus are considered stable
34        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
35        pub fn as_str_name(&self) -> &'static str {
36            match self {
37                Self::Unspecified => "UNSPECIFIED",
38                Self::Ok => "OK",
39                Self::UnknownWorker => "UNKNOWN_WORKER",
40            }
41        }
42        /// Creates an enum from field names used in the ProtoBuf definition.
43        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
44            match value {
45                "UNSPECIFIED" => Some(Self::Unspecified),
46                "OK" => Some(Self::Ok),
47                "UNKNOWN_WORKER" => Some(Self::UnknownWorker),
48                _ => None,
49            }
50        }
51    }
52}
53#[derive(prost_helpers::AnyPB)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct HostAddress {
56    #[prost(string, tag = "1")]
57    pub host: ::prost::alloc::string::String,
58    #[prost(int32, tag = "2")]
59    pub port: i32,
60}
61/// Encode which host machine an actor resides.
62#[derive(prost_helpers::AnyPB)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct ActorInfo {
65    #[prost(uint32, tag = "1")]
66    pub actor_id: u32,
67    #[prost(message, optional, tag = "2")]
68    pub host: ::core::option::Option<HostAddress>,
69}
70/// renamed from `ParallelUnit`
71#[derive(prost_helpers::AnyPB)]
72#[derive(Clone, Copy, PartialEq, ::prost::Message)]
73pub struct ActorLocation {
74    #[prost(uint32, tag = "2")]
75    pub worker_node_id: u32,
76}
77#[derive(prost_helpers::AnyPB)]
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct WorkerNode {
80    #[prost(uint32, tag = "1")]
81    pub id: u32,
82    #[prost(enumeration = "WorkerType", tag = "2")]
83    pub r#type: i32,
84    #[prost(message, optional, tag = "3")]
85    pub host: ::core::option::Option<HostAddress>,
86    #[prost(enumeration = "worker_node::State", tag = "4")]
87    pub state: i32,
88    #[prost(message, optional, tag = "6")]
89    pub property: ::core::option::Option<worker_node::Property>,
90    /// Ranges from 0 to 1023, used to generate the machine ID field in the global unique ID.
91    #[prost(uint32, optional, tag = "7")]
92    pub transactional_id: ::core::option::Option<u32>,
93    /// Resource spec.
94    /// It's populated by meta node with the value reported by worker node, when the worker node is added by meta node.
95    /// It's not persistent in meta store.
96    #[prost(message, optional, tag = "8")]
97    pub resource: ::core::option::Option<worker_node::Resource>,
98    /// Timestamp the worker node is added by meta node, in seconds.
99    /// It's populated by meta node, when the worker node is added by meta node.
100    /// It's not persistent in meta store.
101    #[prost(uint64, optional, tag = "9")]
102    pub started_at: ::core::option::Option<u64>,
103}
104/// Nested message and enum types in `WorkerNode`.
105pub mod worker_node {
106    /// Fields in `Property` that doesn't fit current worker type are just ignored by receiver.
107    #[derive(prost_helpers::AnyPB)]
108    #[derive(Clone, PartialEq, ::prost::Message)]
109    pub struct Property {
110        #[prost(bool, tag = "1")]
111        pub is_streaming: bool,
112        #[prost(bool, tag = "2")]
113        pub is_serving: bool,
114        #[prost(bool, tag = "3")]
115        pub is_unschedulable: bool,
116        /// This is used for frontend node to register its rpc address
117        #[prost(string, tag = "4")]
118        pub internal_rpc_host_addr: ::prost::alloc::string::String,
119        #[prost(uint32, tag = "6")]
120        pub parallelism: u32,
121        /// resource group for scheduling
122        #[prost(string, optional, tag = "7")]
123        pub resource_group: ::core::option::Option<::prost::alloc::string::String>,
124    }
125    #[derive(prost_helpers::AnyPB)]
126    #[derive(Clone, PartialEq, ::prost::Message)]
127    pub struct Resource {
128        #[prost(string, tag = "1")]
129        pub rw_version: ::prost::alloc::string::String,
130        #[prost(uint64, tag = "2")]
131        pub total_memory_bytes: u64,
132        #[prost(uint64, tag = "3")]
133        pub total_cpu_cores: u64,
134    }
135    #[derive(prost_helpers::AnyPB)]
136    #[derive(
137        Clone,
138        Copy,
139        Debug,
140        PartialEq,
141        Eq,
142        Hash,
143        PartialOrd,
144        Ord,
145        ::prost::Enumeration
146    )]
147    #[repr(i32)]
148    pub enum State {
149        Unspecified = 0,
150        Starting = 1,
151        Running = 2,
152    }
153    impl State {
154        /// String value of the enum field names used in the ProtoBuf definition.
155        ///
156        /// The values are not transformed in any way and thus are considered stable
157        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
158        pub fn as_str_name(&self) -> &'static str {
159            match self {
160                Self::Unspecified => "UNSPECIFIED",
161                Self::Starting => "STARTING",
162                Self::Running => "RUNNING",
163            }
164        }
165        /// Creates an enum from field names used in the ProtoBuf definition.
166        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
167            match value {
168                "UNSPECIFIED" => Some(Self::Unspecified),
169                "STARTING" => Some(Self::Starting),
170                "RUNNING" => Some(Self::Running),
171                _ => None,
172            }
173        }
174    }
175}
176#[derive(prost_helpers::AnyPB)]
177#[derive(Eq)]
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct Buffer {
180    #[prost(enumeration = "buffer::CompressionType", tag = "1")]
181    pub compression: i32,
182    #[prost(bytes = "vec", tag = "2")]
183    pub body: ::prost::alloc::vec::Vec<u8>,
184}
185/// Nested message and enum types in `Buffer`.
186pub mod buffer {
187    #[derive(prost_helpers::AnyPB)]
188    #[derive(
189        Clone,
190        Copy,
191        Debug,
192        PartialEq,
193        Eq,
194        Hash,
195        PartialOrd,
196        Ord,
197        ::prost::Enumeration
198    )]
199    #[repr(i32)]
200    pub enum CompressionType {
201        Unspecified = 0,
202        None = 1,
203    }
204    impl CompressionType {
205        /// String value of the enum field names used in the ProtoBuf definition.
206        ///
207        /// The values are not transformed in any way and thus are considered stable
208        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
209        pub fn as_str_name(&self) -> &'static str {
210            match self {
211                Self::Unspecified => "UNSPECIFIED",
212                Self::None => "NONE",
213            }
214        }
215        /// Creates an enum from field names used in the ProtoBuf definition.
216        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
217            match value {
218                "UNSPECIFIED" => Some(Self::Unspecified),
219                "NONE" => Some(Self::None),
220                _ => None,
221            }
222        }
223    }
224}
225/// Vnode mapping for stream fragments. Stores mapping from virtual node to (worker id, slot index).
226#[derive(prost_helpers::AnyPB)]
227#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct WorkerSlotMapping {
229    #[prost(uint32, repeated, tag = "1")]
230    pub original_indices: ::prost::alloc::vec::Vec<u32>,
231    #[prost(uint64, repeated, tag = "2")]
232    pub data: ::prost::alloc::vec::Vec<u64>,
233}
234#[derive(prost_helpers::AnyPB)]
235#[derive(Clone, Copy, PartialEq, ::prost::Message)]
236pub struct BatchQueryCommittedEpoch {
237    #[prost(uint64, tag = "1")]
238    pub epoch: u64,
239    #[prost(uint64, tag = "2")]
240    pub hummock_version_id: u64,
241}
242#[derive(prost_helpers::AnyPB)]
243#[derive(Clone, Copy, PartialEq, ::prost::Message)]
244pub struct BatchQueryEpoch {
245    #[prost(oneof = "batch_query_epoch::Epoch", tags = "1, 2, 3, 4")]
246    pub epoch: ::core::option::Option<batch_query_epoch::Epoch>,
247}
248/// Nested message and enum types in `BatchQueryEpoch`.
249pub mod batch_query_epoch {
250    #[derive(prost_helpers::AnyPB)]
251    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
252    pub enum Epoch {
253        #[prost(message, tag = "1")]
254        Committed(super::BatchQueryCommittedEpoch),
255        #[prost(uint64, tag = "2")]
256        Current(u64),
257        #[prost(uint64, tag = "3")]
258        Backup(u64),
259        #[prost(uint64, tag = "4")]
260        TimeTravel(u64),
261    }
262}
263#[derive(prost_helpers::AnyPB)]
264#[derive(Eq, Hash)]
265#[derive(Clone, Copy, PartialEq, ::prost::Message)]
266pub struct OrderType {
267    #[prost(enumeration = "Direction", tag = "1")]
268    pub direction: i32,
269    #[prost(enumeration = "NullsAre", tag = "2")]
270    pub nulls_are: i32,
271}
272/// Column index with an order type (ASC or DESC). Used to represent a sort key (`repeated ColumnOrder`).
273#[derive(prost_helpers::AnyPB)]
274#[derive(Eq, Hash)]
275#[derive(Clone, Copy, PartialEq, ::prost::Message)]
276pub struct ColumnOrder {
277    #[prost(uint32, tag = "1")]
278    pub column_index: u32,
279    #[prost(message, optional, tag = "2")]
280    pub order_type: ::core::option::Option<OrderType>,
281}
282#[derive(prost_helpers::AnyPB)]
283#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
284#[repr(i32)]
285pub enum WorkerType {
286    Unspecified = 0,
287    Frontend = 1,
288    ComputeNode = 2,
289    RiseCtl = 3,
290    Compactor = 4,
291    Meta = 5,
292}
293impl WorkerType {
294    /// String value of the enum field names used in the ProtoBuf definition.
295    ///
296    /// The values are not transformed in any way and thus are considered stable
297    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
298    pub fn as_str_name(&self) -> &'static str {
299        match self {
300            Self::Unspecified => "WORKER_TYPE_UNSPECIFIED",
301            Self::Frontend => "WORKER_TYPE_FRONTEND",
302            Self::ComputeNode => "WORKER_TYPE_COMPUTE_NODE",
303            Self::RiseCtl => "WORKER_TYPE_RISE_CTL",
304            Self::Compactor => "WORKER_TYPE_COMPACTOR",
305            Self::Meta => "WORKER_TYPE_META",
306        }
307    }
308    /// Creates an enum from field names used in the ProtoBuf definition.
309    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
310        match value {
311            "WORKER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
312            "WORKER_TYPE_FRONTEND" => Some(Self::Frontend),
313            "WORKER_TYPE_COMPUTE_NODE" => Some(Self::ComputeNode),
314            "WORKER_TYPE_RISE_CTL" => Some(Self::RiseCtl),
315            "WORKER_TYPE_COMPACTOR" => Some(Self::Compactor),
316            "WORKER_TYPE_META" => Some(Self::Meta),
317            _ => None,
318        }
319    }
320}
321#[derive(prost_helpers::AnyPB)]
322#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
323#[repr(i32)]
324pub enum Direction {
325    Unspecified = 0,
326    Ascending = 1,
327    Descending = 2,
328}
329impl Direction {
330    /// String value of the enum field names used in the ProtoBuf definition.
331    ///
332    /// The values are not transformed in any way and thus are considered stable
333    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
334    pub fn as_str_name(&self) -> &'static str {
335        match self {
336            Self::Unspecified => "DIRECTION_UNSPECIFIED",
337            Self::Ascending => "DIRECTION_ASCENDING",
338            Self::Descending => "DIRECTION_DESCENDING",
339        }
340    }
341    /// Creates an enum from field names used in the ProtoBuf definition.
342    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
343        match value {
344            "DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
345            "DIRECTION_ASCENDING" => Some(Self::Ascending),
346            "DIRECTION_DESCENDING" => Some(Self::Descending),
347            _ => None,
348        }
349    }
350}
351#[derive(prost_helpers::AnyPB)]
352#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
353#[repr(i32)]
354pub enum NullsAre {
355    Unspecified = 0,
356    Largest = 1,
357    Smallest = 2,
358}
359impl NullsAre {
360    /// String value of the enum field names used in the ProtoBuf definition.
361    ///
362    /// The values are not transformed in any way and thus are considered stable
363    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
364    pub fn as_str_name(&self) -> &'static str {
365        match self {
366            Self::Unspecified => "NULLS_ARE_UNSPECIFIED",
367            Self::Largest => "NULLS_ARE_LARGEST",
368            Self::Smallest => "NULLS_ARE_SMALLEST",
369        }
370    }
371    /// Creates an enum from field names used in the ProtoBuf definition.
372    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
373        match value {
374            "NULLS_ARE_UNSPECIFIED" => Some(Self::Unspecified),
375            "NULLS_ARE_LARGEST" => Some(Self::Largest),
376            "NULLS_ARE_SMALLEST" => Some(Self::Smallest),
377            _ => None,
378        }
379    }
380}