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        /// The host name reported by `gethostname()`.
135        /// Not to be confused with `host` field in `WorkerNode`.
136        #[prost(string, tag = "4")]
137        pub hostname: ::prost::alloc::string::String,
138    }
139    #[derive(prost_helpers::AnyPB)]
140    #[derive(
141        Clone,
142        Copy,
143        Debug,
144        PartialEq,
145        Eq,
146        Hash,
147        PartialOrd,
148        Ord,
149        ::prost::Enumeration
150    )]
151    #[repr(i32)]
152    pub enum State {
153        Unspecified = 0,
154        Starting = 1,
155        Running = 2,
156    }
157    impl State {
158        /// String value of the enum field names used in the ProtoBuf definition.
159        ///
160        /// The values are not transformed in any way and thus are considered stable
161        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
162        pub fn as_str_name(&self) -> &'static str {
163            match self {
164                Self::Unspecified => "UNSPECIFIED",
165                Self::Starting => "STARTING",
166                Self::Running => "RUNNING",
167            }
168        }
169        /// Creates an enum from field names used in the ProtoBuf definition.
170        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
171            match value {
172                "UNSPECIFIED" => Some(Self::Unspecified),
173                "STARTING" => Some(Self::Starting),
174                "RUNNING" => Some(Self::Running),
175                _ => None,
176            }
177        }
178    }
179}
180#[derive(prost_helpers::AnyPB)]
181#[derive(Clone, Copy, PartialEq, ::prost::Message)]
182pub struct ClusterResource {
183    #[prost(uint64, tag = "1")]
184    pub total_memory_bytes: u64,
185    #[prost(uint64, tag = "2")]
186    pub total_cpu_cores: u64,
187}
188#[derive(prost_helpers::AnyPB)]
189#[derive(Eq)]
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct Buffer {
192    #[prost(enumeration = "buffer::CompressionType", tag = "1")]
193    pub compression: i32,
194    #[prost(bytes = "vec", tag = "2")]
195    pub body: ::prost::alloc::vec::Vec<u8>,
196}
197/// Nested message and enum types in `Buffer`.
198pub mod buffer {
199    #[derive(prost_helpers::AnyPB)]
200    #[derive(
201        Clone,
202        Copy,
203        Debug,
204        PartialEq,
205        Eq,
206        Hash,
207        PartialOrd,
208        Ord,
209        ::prost::Enumeration
210    )]
211    #[repr(i32)]
212    pub enum CompressionType {
213        Unspecified = 0,
214        None = 1,
215    }
216    impl CompressionType {
217        /// String value of the enum field names used in the ProtoBuf definition.
218        ///
219        /// The values are not transformed in any way and thus are considered stable
220        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
221        pub fn as_str_name(&self) -> &'static str {
222            match self {
223                Self::Unspecified => "UNSPECIFIED",
224                Self::None => "NONE",
225            }
226        }
227        /// Creates an enum from field names used in the ProtoBuf definition.
228        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
229            match value {
230                "UNSPECIFIED" => Some(Self::Unspecified),
231                "NONE" => Some(Self::None),
232                _ => None,
233            }
234        }
235    }
236}
237/// Vnode mapping for stream fragments. Stores mapping from virtual node to (worker id, slot index).
238#[derive(prost_helpers::AnyPB)]
239#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct WorkerSlotMapping {
241    #[prost(uint32, repeated, tag = "1")]
242    pub original_indices: ::prost::alloc::vec::Vec<u32>,
243    #[prost(uint64, repeated, tag = "2")]
244    pub data: ::prost::alloc::vec::Vec<u64>,
245}
246#[derive(prost_helpers::AnyPB)]
247#[derive(Clone, Copy, PartialEq, ::prost::Message)]
248pub struct BatchQueryCommittedEpoch {
249    #[prost(uint64, tag = "1")]
250    pub epoch: u64,
251    #[prost(uint64, tag = "2")]
252    pub hummock_version_id: u64,
253}
254#[derive(prost_helpers::AnyPB)]
255#[derive(Clone, Copy, PartialEq, ::prost::Message)]
256pub struct BatchQueryEpoch {
257    #[prost(oneof = "batch_query_epoch::Epoch", tags = "1, 2, 3, 4")]
258    pub epoch: ::core::option::Option<batch_query_epoch::Epoch>,
259}
260/// Nested message and enum types in `BatchQueryEpoch`.
261pub mod batch_query_epoch {
262    #[derive(prost_helpers::AnyPB)]
263    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
264    pub enum Epoch {
265        #[prost(message, tag = "1")]
266        Committed(super::BatchQueryCommittedEpoch),
267        #[prost(uint64, tag = "2")]
268        Current(u64),
269        #[prost(uint64, tag = "3")]
270        Backup(u64),
271        #[prost(uint64, tag = "4")]
272        TimeTravel(u64),
273    }
274}
275#[derive(prost_helpers::AnyPB)]
276#[derive(Eq, Hash)]
277#[derive(Clone, Copy, PartialEq, ::prost::Message)]
278pub struct OrderType {
279    #[prost(enumeration = "Direction", tag = "1")]
280    pub direction: i32,
281    #[prost(enumeration = "NullsAre", tag = "2")]
282    pub nulls_are: i32,
283}
284/// Column index with an order type (ASC or DESC). Used to represent a sort key (`repeated ColumnOrder`).
285#[derive(prost_helpers::AnyPB)]
286#[derive(Eq, Hash)]
287#[derive(Clone, Copy, PartialEq, ::prost::Message)]
288pub struct ColumnOrder {
289    #[prost(uint32, tag = "1")]
290    pub column_index: u32,
291    #[prost(message, optional, tag = "2")]
292    pub order_type: ::core::option::Option<OrderType>,
293}
294#[derive(prost_helpers::AnyPB)]
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct Uint32Vector {
297    #[prost(uint32, repeated, tag = "1")]
298    pub data: ::prost::alloc::vec::Vec<u32>,
299}
300#[derive(prost_helpers::AnyPB)]
301#[derive(Clone, Copy, PartialEq, ::prost::Message)]
302pub struct OptionalUint32 {
303    #[prost(uint32, optional, tag = "1")]
304    pub value: ::core::option::Option<u32>,
305}
306#[derive(prost_helpers::AnyPB)]
307#[derive(Clone, Copy, PartialEq, ::prost::Message)]
308pub struct OptionalUint64 {
309    #[prost(uint64, optional, tag = "1")]
310    pub value: ::core::option::Option<u64>,
311}
312#[derive(prost_helpers::AnyPB)]
313#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
314#[repr(i32)]
315pub enum WorkerType {
316    Unspecified = 0,
317    Frontend = 1,
318    ComputeNode = 2,
319    RiseCtl = 3,
320    Compactor = 4,
321    Meta = 5,
322}
323impl WorkerType {
324    /// String value of the enum field names used in the ProtoBuf definition.
325    ///
326    /// The values are not transformed in any way and thus are considered stable
327    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
328    pub fn as_str_name(&self) -> &'static str {
329        match self {
330            Self::Unspecified => "WORKER_TYPE_UNSPECIFIED",
331            Self::Frontend => "WORKER_TYPE_FRONTEND",
332            Self::ComputeNode => "WORKER_TYPE_COMPUTE_NODE",
333            Self::RiseCtl => "WORKER_TYPE_RISE_CTL",
334            Self::Compactor => "WORKER_TYPE_COMPACTOR",
335            Self::Meta => "WORKER_TYPE_META",
336        }
337    }
338    /// Creates an enum from field names used in the ProtoBuf definition.
339    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
340        match value {
341            "WORKER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
342            "WORKER_TYPE_FRONTEND" => Some(Self::Frontend),
343            "WORKER_TYPE_COMPUTE_NODE" => Some(Self::ComputeNode),
344            "WORKER_TYPE_RISE_CTL" => Some(Self::RiseCtl),
345            "WORKER_TYPE_COMPACTOR" => Some(Self::Compactor),
346            "WORKER_TYPE_META" => Some(Self::Meta),
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 Direction {
355    Unspecified = 0,
356    Ascending = 1,
357    Descending = 2,
358}
359impl Direction {
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 => "DIRECTION_UNSPECIFIED",
367            Self::Ascending => "DIRECTION_ASCENDING",
368            Self::Descending => "DIRECTION_DESCENDING",
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            "DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
375            "DIRECTION_ASCENDING" => Some(Self::Ascending),
376            "DIRECTION_DESCENDING" => Some(Self::Descending),
377            _ => None,
378        }
379    }
380}
381#[derive(prost_helpers::AnyPB)]
382#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
383#[repr(i32)]
384pub enum NullsAre {
385    Unspecified = 0,
386    Largest = 1,
387    Smallest = 2,
388}
389impl NullsAre {
390    /// String value of the enum field names used in the ProtoBuf definition.
391    ///
392    /// The values are not transformed in any way and thus are considered stable
393    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
394    pub fn as_str_name(&self) -> &'static str {
395        match self {
396            Self::Unspecified => "NULLS_ARE_UNSPECIFIED",
397            Self::Largest => "NULLS_ARE_LARGEST",
398            Self::Smallest => "NULLS_ARE_SMALLEST",
399        }
400    }
401    /// Creates an enum from field names used in the ProtoBuf definition.
402    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
403        match value {
404            "NULLS_ARE_UNSPECIFIED" => Some(Self::Unspecified),
405            "NULLS_ARE_LARGEST" => Some(Self::Largest),
406            "NULLS_ARE_SMALLEST" => Some(Self::Smallest),
407            _ => None,
408        }
409    }
410}
411#[derive(prost_helpers::AnyPB)]
412#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
413#[repr(i32)]
414pub enum ObjectType {
415    Unspecified = 0,
416    Database = 1,
417    Schema = 2,
418    Table = 3,
419    Mview = 4,
420    Source = 5,
421    Sink = 6,
422    View = 7,
423    Index = 8,
424    Function = 9,
425    Connection = 10,
426    Subscription = 11,
427    Secret = 12,
428}
429impl ObjectType {
430    /// String value of the enum field names used in the ProtoBuf definition.
431    ///
432    /// The values are not transformed in any way and thus are considered stable
433    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434    pub fn as_str_name(&self) -> &'static str {
435        match self {
436            Self::Unspecified => "UNSPECIFIED",
437            Self::Database => "DATABASE",
438            Self::Schema => "SCHEMA",
439            Self::Table => "TABLE",
440            Self::Mview => "MVIEW",
441            Self::Source => "SOURCE",
442            Self::Sink => "SINK",
443            Self::View => "VIEW",
444            Self::Index => "INDEX",
445            Self::Function => "FUNCTION",
446            Self::Connection => "CONNECTION",
447            Self::Subscription => "SUBSCRIPTION",
448            Self::Secret => "SECRET",
449        }
450    }
451    /// Creates an enum from field names used in the ProtoBuf definition.
452    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
453        match value {
454            "UNSPECIFIED" => Some(Self::Unspecified),
455            "DATABASE" => Some(Self::Database),
456            "SCHEMA" => Some(Self::Schema),
457            "TABLE" => Some(Self::Table),
458            "MVIEW" => Some(Self::Mview),
459            "SOURCE" => Some(Self::Source),
460            "SINK" => Some(Self::Sink),
461            "VIEW" => Some(Self::View),
462            "INDEX" => Some(Self::Index),
463            "FUNCTION" => Some(Self::Function),
464            "CONNECTION" => Some(Self::Connection),
465            "SUBSCRIPTION" => Some(Self::Subscription),
466            "SECRET" => Some(Self::Secret),
467            _ => None,
468        }
469    }
470}
471#[derive(prost_helpers::AnyPB)]
472#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
473#[repr(i32)]
474pub enum DistanceType {
475    Unspecified = 0,
476    L1 = 1,
477    L2Sqr = 2,
478    Cosine = 3,
479    InnerProduct = 4,
480}
481impl DistanceType {
482    /// String value of the enum field names used in the ProtoBuf definition.
483    ///
484    /// The values are not transformed in any way and thus are considered stable
485    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
486    pub fn as_str_name(&self) -> &'static str {
487        match self {
488            Self::Unspecified => "DISTANCE_TYPE_UNSPECIFIED",
489            Self::L1 => "DISTANCE_TYPE_L1",
490            Self::L2Sqr => "DISTANCE_TYPE_L2_SQR",
491            Self::Cosine => "DISTANCE_TYPE_COSINE",
492            Self::InnerProduct => "DISTANCE_TYPE_INNER_PRODUCT",
493        }
494    }
495    /// Creates an enum from field names used in the ProtoBuf definition.
496    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
497        match value {
498            "DISTANCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
499            "DISTANCE_TYPE_L1" => Some(Self::L1),
500            "DISTANCE_TYPE_L2_SQR" => Some(Self::L2Sqr),
501            "DISTANCE_TYPE_COSINE" => Some(Self::Cosine),
502            "DISTANCE_TYPE_INNER_PRODUCT" => Some(Self::InnerProduct),
503            _ => None,
504        }
505    }
506}