1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Namespace {
4 #[prost(string, repeated, tag = "1")]
5 pub levels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct TableName {
9 #[prost(string, tag = "1")]
10 pub name: ::prost::alloc::string::String,
11}
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct TableTarget {
14 #[prost(message, optional, tag = "1")]
15 pub namespace: ::core::option::Option<Namespace>,
16 #[prost(message, optional, tag = "2")]
17 pub table_name: ::core::option::Option<TableName>,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct MaintenanceAction {
21 #[prost(message, optional, tag = "1")]
22 pub target: ::core::option::Option<TableTarget>,
23 #[prost(oneof = "maintenance_action::Action", tags = "2, 3, 4, 5, 6")]
24 pub action: ::core::option::Option<maintenance_action::Action>,
25}
26pub mod maintenance_action {
28 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
29 pub enum Action {
30 #[prost(message, tag = "2")]
31 RewriteDataFiles(super::RewriteDataFiles),
32 #[prost(message, tag = "3")]
33 RewriteManifests(super::RewriteManifests),
34 #[prost(message, tag = "4")]
35 ExpireSnapshots(super::ExpireSnapshots),
36 #[prost(message, tag = "5")]
37 RemoveOrphanFiles(super::RemoveOrphanFiles),
38 #[prost(message, tag = "6")]
39 RemoveDuplicateDataFiles(super::RemoveDuplicateDataFiles),
40 }
41}
42#[derive(Clone, Copy, PartialEq, ::prost::Message)]
43pub struct RewriteDataFiles {
44 #[prost(uint64, optional, tag = "1")]
45 pub target_file_size_bytes: ::core::option::Option<u64>,
46}
47#[derive(Clone, Copy, PartialEq, ::prost::Message)]
48pub struct RewriteManifests {}
49#[derive(Clone, Copy, PartialEq, ::prost::Message)]
50pub struct ExpireSnapshots {}
51#[derive(Clone, Copy, PartialEq, ::prost::Message)]
52pub struct RemoveOrphanFiles {}
53#[derive(Clone, Copy, PartialEq, ::prost::Message)]
54pub struct RemoveDuplicateDataFiles {}
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct GetMaintenanceRunResponse {
57 #[prost(string, tag = "1")]
58 pub run_id: ::prost::alloc::string::String,
59 #[prost(message, repeated, tag = "2")]
60 pub actions: ::prost::alloc::vec::Vec<MaintenanceAction>,
61 #[prost(enumeration = "MaintenanceRunStatus", tag = "3")]
62 pub status: i32,
63 #[prost(message, optional, tag = "4")]
64 pub started_at: ::core::option::Option<
65 super::super::super::google::protobuf::Timestamp,
66 >,
67 #[prost(message, optional, tag = "5")]
68 pub finished_at: ::core::option::Option<
69 super::super::super::google::protobuf::Timestamp,
70 >,
71}
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct RunMaintenanceRequest {
74 #[prost(message, repeated, tag = "1")]
75 pub actions: ::prost::alloc::vec::Vec<MaintenanceAction>,
76 #[prost(string, optional, tag = "2")]
77 pub image_override: ::core::option::Option<::prost::alloc::string::String>,
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct RunMaintenanceResponse {
81 #[prost(string, tag = "1")]
82 pub run_id: ::prost::alloc::string::String,
83}
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct GetMaintenanceRunRequest {
86 #[prost(string, tag = "1")]
87 pub run_id: ::prost::alloc::string::String,
88}
89#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
90#[repr(i32)]
91pub enum MaintenanceRunStatus {
92 Unspecified = 0,
93 Pending = 1,
94 Running = 2,
95 Succeeded = 3,
96 Failed = 4,
97}
98impl MaintenanceRunStatus {
99 pub fn as_str_name(&self) -> &'static str {
104 match self {
105 Self::Unspecified => "MAINTENANCE_RUN_STATUS_UNSPECIFIED",
106 Self::Pending => "MAINTENANCE_RUN_STATUS_PENDING",
107 Self::Running => "MAINTENANCE_RUN_STATUS_RUNNING",
108 Self::Succeeded => "MAINTENANCE_RUN_STATUS_SUCCEEDED",
109 Self::Failed => "MAINTENANCE_RUN_STATUS_FAILED",
110 }
111 }
112 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
114 match value {
115 "MAINTENANCE_RUN_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
116 "MAINTENANCE_RUN_STATUS_PENDING" => Some(Self::Pending),
117 "MAINTENANCE_RUN_STATUS_RUNNING" => Some(Self::Running),
118 "MAINTENANCE_RUN_STATUS_SUCCEEDED" => Some(Self::Succeeded),
119 "MAINTENANCE_RUN_STATUS_FAILED" => Some(Self::Failed),
120 _ => None,
121 }
122 }
123}
124#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
125#[repr(i32)]
126pub enum TableMaintenanceErrors {
127 Unspecified = 0,
128 TableNotFound = 1,
129}
130impl TableMaintenanceErrors {
131 pub fn as_str_name(&self) -> &'static str {
136 match self {
137 Self::Unspecified => "TABLE_MAINTENANCE_ERRORS_UNSPECIFIED",
138 Self::TableNotFound => "TABLE_MAINTENANCE_ERRORS_TABLE_NOT_FOUND",
139 }
140 }
141 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
143 match value {
144 "TABLE_MAINTENANCE_ERRORS_UNSPECIFIED" => Some(Self::Unspecified),
145 "TABLE_MAINTENANCE_ERRORS_TABLE_NOT_FOUND" => Some(Self::TableNotFound),
146 _ => None,
147 }
148 }
149}
150pub mod iceberg_table_maintenance_service_client {
152 #![allow(
153 unused_variables,
154 dead_code,
155 missing_docs,
156 clippy::wildcard_imports,
157 clippy::let_unit_value,
158 )]
159 use tonic::codegen::*;
160 use tonic::codegen::http::Uri;
161 #[derive(Debug, Clone)]
162 pub struct IcebergTableMaintenanceServiceClient<T> {
163 inner: tonic::client::Grpc<T>,
164 }
165 impl IcebergTableMaintenanceServiceClient<tonic::transport::Channel> {
166 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
168 where
169 D: TryInto<tonic::transport::Endpoint>,
170 D::Error: Into<StdError>,
171 {
172 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
173 Ok(Self::new(conn))
174 }
175 }
176 impl<T> IcebergTableMaintenanceServiceClient<T>
177 where
178 T: tonic::client::GrpcService<tonic::body::Body>,
179 T::Error: Into<StdError>,
180 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
181 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
182 {
183 pub fn new(inner: T) -> Self {
184 let inner = tonic::client::Grpc::new(inner);
185 Self { inner }
186 }
187 pub fn with_origin(inner: T, origin: Uri) -> Self {
188 let inner = tonic::client::Grpc::with_origin(inner, origin);
189 Self { inner }
190 }
191 pub fn with_interceptor<F>(
192 inner: T,
193 interceptor: F,
194 ) -> IcebergTableMaintenanceServiceClient<InterceptedService<T, F>>
195 where
196 F: tonic::service::Interceptor,
197 T::ResponseBody: Default,
198 T: tonic::codegen::Service<
199 http::Request<tonic::body::Body>,
200 Response = http::Response<
201 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
202 >,
203 >,
204 <T as tonic::codegen::Service<
205 http::Request<tonic::body::Body>,
206 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
207 {
208 IcebergTableMaintenanceServiceClient::new(
209 InterceptedService::new(inner, interceptor),
210 )
211 }
212 #[must_use]
217 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
218 self.inner = self.inner.send_compressed(encoding);
219 self
220 }
221 #[must_use]
223 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
224 self.inner = self.inner.accept_compressed(encoding);
225 self
226 }
227 #[must_use]
231 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
232 self.inner = self.inner.max_decoding_message_size(limit);
233 self
234 }
235 #[must_use]
239 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
240 self.inner = self.inner.max_encoding_message_size(limit);
241 self
242 }
243 pub async fn run_maintenance(
244 &mut self,
245 request: impl tonic::IntoRequest<super::RunMaintenanceRequest>,
246 ) -> std::result::Result<
247 tonic::Response<super::RunMaintenanceResponse>,
248 tonic::Status,
249 > {
250 self.inner
251 .ready()
252 .await
253 .map_err(|e| {
254 tonic::Status::unknown(
255 format!("Service was not ready: {}", e.into()),
256 )
257 })?;
258 let codec = tonic::codec::ProstCodec::default();
259 let path = http::uri::PathAndQuery::from_static(
260 "/nominal.iceberg.v1.IcebergTableMaintenanceService/RunMaintenance",
261 );
262 let mut req = request.into_request();
263 req.extensions_mut()
264 .insert(
265 GrpcMethod::new(
266 "nominal.iceberg.v1.IcebergTableMaintenanceService",
267 "RunMaintenance",
268 ),
269 );
270 self.inner.unary(req, path, codec).await
271 }
272 pub async fn get_maintenance_run(
273 &mut self,
274 request: impl tonic::IntoRequest<super::GetMaintenanceRunRequest>,
275 ) -> std::result::Result<
276 tonic::Response<super::GetMaintenanceRunResponse>,
277 tonic::Status,
278 > {
279 self.inner
280 .ready()
281 .await
282 .map_err(|e| {
283 tonic::Status::unknown(
284 format!("Service was not ready: {}", e.into()),
285 )
286 })?;
287 let codec = tonic::codec::ProstCodec::default();
288 let path = http::uri::PathAndQuery::from_static(
289 "/nominal.iceberg.v1.IcebergTableMaintenanceService/GetMaintenanceRun",
290 );
291 let mut req = request.into_request();
292 req.extensions_mut()
293 .insert(
294 GrpcMethod::new(
295 "nominal.iceberg.v1.IcebergTableMaintenanceService",
296 "GetMaintenanceRun",
297 ),
298 );
299 self.inner.unary(req, path, codec).await
300 }
301 }
302}
303#[derive(Clone, PartialEq, ::prost::Message)]
304pub struct IcebergFileWrittenEvent {
305 #[prost(message, optional, tag = "1")]
306 pub table: ::core::option::Option<TableTarget>,
307 #[prost(int32, tag = "2")]
308 pub partition_value: i32,
309 #[prost(string, tag = "3")]
310 pub object_key: ::prost::alloc::string::String,
311 #[prost(message, optional, tag = "4")]
312 pub ingested_at: ::core::option::Option<
313 super::super::super::google::protobuf::Timestamp,
314 >,
315 #[prost(string, tag = "5")]
316 pub source_topic: ::prost::alloc::string::String,
317 #[prost(int32, tag = "6")]
318 pub source_partition: i32,
319 #[prost(int64, tag = "7")]
320 pub source_end_offset: i64,
321 #[prost(message, optional, tag = "8")]
322 pub oldest_source_record_timestamp: ::core::option::Option<
323 super::super::super::google::protobuf::Timestamp,
324 >,
325}