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")]
45        pub sink_id: u32,
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        }
78        impl Status {
79            /// String value of the enum field names used in the ProtoBuf definition.
80            ///
81            /// The values are not transformed in any way and thus are considered stable
82            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
83            pub fn as_str_name(&self) -> &'static str {
84                match self {
85                    Self::Unspecified => "UNSPECIFIED",
86                    Self::Success => "SUCCESS",
87                    Self::Failed => "FAILED",
88                    Self::Drained => "DRAINED",
89                }
90            }
91            /// Creates an enum from field names used in the ProtoBuf definition.
92            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
93                match value {
94                    "UNSPECIFIED" => Some(Self::Unspecified),
95                    "SUCCESS" => Some(Self::Success),
96                    "FAILED" => Some(Self::Failed),
97                    "DRAINED" => Some(Self::Drained),
98                    _ => None,
99                }
100            }
101        }
102    }
103    #[derive(prost_helpers::AnyPB)]
104    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
105    pub enum Event {
106        /// Compactor will register its own context_id with Meta via Register and establish a bi-directional streaming rpc.
107        #[prost(message, tag = "1")]
108        Register(Register),
109        /// Compactor will recalculate the number of tasks needed locally after receiving the PullTaskAck and get the next batch of tasks from Meta via PullTask.
110        #[prost(message, tag = "2")]
111        PullTask(PullTask),
112        /// Compactor reports the final task result back to Meta after all plans in the task finish.
113        #[prost(message, tag = "4")]
114        ReportTask(ReportTask),
115    }
116}
117#[derive(prost_helpers::AnyPB)]
118#[derive(Clone, PartialEq, ::prost::Message)]
119pub struct IcebergCompactionTask {
120    #[prost(uint64, tag = "1", wrapper = "crate::id::IcebergCompactionTaskId")]
121    pub task_id: crate::id::IcebergCompactionTaskId,
122    /// compactor will get the information of the iceberg table from the properties
123    #[prost(btree_map = "string, string", tag = "2")]
124    pub props: ::prost::alloc::collections::BTreeMap<
125        ::prost::alloc::string::String,
126        ::prost::alloc::string::String,
127    >,
128    #[prost(enumeration = "iceberg_compaction_task::TaskType", tag = "3")]
129    pub task_type: i32,
130    #[prost(uint32, tag = "4")]
131    pub sink_id: u32,
132    /// Whether this task should be routed through the meta-coordinated commit
133    /// path for iceberg pk-index sinks, the compactor performs the rewrite
134    /// without committing and reports the result back to meta instead.
135    #[prost(bool, tag = "5")]
136    pub pk_index_coordinated: bool,
137    /// Inclusive file sequence boundary shared by every task in an automatic compaction round.
138    #[prost(int64, optional, tag = "6")]
139    pub max_file_sequence_number: ::core::option::Option<i64>,
140}
141/// Nested message and enum types in `IcebergCompactionTask`.
142pub mod iceberg_compaction_task {
143    #[derive(prost_helpers::AnyPB)]
144    #[derive(
145        Clone,
146        Copy,
147        Debug,
148        PartialEq,
149        Eq,
150        Hash,
151        PartialOrd,
152        Ord,
153        ::prost::Enumeration
154    )]
155    #[repr(i32)]
156    pub enum TaskType {
157        Unspecified = 0,
158        /// Full compaction task.
159        Full = 1,
160        /// Small data file compaction task.
161        SmallFiles = 2,
162        FilesWithDelete = 3,
163        /// Select a localized compaction strategy from the current snapshot.
164        Auto = 4,
165    }
166    impl TaskType {
167        /// String value of the enum field names used in the ProtoBuf definition.
168        ///
169        /// The values are not transformed in any way and thus are considered stable
170        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
171        pub fn as_str_name(&self) -> &'static str {
172            match self {
173                Self::Unspecified => "UNSPECIFIED",
174                Self::Full => "FULL",
175                Self::SmallFiles => "SMALL_FILES",
176                Self::FilesWithDelete => "FILES_WITH_DELETE",
177                Self::Auto => "AUTO",
178            }
179        }
180        /// Creates an enum from field names used in the ProtoBuf definition.
181        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
182            match value {
183                "UNSPECIFIED" => Some(Self::Unspecified),
184                "FULL" => Some(Self::Full),
185                "SMALL_FILES" => Some(Self::SmallFiles),
186                "FILES_WITH_DELETE" => Some(Self::FilesWithDelete),
187                "AUTO" => Some(Self::Auto),
188                _ => None,
189            }
190        }
191    }
192}
193#[derive(prost_helpers::AnyPB)]
194#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
195pub struct CancelCompactTask {
196    #[prost(uint64, tag = "1", wrapper = "crate::id::IcebergCompactionTaskId")]
197    pub task_id: crate::id::IcebergCompactionTaskId,
198}
199#[derive(prost_helpers::AnyPB)]
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct SubscribeIcebergCompactionEventResponse {
202    #[prost(uint64, tag = "7")]
203    pub create_at: u64,
204    #[prost(
205        oneof = "subscribe_iceberg_compaction_event_response::Event",
206        tags = "1, 2, 3"
207    )]
208    pub event: ::core::option::Option<
209        subscribe_iceberg_compaction_event_response::Event,
210    >,
211}
212/// Nested message and enum types in `SubscribeIcebergCompactionEventResponse`.
213pub mod subscribe_iceberg_compaction_event_response {
214    /// PullTaskAck is a response, the meta will return a PullTaskAck after distributing the task requested by the PullTask.
215    /// The Compactor receives the PullTaskAck and remakes its state and tries to initiate the next PullTask.
216    #[derive(prost_helpers::AnyPB)]
217    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
218    pub struct PullTaskAck {}
219    #[derive(prost_helpers::AnyPB)]
220    #[derive(Clone, PartialEq, ::prost::Oneof)]
221    pub enum Event {
222        #[prost(message, tag = "1")]
223        CompactTask(super::IcebergCompactionTask),
224        #[prost(message, tag = "2")]
225        PullTaskAck(PullTaskAck),
226        #[prost(message, tag = "3")]
227        CancelCompactTask(super::CancelCompactTask),
228    }
229}