// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::set_unhealthy_node_replacement::_set_unhealthy_node_replacement_input::SetUnhealthyNodeReplacementInputBuilder;
pub use crate::operation::set_unhealthy_node_replacement::_set_unhealthy_node_replacement_output::SetUnhealthyNodeReplacementOutputBuilder;
impl crate::operation::set_unhealthy_node_replacement::builders::SetUnhealthyNodeReplacementInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.set_unhealthy_node_replacement();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `SetUnhealthyNodeReplacement`.
///
/// <p>Specify whether to enable unhealthy node replacement, which lets Amazon EMR gracefully replace core nodes on a cluster if any nodes become unhealthy. For example, a node becomes unhealthy if disk usage is above 90%. If unhealthy node replacement is on and <code>TerminationProtected</code> are off, Amazon EMR immediately terminates the unhealthy core nodes. To use unhealthy node replacement and retain unhealthy core nodes, use to turn on termination protection. In such cases, Amazon EMR adds the unhealthy nodes to a denylist, reducing job interruptions and failures.</p>
/// <p>If unhealthy node replacement is on, Amazon EMR notifies YARN and other applications on the cluster to stop scheduling tasks with these nodes, moves the data, and then terminates the nodes.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-node-replacement.html">graceful node replacement</a> in the <i>Amazon EMR Management Guide</i>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SetUnhealthyNodeReplacementFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::set_unhealthy_node_replacement::builders::SetUnhealthyNodeReplacementInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementOutput,
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementError,
> for SetUnhealthyNodeReplacementFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementOutput,
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl SetUnhealthyNodeReplacementFluentBuilder {
/// Creates a new `SetUnhealthyNodeReplacementFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the SetUnhealthyNodeReplacement as a reference.
pub fn as_input(&self) -> &crate::operation::set_unhealthy_node_replacement::builders::SetUnhealthyNodeReplacementInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacement::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacement::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementOutput,
crate::operation::set_unhealthy_node_replacement::SetUnhealthyNodeReplacementError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
///
/// Appends an item to `JobFlowIds`.
///
/// To override the contents of this collection use [`set_job_flow_ids`](Self::set_job_flow_ids).
///
/// <p>The list of strings that uniquely identify the clusters for which to turn on unhealthy node replacement. You can get these identifiers by running the <code>RunJobFlow</code> or the <code>DescribeJobFlows</code> operations.</p>
pub fn job_flow_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.job_flow_ids(input.into());
self
}
/// <p>The list of strings that uniquely identify the clusters for which to turn on unhealthy node replacement. You can get these identifiers by running the <code>RunJobFlow</code> or the <code>DescribeJobFlows</code> operations.</p>
pub fn set_job_flow_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_job_flow_ids(input);
self
}
/// <p>The list of strings that uniquely identify the clusters for which to turn on unhealthy node replacement. You can get these identifiers by running the <code>RunJobFlow</code> or the <code>DescribeJobFlows</code> operations.</p>
pub fn get_job_flow_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_job_flow_ids()
}
/// <p>Indicates whether to turn on or turn off graceful unhealthy node replacement.</p>
pub fn unhealthy_node_replacement(mut self, input: bool) -> Self {
self.inner = self.inner.unhealthy_node_replacement(input);
self
}
/// <p>Indicates whether to turn on or turn off graceful unhealthy node replacement.</p>
pub fn set_unhealthy_node_replacement(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_unhealthy_node_replacement(input);
self
}
/// <p>Indicates whether to turn on or turn off graceful unhealthy node replacement.</p>
pub fn get_unhealthy_node_replacement(&self) -> &::std::option::Option<bool> {
self.inner.get_unhealthy_node_replacement()
}
}