List of usage examples for com.amazonaws.services.elasticmapreduce AmazonElasticMapReduceClient setTerminationProtection
@Override
public SetTerminationProtectionResult setTerminationProtection(SetTerminationProtectionRequest request)
SetTerminationProtection locks a cluster (job flow) so the EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error.
From source file:org.finra.dm.dao.impl.EmrOperationsImpl.java
License:Apache License
/** * Terminate EMR cluster, overrides terminate protection if requested. *//*w w w .j av a 2 s . c om*/ @Override public void terminateEmrCluster(AmazonElasticMapReduceClient emrClient, String clusterId, boolean overrideTerminationProtection) { // Override terminate protection if requested. if (overrideTerminationProtection) { // Set termination protection emrClient.setTerminationProtection(new SetTerminationProtectionRequest().withJobFlowIds(clusterId) .withTerminationProtected(false)); } // Terminate the job flow emrClient.terminateJobFlows(new TerminateJobFlowsRequest().withJobFlowIds(clusterId)); }