risingwave_pb/
iceberg_compaction.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct SubscribeIcebergCompactionEventRequest {
5    #[prost(uint64, tag = "3")]
6    pub create_at: u64,
7    #[prost(oneof = "subscribe_iceberg_compaction_event_request::Event", tags = "1, 2")]
8    pub event: ::core::option::Option<subscribe_iceberg_compaction_event_request::Event>,
9}
10/// Nested message and enum types in `SubscribeIcebergCompactionEventRequest`.
11pub mod subscribe_iceberg_compaction_event_request {
12    /// Register provides the context_id of the corresponding Compactor.
13    #[derive(prost_helpers::AnyPB)]
14    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
15    pub struct Register {
16        #[prost(uint32, tag = "1", wrapper = "crate::id::WorkerId")]
17        pub context_id: crate::id::WorkerId,
18    }
19    /// PullTask provides the number of tasks needed for the Compactor.
20    #[derive(prost_helpers::AnyPB)]
21    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
22    pub struct PullTask {
23        #[prost(uint32, tag = "1")]
24        pub pull_task_count: u32,
25    }
26    #[derive(prost_helpers::AnyPB)]
27    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
28    pub enum Event {
29        /// Compactor will register its own context_id with Meta via Register and establish a bi-directional streaming rpc.
30        #[prost(message, tag = "1")]
31        Register(Register),
32        /// Compactor will recalculate the number of tasks needed locally after receiving the PullTaskAck and get the next batch of tasks from Meta via PullTask.
33        #[prost(message, tag = "2")]
34        PullTask(PullTask),
35    }
36}
37#[derive(prost_helpers::AnyPB)]
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct IcebergCompactionTask {
40    #[prost(uint64, tag = "1")]
41    pub task_id: u64,
42    /// Now we only support iceberg table full compaction.
43    /// compactor will get the information of the iceberg table from the properties
44    #[prost(btree_map = "string, string", tag = "2")]
45    pub props: ::prost::alloc::collections::BTreeMap<
46        ::prost::alloc::string::String,
47        ::prost::alloc::string::String,
48    >,
49    #[prost(enumeration = "iceberg_compaction_task::TaskType", tag = "3")]
50    pub task_type: i32,
51}
52/// Nested message and enum types in `IcebergCompactionTask`.
53pub mod iceberg_compaction_task {
54    #[derive(prost_helpers::AnyPB)]
55    #[derive(
56        Clone,
57        Copy,
58        Debug,
59        PartialEq,
60        Eq,
61        Hash,
62        PartialOrd,
63        Ord,
64        ::prost::Enumeration
65    )]
66    #[repr(i32)]
67    pub enum TaskType {
68        Unspecified = 0,
69        /// Full compaction task.
70        Full = 1,
71        /// Small data file compaction task.
72        SmallFiles = 2,
73        FilesWithDelete = 3,
74    }
75    impl TaskType {
76        /// String value of the enum field names used in the ProtoBuf definition.
77        ///
78        /// The values are not transformed in any way and thus are considered stable
79        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
80        pub fn as_str_name(&self) -> &'static str {
81            match self {
82                Self::Unspecified => "UNSPECIFIED",
83                Self::Full => "FULL",
84                Self::SmallFiles => "SMALL_FILES",
85                Self::FilesWithDelete => "FILES_WITH_DELETE",
86            }
87        }
88        /// Creates an enum from field names used in the ProtoBuf definition.
89        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
90            match value {
91                "UNSPECIFIED" => Some(Self::Unspecified),
92                "FULL" => Some(Self::Full),
93                "SMALL_FILES" => Some(Self::SmallFiles),
94                "FILES_WITH_DELETE" => Some(Self::FilesWithDelete),
95                _ => None,
96            }
97        }
98    }
99}
100#[derive(prost_helpers::AnyPB)]
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct SubscribeIcebergCompactionEventResponse {
103    #[prost(uint64, tag = "7")]
104    pub create_at: u64,
105    #[prost(oneof = "subscribe_iceberg_compaction_event_response::Event", tags = "1, 2")]
106    pub event: ::core::option::Option<
107        subscribe_iceberg_compaction_event_response::Event,
108    >,
109}
110/// Nested message and enum types in `SubscribeIcebergCompactionEventResponse`.
111pub mod subscribe_iceberg_compaction_event_response {
112    /// PullTaskAck is a response, the meta will return a PullTaskAck after distributing the task requested by the PullTask.
113    /// The Compactor receives the PullTaskAck and remakes its state and tries to initiate the next PullTask.
114    #[derive(prost_helpers::AnyPB)]
115    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
116    pub struct PullTaskAck {}
117    #[derive(prost_helpers::AnyPB)]
118    #[derive(Clone, PartialEq, ::prost::Oneof)]
119    pub enum Event {
120        #[prost(message, tag = "1")]
121        CompactTask(super::IcebergCompactionTask),
122        #[prost(message, tag = "2")]
123        PullTaskAck(PullTaskAck),
124    }
125}