Skip to main content

risingwave_pb/
common.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, Eq, Hash, ::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, Eq, Hash, ::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, Eq, Hash, ::prost::Message)]
64pub struct ActorInfo {
65    #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
66    pub actor_id: crate::id::ActorId,
67    #[prost(message, optional, tag = "2")]
68    pub host: ::core::option::Option<HostAddress>,
69    #[prost(uint64, tag = "3", wrapper = "crate::id::PartialGraphId")]
70    pub partial_graph_id: crate::id::PartialGraphId,
71}
72/// renamed from `ParallelUnit`
73#[derive(prost_helpers::AnyPB)]
74#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
75pub struct ActorLocation {
76    #[prost(uint32, tag = "2", wrapper = "crate::id::WorkerId")]
77    pub worker_node_id: crate::id::WorkerId,
78}
79#[derive(prost_helpers::AnyPB)]
80#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
81pub struct WorkerNode {
82    #[prost(uint32, tag = "1", wrapper = "crate::id::WorkerId")]
83    pub id: crate::id::WorkerId,
84    #[prost(enumeration = "WorkerType", tag = "2")]
85    pub r#type: i32,
86    #[prost(message, optional, tag = "3")]
87    pub host: ::core::option::Option<HostAddress>,
88    #[prost(enumeration = "worker_node::State", tag = "4")]
89    pub state: i32,
90    #[prost(message, optional, tag = "6")]
91    pub property: ::core::option::Option<worker_node::Property>,
92    /// Ranges from 0 to 1023, used to generate the machine ID field in the global unique ID.
93    #[prost(uint32, optional, tag = "7")]
94    pub transactional_id: ::core::option::Option<u32>,
95    /// Resource spec.
96    /// It's populated by meta node with the value reported by worker node and persisted in meta store.
97    #[prost(message, optional, tag = "8")]
98    pub resource: ::core::option::Option<worker_node::Resource>,
99    /// Timestamp the worker node is added by meta node, in seconds.
100    /// It's populated by meta node, when the worker node is added by meta node.
101    /// It's persisted in meta store.
102    #[prost(uint64, optional, tag = "9")]
103    pub started_at: ::core::option::Option<u64>,
104}
105/// Nested message and enum types in `WorkerNode`.
106pub mod worker_node {
107    /// Fields in `Property` that doesn't fit current worker type are just ignored by receiver.
108    #[derive(prost_helpers::AnyPB)]
109    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
110    pub struct Property {
111        #[prost(bool, tag = "1")]
112        pub is_streaming: bool,
113        #[prost(bool, tag = "2")]
114        pub is_serving: bool,
115        /// This is used for frontend node to register its rpc address
116        #[prost(string, tag = "4")]
117        pub internal_rpc_host_addr: ::prost::alloc::string::String,
118        #[prost(uint32, tag = "6")]
119        pub parallelism: u32,
120        /// resource group for scheduling
121        #[prost(string, optional, tag = "7")]
122        pub resource_group: ::core::option::Option<::prost::alloc::string::String>,
123        /// Whether this is an iceberg compactor (only applicable for Compactor worker type)
124        #[prost(bool, tag = "8")]
125        pub is_iceberg_compactor: bool,
126    }
127    #[derive(prost_helpers::AnyPB)]
128    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
129    pub struct Resource {
130        #[prost(string, tag = "1")]
131        pub rw_version: ::prost::alloc::string::String,
132        #[prost(uint64, tag = "2")]
133        pub total_memory_bytes: u64,
134        #[prost(uint64, tag = "3")]
135        pub total_cpu_cores: u64,
136        /// The host name reported by `gethostname()`.
137        /// Not to be confused with `host` field in `WorkerNode`.
138        #[prost(string, tag = "4")]
139        pub hostname: ::prost::alloc::string::String,
140    }
141    #[derive(prost_helpers::AnyPB)]
142    #[derive(
143        Clone,
144        Copy,
145        Debug,
146        PartialEq,
147        Eq,
148        Hash,
149        PartialOrd,
150        Ord,
151        ::prost::Enumeration
152    )]
153    #[repr(i32)]
154    pub enum State {
155        Unspecified = 0,
156        Starting = 1,
157        Running = 2,
158    }
159    impl State {
160        /// String value of the enum field names used in the ProtoBuf definition.
161        ///
162        /// The values are not transformed in any way and thus are considered stable
163        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
164        pub fn as_str_name(&self) -> &'static str {
165            match self {
166                Self::Unspecified => "UNSPECIFIED",
167                Self::Starting => "STARTING",
168                Self::Running => "RUNNING",
169            }
170        }
171        /// Creates an enum from field names used in the ProtoBuf definition.
172        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
173            match value {
174                "UNSPECIFIED" => Some(Self::Unspecified),
175                "STARTING" => Some(Self::Starting),
176                "RUNNING" => Some(Self::Running),
177                _ => None,
178            }
179        }
180    }
181}
182#[derive(prost_helpers::AnyPB)]
183#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
184pub struct ClusterResource {
185    #[prost(uint64, tag = "1")]
186    pub total_memory_bytes: u64,
187    #[prost(uint64, tag = "2")]
188    pub total_cpu_cores: u64,
189}
190#[derive(prost_helpers::AnyPB)]
191#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
192pub struct Buffer {
193    #[prost(enumeration = "buffer::CompressionType", tag = "1")]
194    pub compression: i32,
195    #[prost(bytes = "vec", tag = "2")]
196    pub body: ::prost::alloc::vec::Vec<u8>,
197}
198/// Nested message and enum types in `Buffer`.
199pub mod buffer {
200    #[derive(prost_helpers::AnyPB)]
201    #[derive(
202        Clone,
203        Copy,
204        Debug,
205        PartialEq,
206        Eq,
207        Hash,
208        PartialOrd,
209        Ord,
210        ::prost::Enumeration
211    )]
212    #[repr(i32)]
213    pub enum CompressionType {
214        Unspecified = 0,
215        None = 1,
216    }
217    impl CompressionType {
218        /// String value of the enum field names used in the ProtoBuf definition.
219        ///
220        /// The values are not transformed in any way and thus are considered stable
221        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
222        pub fn as_str_name(&self) -> &'static str {
223            match self {
224                Self::Unspecified => "UNSPECIFIED",
225                Self::None => "NONE",
226            }
227        }
228        /// Creates an enum from field names used in the ProtoBuf definition.
229        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
230            match value {
231                "UNSPECIFIED" => Some(Self::Unspecified),
232                "NONE" => Some(Self::None),
233                _ => None,
234            }
235        }
236    }
237}
238/// Vnode mapping for stream fragments. Stores mapping from virtual node to (worker id, slot index).
239#[derive(prost_helpers::AnyPB)]
240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
241pub struct WorkerSlotMapping {
242    #[prost(uint32, repeated, tag = "1")]
243    pub original_indices: ::prost::alloc::vec::Vec<u32>,
244    #[prost(uint64, repeated, tag = "2")]
245    pub data: ::prost::alloc::vec::Vec<u64>,
246}
247#[derive(prost_helpers::AnyPB)]
248#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
249pub struct BatchQueryCommittedEpoch {
250    #[prost(uint64, tag = "1")]
251    pub epoch: u64,
252    #[prost(uint64, tag = "2", wrapper = "crate::id::HummockVersionId")]
253    pub hummock_version_id: crate::id::HummockVersionId,
254}
255/// Resolve the committed epoch from the serving node at storage snapshot creation.
256#[derive(prost_helpers::AnyPB)]
257#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
258pub struct BatchQueryLatestCommittedEpoch {
259    /// Wait for table registration only while the serving node is behind this version.
260    #[prost(uint64, tag = "1", wrapper = "crate::id::HummockVersionId")]
261    pub hummock_version_id: crate::id::HummockVersionId,
262}
263#[derive(prost_helpers::AnyPB)]
264#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
265pub struct BatchQueryEpoch {
266    #[prost(oneof = "batch_query_epoch::Epoch", tags = "1, 2, 3, 4, 5")]
267    pub epoch: ::core::option::Option<batch_query_epoch::Epoch>,
268}
269/// Nested message and enum types in `BatchQueryEpoch`.
270pub mod batch_query_epoch {
271    #[derive(prost_helpers::AnyPB)]
272    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
273    pub enum Epoch {
274        #[prost(message, tag = "1")]
275        Committed(super::BatchQueryCommittedEpoch),
276        #[prost(uint64, tag = "2")]
277        Current(u64),
278        #[prost(uint64, tag = "3")]
279        Backup(u64),
280        #[prost(uint64, tag = "4")]
281        TimeTravel(u64),
282        #[prost(message, tag = "5")]
283        LatestCommitted(super::BatchQueryLatestCommittedEpoch),
284    }
285}
286#[derive(prost_helpers::AnyPB)]
287#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
288pub struct OrderType {
289    #[prost(enumeration = "Direction", tag = "1")]
290    pub direction: i32,
291    #[prost(enumeration = "NullsAre", tag = "2")]
292    pub nulls_are: i32,
293}
294/// Column index with an order type (ASC or DESC). Used to represent a sort key (`repeated ColumnOrder`).
295#[derive(prost_helpers::AnyPB)]
296#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
297pub struct ColumnOrder {
298    #[prost(uint32, tag = "1")]
299    pub column_index: u32,
300    #[prost(message, optional, tag = "2")]
301    pub order_type: ::core::option::Option<OrderType>,
302}
303#[derive(prost_helpers::AnyPB)]
304#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
305pub struct Uint32Vector {
306    #[prost(uint32, repeated, tag = "1")]
307    pub data: ::prost::alloc::vec::Vec<u32>,
308}
309#[derive(prost_helpers::AnyPB)]
310#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
311pub struct OptionalUint32 {
312    #[prost(uint32, optional, tag = "1")]
313    pub value: ::core::option::Option<u32>,
314}
315#[derive(prost_helpers::AnyPB)]
316#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
317pub struct OptionalUint64 {
318    #[prost(uint64, optional, tag = "1")]
319    pub value: ::core::option::Option<u64>,
320}
321#[derive(prost_helpers::AnyPB)]
322#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
323#[repr(i32)]
324pub enum WorkerType {
325    Unspecified = 0,
326    Frontend = 1,
327    ComputeNode = 2,
328    RiseCtl = 3,
329    Compactor = 4,
330    Meta = 5,
331}
332impl WorkerType {
333    /// String value of the enum field names used in the ProtoBuf definition.
334    ///
335    /// The values are not transformed in any way and thus are considered stable
336    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
337    pub fn as_str_name(&self) -> &'static str {
338        match self {
339            Self::Unspecified => "WORKER_TYPE_UNSPECIFIED",
340            Self::Frontend => "WORKER_TYPE_FRONTEND",
341            Self::ComputeNode => "WORKER_TYPE_COMPUTE_NODE",
342            Self::RiseCtl => "WORKER_TYPE_RISE_CTL",
343            Self::Compactor => "WORKER_TYPE_COMPACTOR",
344            Self::Meta => "WORKER_TYPE_META",
345        }
346    }
347    /// Creates an enum from field names used in the ProtoBuf definition.
348    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
349        match value {
350            "WORKER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
351            "WORKER_TYPE_FRONTEND" => Some(Self::Frontend),
352            "WORKER_TYPE_COMPUTE_NODE" => Some(Self::ComputeNode),
353            "WORKER_TYPE_RISE_CTL" => Some(Self::RiseCtl),
354            "WORKER_TYPE_COMPACTOR" => Some(Self::Compactor),
355            "WORKER_TYPE_META" => Some(Self::Meta),
356            _ => None,
357        }
358    }
359}
360#[derive(prost_helpers::AnyPB)]
361#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
362#[repr(i32)]
363pub enum Direction {
364    Unspecified = 0,
365    Ascending = 1,
366    Descending = 2,
367}
368impl Direction {
369    /// String value of the enum field names used in the ProtoBuf definition.
370    ///
371    /// The values are not transformed in any way and thus are considered stable
372    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
373    pub fn as_str_name(&self) -> &'static str {
374        match self {
375            Self::Unspecified => "DIRECTION_UNSPECIFIED",
376            Self::Ascending => "DIRECTION_ASCENDING",
377            Self::Descending => "DIRECTION_DESCENDING",
378        }
379    }
380    /// Creates an enum from field names used in the ProtoBuf definition.
381    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
382        match value {
383            "DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
384            "DIRECTION_ASCENDING" => Some(Self::Ascending),
385            "DIRECTION_DESCENDING" => Some(Self::Descending),
386            _ => None,
387        }
388    }
389}
390#[derive(prost_helpers::AnyPB)]
391#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
392#[repr(i32)]
393pub enum NullsAre {
394    Unspecified = 0,
395    Largest = 1,
396    Smallest = 2,
397}
398impl NullsAre {
399    /// String value of the enum field names used in the ProtoBuf definition.
400    ///
401    /// The values are not transformed in any way and thus are considered stable
402    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
403    pub fn as_str_name(&self) -> &'static str {
404        match self {
405            Self::Unspecified => "NULLS_ARE_UNSPECIFIED",
406            Self::Largest => "NULLS_ARE_LARGEST",
407            Self::Smallest => "NULLS_ARE_SMALLEST",
408        }
409    }
410    /// Creates an enum from field names used in the ProtoBuf definition.
411    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
412        match value {
413            "NULLS_ARE_UNSPECIFIED" => Some(Self::Unspecified),
414            "NULLS_ARE_LARGEST" => Some(Self::Largest),
415            "NULLS_ARE_SMALLEST" => Some(Self::Smallest),
416            _ => None,
417        }
418    }
419}
420#[derive(prost_helpers::AnyPB)]
421#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
422#[repr(i32)]
423pub enum ObjectType {
424    Unspecified = 0,
425    Database = 1,
426    Schema = 2,
427    Table = 3,
428    Mview = 4,
429    Source = 5,
430    Sink = 6,
431    View = 7,
432    Index = 8,
433    Function = 9,
434    Connection = 10,
435    Subscription = 11,
436    Secret = 12,
437}
438impl ObjectType {
439    /// String value of the enum field names used in the ProtoBuf definition.
440    ///
441    /// The values are not transformed in any way and thus are considered stable
442    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
443    pub fn as_str_name(&self) -> &'static str {
444        match self {
445            Self::Unspecified => "UNSPECIFIED",
446            Self::Database => "DATABASE",
447            Self::Schema => "SCHEMA",
448            Self::Table => "TABLE",
449            Self::Mview => "MVIEW",
450            Self::Source => "SOURCE",
451            Self::Sink => "SINK",
452            Self::View => "VIEW",
453            Self::Index => "INDEX",
454            Self::Function => "FUNCTION",
455            Self::Connection => "CONNECTION",
456            Self::Subscription => "SUBSCRIPTION",
457            Self::Secret => "SECRET",
458        }
459    }
460    /// Creates an enum from field names used in the ProtoBuf definition.
461    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
462        match value {
463            "UNSPECIFIED" => Some(Self::Unspecified),
464            "DATABASE" => Some(Self::Database),
465            "SCHEMA" => Some(Self::Schema),
466            "TABLE" => Some(Self::Table),
467            "MVIEW" => Some(Self::Mview),
468            "SOURCE" => Some(Self::Source),
469            "SINK" => Some(Self::Sink),
470            "VIEW" => Some(Self::View),
471            "INDEX" => Some(Self::Index),
472            "FUNCTION" => Some(Self::Function),
473            "CONNECTION" => Some(Self::Connection),
474            "SUBSCRIPTION" => Some(Self::Subscription),
475            "SECRET" => Some(Self::Secret),
476            _ => None,
477        }
478    }
479}
480#[derive(prost_helpers::AnyPB)]
481#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
482#[repr(i32)]
483pub enum DistanceType {
484    Unspecified = 0,
485    L1 = 1,
486    L2Sqr = 2,
487    Cosine = 3,
488    InnerProduct = 4,
489}
490impl DistanceType {
491    /// String value of the enum field names used in the ProtoBuf definition.
492    ///
493    /// The values are not transformed in any way and thus are considered stable
494    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
495    pub fn as_str_name(&self) -> &'static str {
496        match self {
497            Self::Unspecified => "DISTANCE_TYPE_UNSPECIFIED",
498            Self::L1 => "DISTANCE_TYPE_L1",
499            Self::L2Sqr => "DISTANCE_TYPE_L2_SQR",
500            Self::Cosine => "DISTANCE_TYPE_COSINE",
501            Self::InnerProduct => "DISTANCE_TYPE_INNER_PRODUCT",
502        }
503    }
504    /// Creates an enum from field names used in the ProtoBuf definition.
505    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
506        match value {
507            "DISTANCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
508            "DISTANCE_TYPE_L1" => Some(Self::L1),
509            "DISTANCE_TYPE_L2_SQR" => Some(Self::L2Sqr),
510            "DISTANCE_TYPE_COSINE" => Some(Self::Cosine),
511            "DISTANCE_TYPE_INNER_PRODUCT" => Some(Self::InnerProduct),
512            _ => None,
513        }
514    }
515}
516#[derive(prost_helpers::AnyPB)]
517#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
518#[repr(i32)]
519pub enum ThrottleType {
520    Unspecified = 0,
521    Dml = 1,
522    Backfill = 2,
523    Source = 3,
524    Sink = 4,
525}
526impl ThrottleType {
527    /// String value of the enum field names used in the ProtoBuf definition.
528    ///
529    /// The values are not transformed in any way and thus are considered stable
530    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
531    pub fn as_str_name(&self) -> &'static str {
532        match self {
533            Self::Unspecified => "THROTTLE_TYPE_UNSPECIFIED",
534            Self::Dml => "THROTTLE_TYPE_DML",
535            Self::Backfill => "THROTTLE_TYPE_BACKFILL",
536            Self::Source => "THROTTLE_TYPE_SOURCE",
537            Self::Sink => "THROTTLE_TYPE_SINK",
538        }
539    }
540    /// Creates an enum from field names used in the ProtoBuf definition.
541    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
542        match value {
543            "THROTTLE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
544            "THROTTLE_TYPE_DML" => Some(Self::Dml),
545            "THROTTLE_TYPE_BACKFILL" => Some(Self::Backfill),
546            "THROTTLE_TYPE_SOURCE" => Some(Self::Source),
547            "THROTTLE_TYPE_SINK" => Some(Self::Sink),
548            _ => None,
549        }
550    }
551}