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")]
17        pub context_id: u32,
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        FullCompaction = 1,
71        /// Small data file compaction task.
72        SmallDataFileCompaction = 2,
73    }
74    impl TaskType {
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::FullCompaction => "FULL_COMPACTION",
83                Self::SmallDataFileCompaction => "SMALL_DATA_FILE_COMPACTION",
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                "FULL_COMPACTION" => Some(Self::FullCompaction),
91                "SMALL_DATA_FILE_COMPACTION" => Some(Self::SmallDataFileCompaction),
92                _ => None,
93            }
94        }
95    }
96}
97#[derive(prost_helpers::AnyPB)]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct SubscribeIcebergCompactionEventResponse {
100    #[prost(uint64, tag = "7")]
101    pub create_at: u64,
102    #[prost(oneof = "subscribe_iceberg_compaction_event_response::Event", tags = "1, 2")]
103    pub event: ::core::option::Option<
104        subscribe_iceberg_compaction_event_response::Event,
105    >,
106}
107/// Nested message and enum types in `SubscribeIcebergCompactionEventResponse`.
108pub mod subscribe_iceberg_compaction_event_response {
109    /// PullTaskAck is a response, the meta will return a PullTaskAck after distributing the task requested by the PullTask.
110    /// The Compactor receives the PullTaskAck and remakes its state and tries to initiate the next PullTask.
111    #[derive(prost_helpers::AnyPB)]
112    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
113    pub struct PullTaskAck {}
114    #[derive(prost_helpers::AnyPB)]
115    #[derive(Clone, PartialEq, ::prost::Oneof)]
116    pub enum Event {
117        #[prost(message, tag = "1")]
118        CompactTask(super::IcebergCompactionTask),
119        #[prost(message, tag = "2")]
120        PullTaskAck(PullTaskAck),
121    }
122}