Skip to main content

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 PkIndexCompactionResult {
5    #[prost(message, optional, tag = "1")]
6    pub output_files: ::core::option::Option<super::connector_service::SinkMetadata>,
7    #[prost(string, repeated, tag = "2")]
8    pub input_file_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
9    #[prost(int64, tag = "3")]
10    pub read_snapshot_id: i64,
11}
12#[derive(prost_helpers::AnyPB)]
13#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
14pub struct SubscribeIcebergCompactionEventRequest {
15    #[prost(uint64, tag = "3")]
16    pub create_at: u64,
17    #[prost(
18        oneof = "subscribe_iceberg_compaction_event_request::Event",
19        tags = "1, 2, 4"
20    )]
21    pub event: ::core::option::Option<subscribe_iceberg_compaction_event_request::Event>,
22}
23/// Nested message and enum types in `SubscribeIcebergCompactionEventRequest`.
24pub mod subscribe_iceberg_compaction_event_request {
25    /// Register provides the context_id of the corresponding Compactor.
26    #[derive(prost_helpers::AnyPB)]
27    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
28    pub struct Register {
29        #[prost(uint32, tag = "1", wrapper = "crate::id::WorkerId")]
30        pub context_id: crate::id::WorkerId,
31    }
32    /// PullTask provides the number of tasks needed for the Compactor.
33    #[derive(prost_helpers::AnyPB)]
34    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
35    pub struct PullTask {
36        #[prost(uint32, tag = "1")]
37        pub pull_task_count: u32,
38    }
39    #[derive(prost_helpers::AnyPB)]
40    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
41    pub struct ReportTask {
42        #[prost(uint64, tag = "1", wrapper = "crate::id::IcebergCompactionTaskId")]
43        pub task_id: crate::id::IcebergCompactionTaskId,
44        #[prost(uint32, tag = "2", wrapper = "crate::id::SinkId")]
45        pub sink_id: crate::id::SinkId,
46        #[prost(enumeration = "report_task::Status", tag = "3")]
47        pub status: i32,
48        #[prost(string, optional, tag = "6")]
49        pub error_message: ::core::option::Option<::prost::alloc::string::String>,
50        /// Populated only for pk-index coordinated compaction tasks.
51        #[prost(message, optional, tag = "7")]
52        pub pk_index_result: ::core::option::Option<super::PkIndexCompactionResult>,
53    }
54    /// Nested message and enum types in `ReportTask`.
55    pub mod report_task {
56        #[derive(prost_helpers::AnyPB)]
57        #[derive(
58            Clone,
59            Copy,
60            Debug,
61            PartialEq,
62            Eq,
63            Hash,
64            PartialOrd,
65            Ord,
66            ::prost::Enumeration
67        )]
68        #[repr(i32)]
69        pub enum Status {
70            Unspecified = 0,
71            /// The dispatched task completed successfully. For a bounded automatic
72            /// round, this means progress; only DRAINED completes the round.
73            Success = 1,
74            Failed = 2,
75            /// A bounded planning attempt completed successfully and produced no plans.
76            Drained = 3,
77            /// Work exists but no complete group fits this worker's hard capacity.
78            BlockedCapacity = 4,
79            /// File statistics or planning prerequisites cannot prove a safe selection.
80            BlockedStatistics = 5,
81            /// This worker's pending queue is temporarily full, not an execution failure.
82            Busy = 6,
83        }
84        impl Status {
85            /// String value of the enum field names used in the ProtoBuf definition.
86            ///
87            /// The values are not transformed in any way and thus are considered stable
88            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
89            pub fn as_str_name(&self) -> &'static str {
90                match self {
91                    Self::Unspecified => "UNSPECIFIED",
92                    Self::Success => "SUCCESS",
93                    Self::Failed => "FAILED",
94                    Self::Drained => "DRAINED",
95                    Self::BlockedCapacity => "BLOCKED_CAPACITY",
96                    Self::BlockedStatistics => "BLOCKED_STATISTICS",
97                    Self::Busy => "BUSY",
98                }
99            }
100            /// Creates an enum from field names used in the ProtoBuf definition.
101            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
102                match value {
103                    "UNSPECIFIED" => Some(Self::Unspecified),
104                    "SUCCESS" => Some(Self::Success),
105                    "FAILED" => Some(Self::Failed),
106                    "DRAINED" => Some(Self::Drained),
107                    "BLOCKED_CAPACITY" => Some(Self::BlockedCapacity),
108                    "BLOCKED_STATISTICS" => Some(Self::BlockedStatistics),
109                    "BUSY" => Some(Self::Busy),
110                    _ => None,
111                }
112            }
113        }
114    }
115    #[derive(prost_helpers::AnyPB)]
116    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
117    pub enum Event {
118        /// Compactor will register its own context_id with Meta via Register and establish a bi-directional streaming rpc.
119        #[prost(message, tag = "1")]
120        Register(Register),
121        /// Compactor will recalculate the number of tasks needed locally after receiving the PullTaskAck and get the next batch of tasks from Meta via PullTask.
122        #[prost(message, tag = "2")]
123        PullTask(PullTask),
124        /// Compactor reports the final task result back to Meta after all plans in the task finish.
125        #[prost(message, tag = "4")]
126        ReportTask(ReportTask),
127    }
128}
129#[derive(prost_helpers::AnyPB)]
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct IcebergCompactionTask {
132    #[prost(uint64, tag = "1", wrapper = "crate::id::IcebergCompactionTaskId")]
133    pub task_id: crate::id::IcebergCompactionTaskId,
134    /// compactor will get the information of the iceberg table from the properties
135    #[prost(btree_map = "string, string", tag = "2")]
136    pub props: ::prost::alloc::collections::BTreeMap<
137        ::prost::alloc::string::String,
138        ::prost::alloc::string::String,
139    >,
140    #[prost(enumeration = "iceberg_compaction_task::TaskType", tag = "3")]
141    pub task_type: i32,
142    #[prost(uint32, tag = "4")]
143    pub sink_id: u32,
144    /// Whether this task should be routed through the meta-coordinated commit
145    /// path for iceberg pk-index sinks, the compactor performs the rewrite
146    /// without committing and reports the result back to meta instead.
147    #[prost(bool, tag = "5")]
148    pub pk_index_coordinated: bool,
149    /// Inclusive file sequence boundary shared by every task in an automatic compaction round.
150    #[prost(int64, optional, tag = "6")]
151    pub max_file_sequence_number: ::core::option::Option<i64>,
152}
153/// Nested message and enum types in `IcebergCompactionTask`.
154pub mod iceberg_compaction_task {
155    #[derive(prost_helpers::AnyPB)]
156    #[derive(
157        Clone,
158        Copy,
159        Debug,
160        PartialEq,
161        Eq,
162        Hash,
163        PartialOrd,
164        Ord,
165        ::prost::Enumeration
166    )]
167    #[repr(i32)]
168    pub enum TaskType {
169        Unspecified = 0,
170        /// Full compaction task.
171        Full = 1,
172        /// Small data file compaction task.
173        SmallFiles = 2,
174        FilesWithDelete = 3,
175        /// Select a localized compaction strategy from the current snapshot.
176        Auto = 4,
177    }
178    impl TaskType {
179        /// String value of the enum field names used in the ProtoBuf definition.
180        ///
181        /// The values are not transformed in any way and thus are considered stable
182        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
183        pub fn as_str_name(&self) -> &'static str {
184            match self {
185                Self::Unspecified => "UNSPECIFIED",
186                Self::Full => "FULL",
187                Self::SmallFiles => "SMALL_FILES",
188                Self::FilesWithDelete => "FILES_WITH_DELETE",
189                Self::Auto => "AUTO",
190            }
191        }
192        /// Creates an enum from field names used in the ProtoBuf definition.
193        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
194            match value {
195                "UNSPECIFIED" => Some(Self::Unspecified),
196                "FULL" => Some(Self::Full),
197                "SMALL_FILES" => Some(Self::SmallFiles),
198                "FILES_WITH_DELETE" => Some(Self::FilesWithDelete),
199                "AUTO" => Some(Self::Auto),
200                _ => None,
201            }
202        }
203    }
204}
205#[derive(prost_helpers::AnyPB)]
206#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
207pub struct CancelCompactTask {
208    #[prost(uint64, tag = "1", wrapper = "crate::id::IcebergCompactionTaskId")]
209    pub task_id: crate::id::IcebergCompactionTaskId,
210}
211#[derive(prost_helpers::AnyPB)]
212#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct SubscribeIcebergCompactionEventResponse {
214    #[prost(uint64, tag = "7")]
215    pub create_at: u64,
216    #[prost(
217        oneof = "subscribe_iceberg_compaction_event_response::Event",
218        tags = "1, 2, 3"
219    )]
220    pub event: ::core::option::Option<
221        subscribe_iceberg_compaction_event_response::Event,
222    >,
223}
224/// Nested message and enum types in `SubscribeIcebergCompactionEventResponse`.
225pub mod subscribe_iceberg_compaction_event_response {
226    /// PullTaskAck is a response, the meta will return a PullTaskAck after distributing the task requested by the PullTask.
227    /// The Compactor receives the PullTaskAck and remakes its state and tries to initiate the next PullTask.
228    #[derive(prost_helpers::AnyPB)]
229    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
230    pub struct PullTaskAck {}
231    #[derive(prost_helpers::AnyPB)]
232    #[derive(Clone, PartialEq, ::prost::Oneof)]
233    pub enum Event {
234        #[prost(message, tag = "1")]
235        CompactTask(super::IcebergCompactionTask),
236        #[prost(message, tag = "2")]
237        PullTaskAck(PullTaskAck),
238        #[prost(message, tag = "3")]
239        CancelCompactTask(super::CancelCompactTask),
240    }
241}