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