aws_sdk_kinesisanalyticsv2/types/
_checkpoint_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes an application's checkpointing configuration. Checkpointing is the process of persisting application state for fault tolerance. For more information, see <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/dev/datastream/fault-tolerance/checkpointing/#enabling-and-configuring-checkpointing"> Checkpoints for Fault Tolerance</a> in the <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/">Apache Flink Documentation</a>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CheckpointConfiguration {
7    /// <p>Describes whether the application uses Managed Service for Apache Flink' default checkpointing behavior. You must set this property to <code>CUSTOM</code> in order to set the <code>CheckpointingEnabled</code>, <code>CheckpointInterval</code>, or <code>MinPauseBetweenCheckpoints</code> parameters.</p><note>
8    /// <p>If this value is set to <code>DEFAULT</code>, the application will use the following values, even if they are set to other values using APIs or application code:</p>
9    /// <ul>
10    /// <li>
11    /// <p><b>CheckpointingEnabled:</b> true</p></li>
12    /// <li>
13    /// <p><b>CheckpointInterval:</b> 60000</p></li>
14    /// <li>
15    /// <p><b>MinPauseBetweenCheckpoints:</b> 5000</p></li>
16    /// </ul>
17    /// </note>
18    pub configuration_type: crate::types::ConfigurationType,
19    /// <p>Describes whether checkpointing is enabled for a Managed Service for Apache Flink application.</p><note>
20    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointingEnabled</code> value of <code>true</code>, even if this value is set to another value using this API or in application code.</p>
21    /// </note>
22    pub checkpointing_enabled: ::std::option::Option<bool>,
23    /// <p>Describes the interval in milliseconds between checkpoint operations.</p><note>
24    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointInterval</code> value of 60000, even if this value is set to another value using this API or in application code.</p>
25    /// </note>
26    pub checkpoint_interval: ::std::option::Option<i64>,
27    /// <p>Describes the minimum time in milliseconds after a checkpoint operation completes that a new checkpoint operation can start. If a checkpoint operation takes longer than the <code>CheckpointInterval</code>, the application otherwise performs continual checkpoint operations. For more information, see <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/state/large_state_tuning/#tuning-checkpointing"> Tuning Checkpointing</a> in the <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/">Apache Flink Documentation</a>.</p><note>
28    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>MinPauseBetweenCheckpoints</code> value of 5000, even if this value is set using this API or in application code.</p>
29    /// </note>
30    pub min_pause_between_checkpoints: ::std::option::Option<i64>,
31}
32impl CheckpointConfiguration {
33    /// <p>Describes whether the application uses Managed Service for Apache Flink' default checkpointing behavior. You must set this property to <code>CUSTOM</code> in order to set the <code>CheckpointingEnabled</code>, <code>CheckpointInterval</code>, or <code>MinPauseBetweenCheckpoints</code> parameters.</p><note>
34    /// <p>If this value is set to <code>DEFAULT</code>, the application will use the following values, even if they are set to other values using APIs or application code:</p>
35    /// <ul>
36    /// <li>
37    /// <p><b>CheckpointingEnabled:</b> true</p></li>
38    /// <li>
39    /// <p><b>CheckpointInterval:</b> 60000</p></li>
40    /// <li>
41    /// <p><b>MinPauseBetweenCheckpoints:</b> 5000</p></li>
42    /// </ul>
43    /// </note>
44    pub fn configuration_type(&self) -> &crate::types::ConfigurationType {
45        &self.configuration_type
46    }
47    /// <p>Describes whether checkpointing is enabled for a Managed Service for Apache Flink application.</p><note>
48    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointingEnabled</code> value of <code>true</code>, even if this value is set to another value using this API or in application code.</p>
49    /// </note>
50    pub fn checkpointing_enabled(&self) -> ::std::option::Option<bool> {
51        self.checkpointing_enabled
52    }
53    /// <p>Describes the interval in milliseconds between checkpoint operations.</p><note>
54    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointInterval</code> value of 60000, even if this value is set to another value using this API or in application code.</p>
55    /// </note>
56    pub fn checkpoint_interval(&self) -> ::std::option::Option<i64> {
57        self.checkpoint_interval
58    }
59    /// <p>Describes the minimum time in milliseconds after a checkpoint operation completes that a new checkpoint operation can start. If a checkpoint operation takes longer than the <code>CheckpointInterval</code>, the application otherwise performs continual checkpoint operations. For more information, see <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/state/large_state_tuning/#tuning-checkpointing"> Tuning Checkpointing</a> in the <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/">Apache Flink Documentation</a>.</p><note>
60    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>MinPauseBetweenCheckpoints</code> value of 5000, even if this value is set using this API or in application code.</p>
61    /// </note>
62    pub fn min_pause_between_checkpoints(&self) -> ::std::option::Option<i64> {
63        self.min_pause_between_checkpoints
64    }
65}
66impl CheckpointConfiguration {
67    /// Creates a new builder-style object to manufacture [`CheckpointConfiguration`](crate::types::CheckpointConfiguration).
68    pub fn builder() -> crate::types::builders::CheckpointConfigurationBuilder {
69        crate::types::builders::CheckpointConfigurationBuilder::default()
70    }
71}
72
73/// A builder for [`CheckpointConfiguration`](crate::types::CheckpointConfiguration).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct CheckpointConfigurationBuilder {
77    pub(crate) configuration_type: ::std::option::Option<crate::types::ConfigurationType>,
78    pub(crate) checkpointing_enabled: ::std::option::Option<bool>,
79    pub(crate) checkpoint_interval: ::std::option::Option<i64>,
80    pub(crate) min_pause_between_checkpoints: ::std::option::Option<i64>,
81}
82impl CheckpointConfigurationBuilder {
83    /// <p>Describes whether the application uses Managed Service for Apache Flink' default checkpointing behavior. You must set this property to <code>CUSTOM</code> in order to set the <code>CheckpointingEnabled</code>, <code>CheckpointInterval</code>, or <code>MinPauseBetweenCheckpoints</code> parameters.</p><note>
84    /// <p>If this value is set to <code>DEFAULT</code>, the application will use the following values, even if they are set to other values using APIs or application code:</p>
85    /// <ul>
86    /// <li>
87    /// <p><b>CheckpointingEnabled:</b> true</p></li>
88    /// <li>
89    /// <p><b>CheckpointInterval:</b> 60000</p></li>
90    /// <li>
91    /// <p><b>MinPauseBetweenCheckpoints:</b> 5000</p></li>
92    /// </ul>
93    /// </note>
94    /// This field is required.
95    pub fn configuration_type(mut self, input: crate::types::ConfigurationType) -> Self {
96        self.configuration_type = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>Describes whether the application uses Managed Service for Apache Flink' default checkpointing behavior. You must set this property to <code>CUSTOM</code> in order to set the <code>CheckpointingEnabled</code>, <code>CheckpointInterval</code>, or <code>MinPauseBetweenCheckpoints</code> parameters.</p><note>
100    /// <p>If this value is set to <code>DEFAULT</code>, the application will use the following values, even if they are set to other values using APIs or application code:</p>
101    /// <ul>
102    /// <li>
103    /// <p><b>CheckpointingEnabled:</b> true</p></li>
104    /// <li>
105    /// <p><b>CheckpointInterval:</b> 60000</p></li>
106    /// <li>
107    /// <p><b>MinPauseBetweenCheckpoints:</b> 5000</p></li>
108    /// </ul>
109    /// </note>
110    pub fn set_configuration_type(mut self, input: ::std::option::Option<crate::types::ConfigurationType>) -> Self {
111        self.configuration_type = input;
112        self
113    }
114    /// <p>Describes whether the application uses Managed Service for Apache Flink' default checkpointing behavior. You must set this property to <code>CUSTOM</code> in order to set the <code>CheckpointingEnabled</code>, <code>CheckpointInterval</code>, or <code>MinPauseBetweenCheckpoints</code> parameters.</p><note>
115    /// <p>If this value is set to <code>DEFAULT</code>, the application will use the following values, even if they are set to other values using APIs or application code:</p>
116    /// <ul>
117    /// <li>
118    /// <p><b>CheckpointingEnabled:</b> true</p></li>
119    /// <li>
120    /// <p><b>CheckpointInterval:</b> 60000</p></li>
121    /// <li>
122    /// <p><b>MinPauseBetweenCheckpoints:</b> 5000</p></li>
123    /// </ul>
124    /// </note>
125    pub fn get_configuration_type(&self) -> &::std::option::Option<crate::types::ConfigurationType> {
126        &self.configuration_type
127    }
128    /// <p>Describes whether checkpointing is enabled for a Managed Service for Apache Flink application.</p><note>
129    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointingEnabled</code> value of <code>true</code>, even if this value is set to another value using this API or in application code.</p>
130    /// </note>
131    pub fn checkpointing_enabled(mut self, input: bool) -> Self {
132        self.checkpointing_enabled = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>Describes whether checkpointing is enabled for a Managed Service for Apache Flink application.</p><note>
136    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointingEnabled</code> value of <code>true</code>, even if this value is set to another value using this API or in application code.</p>
137    /// </note>
138    pub fn set_checkpointing_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
139        self.checkpointing_enabled = input;
140        self
141    }
142    /// <p>Describes whether checkpointing is enabled for a Managed Service for Apache Flink application.</p><note>
143    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointingEnabled</code> value of <code>true</code>, even if this value is set to another value using this API or in application code.</p>
144    /// </note>
145    pub fn get_checkpointing_enabled(&self) -> &::std::option::Option<bool> {
146        &self.checkpointing_enabled
147    }
148    /// <p>Describes the interval in milliseconds between checkpoint operations.</p><note>
149    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointInterval</code> value of 60000, even if this value is set to another value using this API or in application code.</p>
150    /// </note>
151    pub fn checkpoint_interval(mut self, input: i64) -> Self {
152        self.checkpoint_interval = ::std::option::Option::Some(input);
153        self
154    }
155    /// <p>Describes the interval in milliseconds between checkpoint operations.</p><note>
156    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointInterval</code> value of 60000, even if this value is set to another value using this API or in application code.</p>
157    /// </note>
158    pub fn set_checkpoint_interval(mut self, input: ::std::option::Option<i64>) -> Self {
159        self.checkpoint_interval = input;
160        self
161    }
162    /// <p>Describes the interval in milliseconds between checkpoint operations.</p><note>
163    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>CheckpointInterval</code> value of 60000, even if this value is set to another value using this API or in application code.</p>
164    /// </note>
165    pub fn get_checkpoint_interval(&self) -> &::std::option::Option<i64> {
166        &self.checkpoint_interval
167    }
168    /// <p>Describes the minimum time in milliseconds after a checkpoint operation completes that a new checkpoint operation can start. If a checkpoint operation takes longer than the <code>CheckpointInterval</code>, the application otherwise performs continual checkpoint operations. For more information, see <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/state/large_state_tuning/#tuning-checkpointing"> Tuning Checkpointing</a> in the <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/">Apache Flink Documentation</a>.</p><note>
169    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>MinPauseBetweenCheckpoints</code> value of 5000, even if this value is set using this API or in application code.</p>
170    /// </note>
171    pub fn min_pause_between_checkpoints(mut self, input: i64) -> Self {
172        self.min_pause_between_checkpoints = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>Describes the minimum time in milliseconds after a checkpoint operation completes that a new checkpoint operation can start. If a checkpoint operation takes longer than the <code>CheckpointInterval</code>, the application otherwise performs continual checkpoint operations. For more information, see <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/state/large_state_tuning/#tuning-checkpointing"> Tuning Checkpointing</a> in the <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/">Apache Flink Documentation</a>.</p><note>
176    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>MinPauseBetweenCheckpoints</code> value of 5000, even if this value is set using this API or in application code.</p>
177    /// </note>
178    pub fn set_min_pause_between_checkpoints(mut self, input: ::std::option::Option<i64>) -> Self {
179        self.min_pause_between_checkpoints = input;
180        self
181    }
182    /// <p>Describes the minimum time in milliseconds after a checkpoint operation completes that a new checkpoint operation can start. If a checkpoint operation takes longer than the <code>CheckpointInterval</code>, the application otherwise performs continual checkpoint operations. For more information, see <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/state/large_state_tuning/#tuning-checkpointing"> Tuning Checkpointing</a> in the <a href="https://nightlies.apache.org/flink/flink-docs-release-1.20/">Apache Flink Documentation</a>.</p><note>
183    /// <p>If <code>CheckpointConfiguration.ConfigurationType</code> is <code>DEFAULT</code>, the application will use a <code>MinPauseBetweenCheckpoints</code> value of 5000, even if this value is set using this API or in application code.</p>
184    /// </note>
185    pub fn get_min_pause_between_checkpoints(&self) -> &::std::option::Option<i64> {
186        &self.min_pause_between_checkpoints
187    }
188    /// Consumes the builder and constructs a [`CheckpointConfiguration`](crate::types::CheckpointConfiguration).
189    /// This method will fail if any of the following fields are not set:
190    /// - [`configuration_type`](crate::types::builders::CheckpointConfigurationBuilder::configuration_type)
191    pub fn build(self) -> ::std::result::Result<crate::types::CheckpointConfiguration, ::aws_smithy_types::error::operation::BuildError> {
192        ::std::result::Result::Ok(crate::types::CheckpointConfiguration {
193            configuration_type: self.configuration_type.ok_or_else(|| {
194                ::aws_smithy_types::error::operation::BuildError::missing_field(
195                    "configuration_type",
196                    "configuration_type was not specified but it is required when building CheckpointConfiguration",
197                )
198            })?,
199            checkpointing_enabled: self.checkpointing_enabled,
200            checkpoint_interval: self.checkpoint_interval,
201            min_pause_between_checkpoints: self.min_pause_between_checkpoints,
202        })
203    }
204}