risingwave_pb/
iceberg_compaction.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct SubscribeIcebergCompactionEventRequest {
5    #[prost(uint64, tag = "3")]
6    pub create_at: u64,
7    #[prost(
8        oneof = "subscribe_iceberg_compaction_event_request::Event",
9        tags = "1, 2, 4"
10    )]
11    pub event: ::core::option::Option<subscribe_iceberg_compaction_event_request::Event>,
12}
13/// Nested message and enum types in `SubscribeIcebergCompactionEventRequest`.
14pub mod subscribe_iceberg_compaction_event_request {
15    /// Register provides the context_id of the corresponding Compactor.
16    #[derive(prost_helpers::AnyPB)]
17    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
18    pub struct Register {
19        #[prost(uint32, tag = "1", wrapper = "crate::id::WorkerId")]
20        pub context_id: crate::id::WorkerId,
21    }
22    /// PullTask provides the number of tasks needed for the Compactor.
23    #[derive(prost_helpers::AnyPB)]
24    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
25    pub struct PullTask {
26        #[prost(uint32, tag = "1")]
27        pub pull_task_count: u32,
28    }
29    #[derive(prost_helpers::AnyPB)]
30    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
31    pub struct ReportTask {
32        #[prost(uint64, tag = "1")]
33        pub task_id: u64,
34        #[prost(uint32, tag = "2")]
35        pub sink_id: u32,
36        #[prost(enumeration = "report_task::Status", tag = "3")]
37        pub status: i32,
38        #[prost(string, optional, tag = "6")]
39        pub error_message: ::core::option::Option<::prost::alloc::string::String>,
40    }
41    /// Nested message and enum types in `ReportTask`.
42    pub mod report_task {
43        #[derive(prost_helpers::AnyPB)]
44        #[derive(
45            Clone,
46            Copy,
47            Debug,
48            PartialEq,
49            Eq,
50            Hash,
51            PartialOrd,
52            Ord,
53            ::prost::Enumeration
54        )]
55        #[repr(i32)]
56        pub enum Status {
57            Unspecified = 0,
58            Success = 1,
59            Failed = 2,
60        }
61        impl Status {
62            /// String value of the enum field names used in the ProtoBuf definition.
63            ///
64            /// The values are not transformed in any way and thus are considered stable
65            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
66            pub fn as_str_name(&self) -> &'static str {
67                match self {
68                    Self::Unspecified => "UNSPECIFIED",
69                    Self::Success => "SUCCESS",
70                    Self::Failed => "FAILED",
71                }
72            }
73            /// Creates an enum from field names used in the ProtoBuf definition.
74            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
75                match value {
76                    "UNSPECIFIED" => Some(Self::Unspecified),
77                    "SUCCESS" => Some(Self::Success),
78                    "FAILED" => Some(Self::Failed),
79                    _ => None,
80                }
81            }
82        }
83    }
84    #[derive(prost_helpers::AnyPB)]
85    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
86    pub enum Event {
87        /// Compactor will register its own context_id with Meta via Register and establish a bi-directional streaming rpc.
88        #[prost(message, tag = "1")]
89        Register(Register),
90        /// Compactor will recalculate the number of tasks needed locally after receiving the PullTaskAck and get the next batch of tasks from Meta via PullTask.
91        #[prost(message, tag = "2")]
92        PullTask(PullTask),
93        /// Compactor reports the final task result back to Meta after all plans in the task finish.
94        #[prost(message, tag = "4")]
95        ReportTask(ReportTask),
96    }
97}
98#[derive(prost_helpers::AnyPB)]
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct IcebergCompactionTask {
101    #[prost(uint64, tag = "1")]
102    pub task_id: u64,
103    /// Now we only support iceberg table full compaction.
104    /// compactor will get the information of the iceberg table from the properties
105    #[prost(btree_map = "string, string", tag = "2")]
106    pub props: ::prost::alloc::collections::BTreeMap<
107        ::prost::alloc::string::String,
108        ::prost::alloc::string::String,
109    >,
110    #[prost(enumeration = "iceberg_compaction_task::TaskType", tag = "3")]
111    pub task_type: i32,
112    #[prost(uint32, tag = "4")]
113    pub sink_id: u32,
114}
115/// Nested message and enum types in `IcebergCompactionTask`.
116pub mod iceberg_compaction_task {
117    #[derive(prost_helpers::AnyPB)]
118    #[derive(
119        Clone,
120        Copy,
121        Debug,
122        PartialEq,
123        Eq,
124        Hash,
125        PartialOrd,
126        Ord,
127        ::prost::Enumeration
128    )]
129    #[repr(i32)]
130    pub enum TaskType {
131        Unspecified = 0,
132        /// Full compaction task.
133        Full = 1,
134        /// Small data file compaction task.
135        SmallFiles = 2,
136        FilesWithDelete = 3,
137    }
138    impl TaskType {
139        /// String value of the enum field names used in the ProtoBuf definition.
140        ///
141        /// The values are not transformed in any way and thus are considered stable
142        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
143        pub fn as_str_name(&self) -> &'static str {
144            match self {
145                Self::Unspecified => "UNSPECIFIED",
146                Self::Full => "FULL",
147                Self::SmallFiles => "SMALL_FILES",
148                Self::FilesWithDelete => "FILES_WITH_DELETE",
149            }
150        }
151        /// Creates an enum from field names used in the ProtoBuf definition.
152        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
153            match value {
154                "UNSPECIFIED" => Some(Self::Unspecified),
155                "FULL" => Some(Self::Full),
156                "SMALL_FILES" => Some(Self::SmallFiles),
157                "FILES_WITH_DELETE" => Some(Self::FilesWithDelete),
158                _ => None,
159            }
160        }
161    }
162}
163#[derive(prost_helpers::AnyPB)]
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct SubscribeIcebergCompactionEventResponse {
166    #[prost(uint64, tag = "7")]
167    pub create_at: u64,
168    #[prost(oneof = "subscribe_iceberg_compaction_event_response::Event", tags = "1, 2")]
169    pub event: ::core::option::Option<
170        subscribe_iceberg_compaction_event_response::Event,
171    >,
172}
173/// Nested message and enum types in `SubscribeIcebergCompactionEventResponse`.
174pub mod subscribe_iceberg_compaction_event_response {
175    /// PullTaskAck is a response, the meta will return a PullTaskAck after distributing the task requested by the PullTask.
176    /// The Compactor receives the PullTaskAck and remakes its state and tries to initiate the next PullTask.
177    #[derive(prost_helpers::AnyPB)]
178    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
179    pub struct PullTaskAck {}
180    #[derive(prost_helpers::AnyPB)]
181    #[derive(Clone, PartialEq, ::prost::Oneof)]
182    pub enum Event {
183        #[prost(message, tag = "1")]
184        CompactTask(super::IcebergCompactionTask),
185        #[prost(message, tag = "2")]
186        PullTaskAck(PullTaskAck),
187    }
188}