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