setUnhealthyNodeReplacement method

Future<void> setUnhealthyNodeReplacement({
  1. required List<String> jobFlowIds,
  2. required bool unhealthyNodeReplacement,
})

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 TerminationProtected 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.

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.

For more information, see graceful node replacement in the Amazon EMR Management Guide.

May throw InternalServerError.

Parameter jobFlowIds : 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 RunJobFlow or the DescribeJobFlows operations.

Parameter unhealthyNodeReplacement : Indicates whether to turn on or turn off graceful unhealthy node replacement.

Implementation

Future<void> setUnhealthyNodeReplacement({
  required List<String> jobFlowIds,
  required bool unhealthyNodeReplacement,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ElasticMapReduce.SetUnhealthyNodeReplacement'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'JobFlowIds': jobFlowIds,
      'UnhealthyNodeReplacement': unhealthyNodeReplacement,
    },
  );
}