aws_sdk_glue/types/_table_optimizer_run.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains details for a table optimizer run.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TableOptimizerRun {
7 /// <p>An event type representing the status of the table optimizer run.</p>
8 pub event_type: ::std::option::Option<crate::types::TableOptimizerEventType>,
9 /// <p>Represents the epoch timestamp at which the compaction job was started within Lake Formation.</p>
10 pub start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
11 /// <p>Represents the epoch timestamp at which the compaction job ended.</p>
12 pub end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
13 /// <p>A <code>RunMetrics</code> object containing metrics for the optimizer run.</p>
14 /// <p>This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.</p>
15 #[deprecated(note = "Metrics has been replaced by optimizer type specific metrics such as IcebergCompactionMetrics")]
16 pub metrics: ::std::option::Option<crate::types::RunMetrics>,
17 /// <p>An error that occured during the optimizer run.</p>
18 pub error: ::std::option::Option<::std::string::String>,
19 /// <p>A <code>CompactionMetrics</code> object containing metrics for the optimizer run.</p>
20 pub compaction_metrics: ::std::option::Option<crate::types::CompactionMetrics>,
21 /// <p>The strategy used for the compaction run. Indicates which algorithm was applied to determine how files were selected and combined during the compaction process. Valid values are:</p>
22 /// <ul>
23 /// <li>
24 /// <p><code>binpack</code>: Combines small files into larger files, typically targeting sizes over 100MB, while applying any pending deletes. This is the recommended compaction strategy for most use cases.</p></li>
25 /// <li>
26 /// <p><code>sort</code>: Organizes data based on specified columns which are sorted hierarchically during compaction, improving query performance for filtered operations. This strategy is recommended when your queries frequently filter on specific columns. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
27 /// <li>
28 /// <p><code>z-order</code>: Optimizes data organization by blending multiple attributes into a single scalar value that can be used for sorting, allowing efficient querying across multiple dimensions. This strategy is recommended when you need to query data across multiple dimensions simultaneously. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
29 /// </ul>
30 pub compaction_strategy: ::std::option::Option<crate::types::CompactionStrategy>,
31 /// <p>A <code>RetentionMetrics</code> object containing metrics for the optimizer run.</p>
32 pub retention_metrics: ::std::option::Option<crate::types::RetentionMetrics>,
33 /// <p>An <code>OrphanFileDeletionMetrics</code> object containing metrics for the optimizer run.</p>
34 pub orphan_file_deletion_metrics: ::std::option::Option<crate::types::OrphanFileDeletionMetrics>,
35}
36impl TableOptimizerRun {
37 /// <p>An event type representing the status of the table optimizer run.</p>
38 pub fn event_type(&self) -> ::std::option::Option<&crate::types::TableOptimizerEventType> {
39 self.event_type.as_ref()
40 }
41 /// <p>Represents the epoch timestamp at which the compaction job was started within Lake Formation.</p>
42 pub fn start_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
43 self.start_timestamp.as_ref()
44 }
45 /// <p>Represents the epoch timestamp at which the compaction job ended.</p>
46 pub fn end_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
47 self.end_timestamp.as_ref()
48 }
49 /// <p>A <code>RunMetrics</code> object containing metrics for the optimizer run.</p>
50 /// <p>This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.</p>
51 #[deprecated(note = "Metrics has been replaced by optimizer type specific metrics such as IcebergCompactionMetrics")]
52 pub fn metrics(&self) -> ::std::option::Option<&crate::types::RunMetrics> {
53 self.metrics.as_ref()
54 }
55 /// <p>An error that occured during the optimizer run.</p>
56 pub fn error(&self) -> ::std::option::Option<&str> {
57 self.error.as_deref()
58 }
59 /// <p>A <code>CompactionMetrics</code> object containing metrics for the optimizer run.</p>
60 pub fn compaction_metrics(&self) -> ::std::option::Option<&crate::types::CompactionMetrics> {
61 self.compaction_metrics.as_ref()
62 }
63 /// <p>The strategy used for the compaction run. Indicates which algorithm was applied to determine how files were selected and combined during the compaction process. Valid values are:</p>
64 /// <ul>
65 /// <li>
66 /// <p><code>binpack</code>: Combines small files into larger files, typically targeting sizes over 100MB, while applying any pending deletes. This is the recommended compaction strategy for most use cases.</p></li>
67 /// <li>
68 /// <p><code>sort</code>: Organizes data based on specified columns which are sorted hierarchically during compaction, improving query performance for filtered operations. This strategy is recommended when your queries frequently filter on specific columns. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
69 /// <li>
70 /// <p><code>z-order</code>: Optimizes data organization by blending multiple attributes into a single scalar value that can be used for sorting, allowing efficient querying across multiple dimensions. This strategy is recommended when you need to query data across multiple dimensions simultaneously. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
71 /// </ul>
72 pub fn compaction_strategy(&self) -> ::std::option::Option<&crate::types::CompactionStrategy> {
73 self.compaction_strategy.as_ref()
74 }
75 /// <p>A <code>RetentionMetrics</code> object containing metrics for the optimizer run.</p>
76 pub fn retention_metrics(&self) -> ::std::option::Option<&crate::types::RetentionMetrics> {
77 self.retention_metrics.as_ref()
78 }
79 /// <p>An <code>OrphanFileDeletionMetrics</code> object containing metrics for the optimizer run.</p>
80 pub fn orphan_file_deletion_metrics(&self) -> ::std::option::Option<&crate::types::OrphanFileDeletionMetrics> {
81 self.orphan_file_deletion_metrics.as_ref()
82 }
83}
84impl TableOptimizerRun {
85 /// Creates a new builder-style object to manufacture [`TableOptimizerRun`](crate::types::TableOptimizerRun).
86 pub fn builder() -> crate::types::builders::TableOptimizerRunBuilder {
87 crate::types::builders::TableOptimizerRunBuilder::default()
88 }
89}
90
91/// A builder for [`TableOptimizerRun`](crate::types::TableOptimizerRun).
92#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
93#[non_exhaustive]
94pub struct TableOptimizerRunBuilder {
95 pub(crate) event_type: ::std::option::Option<crate::types::TableOptimizerEventType>,
96 pub(crate) start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
97 pub(crate) end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
98 pub(crate) metrics: ::std::option::Option<crate::types::RunMetrics>,
99 pub(crate) error: ::std::option::Option<::std::string::String>,
100 pub(crate) compaction_metrics: ::std::option::Option<crate::types::CompactionMetrics>,
101 pub(crate) compaction_strategy: ::std::option::Option<crate::types::CompactionStrategy>,
102 pub(crate) retention_metrics: ::std::option::Option<crate::types::RetentionMetrics>,
103 pub(crate) orphan_file_deletion_metrics: ::std::option::Option<crate::types::OrphanFileDeletionMetrics>,
104}
105impl TableOptimizerRunBuilder {
106 /// <p>An event type representing the status of the table optimizer run.</p>
107 pub fn event_type(mut self, input: crate::types::TableOptimizerEventType) -> Self {
108 self.event_type = ::std::option::Option::Some(input);
109 self
110 }
111 /// <p>An event type representing the status of the table optimizer run.</p>
112 pub fn set_event_type(mut self, input: ::std::option::Option<crate::types::TableOptimizerEventType>) -> Self {
113 self.event_type = input;
114 self
115 }
116 /// <p>An event type representing the status of the table optimizer run.</p>
117 pub fn get_event_type(&self) -> &::std::option::Option<crate::types::TableOptimizerEventType> {
118 &self.event_type
119 }
120 /// <p>Represents the epoch timestamp at which the compaction job was started within Lake Formation.</p>
121 pub fn start_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
122 self.start_timestamp = ::std::option::Option::Some(input);
123 self
124 }
125 /// <p>Represents the epoch timestamp at which the compaction job was started within Lake Formation.</p>
126 pub fn set_start_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
127 self.start_timestamp = input;
128 self
129 }
130 /// <p>Represents the epoch timestamp at which the compaction job was started within Lake Formation.</p>
131 pub fn get_start_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
132 &self.start_timestamp
133 }
134 /// <p>Represents the epoch timestamp at which the compaction job ended.</p>
135 pub fn end_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
136 self.end_timestamp = ::std::option::Option::Some(input);
137 self
138 }
139 /// <p>Represents the epoch timestamp at which the compaction job ended.</p>
140 pub fn set_end_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
141 self.end_timestamp = input;
142 self
143 }
144 /// <p>Represents the epoch timestamp at which the compaction job ended.</p>
145 pub fn get_end_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
146 &self.end_timestamp
147 }
148 /// <p>A <code>RunMetrics</code> object containing metrics for the optimizer run.</p>
149 /// <p>This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.</p>
150 #[deprecated(note = "Metrics has been replaced by optimizer type specific metrics such as IcebergCompactionMetrics")]
151 pub fn metrics(mut self, input: crate::types::RunMetrics) -> Self {
152 self.metrics = ::std::option::Option::Some(input);
153 self
154 }
155 /// <p>A <code>RunMetrics</code> object containing metrics for the optimizer run.</p>
156 /// <p>This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.</p>
157 #[deprecated(note = "Metrics has been replaced by optimizer type specific metrics such as IcebergCompactionMetrics")]
158 pub fn set_metrics(mut self, input: ::std::option::Option<crate::types::RunMetrics>) -> Self {
159 self.metrics = input;
160 self
161 }
162 /// <p>A <code>RunMetrics</code> object containing metrics for the optimizer run.</p>
163 /// <p>This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.</p>
164 #[deprecated(note = "Metrics has been replaced by optimizer type specific metrics such as IcebergCompactionMetrics")]
165 pub fn get_metrics(&self) -> &::std::option::Option<crate::types::RunMetrics> {
166 &self.metrics
167 }
168 /// <p>An error that occured during the optimizer run.</p>
169 pub fn error(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170 self.error = ::std::option::Option::Some(input.into());
171 self
172 }
173 /// <p>An error that occured during the optimizer run.</p>
174 pub fn set_error(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.error = input;
176 self
177 }
178 /// <p>An error that occured during the optimizer run.</p>
179 pub fn get_error(&self) -> &::std::option::Option<::std::string::String> {
180 &self.error
181 }
182 /// <p>A <code>CompactionMetrics</code> object containing metrics for the optimizer run.</p>
183 pub fn compaction_metrics(mut self, input: crate::types::CompactionMetrics) -> Self {
184 self.compaction_metrics = ::std::option::Option::Some(input);
185 self
186 }
187 /// <p>A <code>CompactionMetrics</code> object containing metrics for the optimizer run.</p>
188 pub fn set_compaction_metrics(mut self, input: ::std::option::Option<crate::types::CompactionMetrics>) -> Self {
189 self.compaction_metrics = input;
190 self
191 }
192 /// <p>A <code>CompactionMetrics</code> object containing metrics for the optimizer run.</p>
193 pub fn get_compaction_metrics(&self) -> &::std::option::Option<crate::types::CompactionMetrics> {
194 &self.compaction_metrics
195 }
196 /// <p>The strategy used for the compaction run. Indicates which algorithm was applied to determine how files were selected and combined during the compaction process. Valid values are:</p>
197 /// <ul>
198 /// <li>
199 /// <p><code>binpack</code>: Combines small files into larger files, typically targeting sizes over 100MB, while applying any pending deletes. This is the recommended compaction strategy for most use cases.</p></li>
200 /// <li>
201 /// <p><code>sort</code>: Organizes data based on specified columns which are sorted hierarchically during compaction, improving query performance for filtered operations. This strategy is recommended when your queries frequently filter on specific columns. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
202 /// <li>
203 /// <p><code>z-order</code>: Optimizes data organization by blending multiple attributes into a single scalar value that can be used for sorting, allowing efficient querying across multiple dimensions. This strategy is recommended when you need to query data across multiple dimensions simultaneously. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
204 /// </ul>
205 pub fn compaction_strategy(mut self, input: crate::types::CompactionStrategy) -> Self {
206 self.compaction_strategy = ::std::option::Option::Some(input);
207 self
208 }
209 /// <p>The strategy used for the compaction run. Indicates which algorithm was applied to determine how files were selected and combined during the compaction process. Valid values are:</p>
210 /// <ul>
211 /// <li>
212 /// <p><code>binpack</code>: Combines small files into larger files, typically targeting sizes over 100MB, while applying any pending deletes. This is the recommended compaction strategy for most use cases.</p></li>
213 /// <li>
214 /// <p><code>sort</code>: Organizes data based on specified columns which are sorted hierarchically during compaction, improving query performance for filtered operations. This strategy is recommended when your queries frequently filter on specific columns. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
215 /// <li>
216 /// <p><code>z-order</code>: Optimizes data organization by blending multiple attributes into a single scalar value that can be used for sorting, allowing efficient querying across multiple dimensions. This strategy is recommended when you need to query data across multiple dimensions simultaneously. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
217 /// </ul>
218 pub fn set_compaction_strategy(mut self, input: ::std::option::Option<crate::types::CompactionStrategy>) -> Self {
219 self.compaction_strategy = input;
220 self
221 }
222 /// <p>The strategy used for the compaction run. Indicates which algorithm was applied to determine how files were selected and combined during the compaction process. Valid values are:</p>
223 /// <ul>
224 /// <li>
225 /// <p><code>binpack</code>: Combines small files into larger files, typically targeting sizes over 100MB, while applying any pending deletes. This is the recommended compaction strategy for most use cases.</p></li>
226 /// <li>
227 /// <p><code>sort</code>: Organizes data based on specified columns which are sorted hierarchically during compaction, improving query performance for filtered operations. This strategy is recommended when your queries frequently filter on specific columns. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
228 /// <li>
229 /// <p><code>z-order</code>: Optimizes data organization by blending multiple attributes into a single scalar value that can be used for sorting, allowing efficient querying across multiple dimensions. This strategy is recommended when you need to query data across multiple dimensions simultaneously. To use this strategy, you must first define a sort order in your Iceberg table properties using the <code>sort_order</code> table property.</p></li>
230 /// </ul>
231 pub fn get_compaction_strategy(&self) -> &::std::option::Option<crate::types::CompactionStrategy> {
232 &self.compaction_strategy
233 }
234 /// <p>A <code>RetentionMetrics</code> object containing metrics for the optimizer run.</p>
235 pub fn retention_metrics(mut self, input: crate::types::RetentionMetrics) -> Self {
236 self.retention_metrics = ::std::option::Option::Some(input);
237 self
238 }
239 /// <p>A <code>RetentionMetrics</code> object containing metrics for the optimizer run.</p>
240 pub fn set_retention_metrics(mut self, input: ::std::option::Option<crate::types::RetentionMetrics>) -> Self {
241 self.retention_metrics = input;
242 self
243 }
244 /// <p>A <code>RetentionMetrics</code> object containing metrics for the optimizer run.</p>
245 pub fn get_retention_metrics(&self) -> &::std::option::Option<crate::types::RetentionMetrics> {
246 &self.retention_metrics
247 }
248 /// <p>An <code>OrphanFileDeletionMetrics</code> object containing metrics for the optimizer run.</p>
249 pub fn orphan_file_deletion_metrics(mut self, input: crate::types::OrphanFileDeletionMetrics) -> Self {
250 self.orphan_file_deletion_metrics = ::std::option::Option::Some(input);
251 self
252 }
253 /// <p>An <code>OrphanFileDeletionMetrics</code> object containing metrics for the optimizer run.</p>
254 pub fn set_orphan_file_deletion_metrics(mut self, input: ::std::option::Option<crate::types::OrphanFileDeletionMetrics>) -> Self {
255 self.orphan_file_deletion_metrics = input;
256 self
257 }
258 /// <p>An <code>OrphanFileDeletionMetrics</code> object containing metrics for the optimizer run.</p>
259 pub fn get_orphan_file_deletion_metrics(&self) -> &::std::option::Option<crate::types::OrphanFileDeletionMetrics> {
260 &self.orphan_file_deletion_metrics
261 }
262 /// Consumes the builder and constructs a [`TableOptimizerRun`](crate::types::TableOptimizerRun).
263 pub fn build(self) -> crate::types::TableOptimizerRun {
264 crate::types::TableOptimizerRun {
265 event_type: self.event_type,
266 start_timestamp: self.start_timestamp,
267 end_timestamp: self.end_timestamp,
268 metrics: self.metrics,
269 error: self.error,
270 compaction_metrics: self.compaction_metrics,
271 compaction_strategy: self.compaction_strategy,
272 retention_metrics: self.retention_metrics,
273 orphan_file_deletion_metrics: self.orphan_file_deletion_metrics,
274 }
275 }
276}