Example usage for com.amazonaws.services.elasticmapreduce.model ClusterState TERMINATED

List of usage examples for com.amazonaws.services.elasticmapreduce.model ClusterState TERMINATED

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticmapreduce.model ClusterState TERMINATED.

Prototype

ClusterState TERMINATED

To view the source code for com.amazonaws.services.elasticmapreduce.model ClusterState TERMINATED.

Click Source Link

Usage

From source file:org.finra.dm.dao.impl.MockEmrOperationsImpl.java

License:Apache License

@Override
public void terminateEmrCluster(AmazonElasticMapReduceClient emrClient, String clusterId,
        boolean overrideTerminationProtection) {
    MockEmrJobFlow cluster = getClusterById(clusterId);
    if (cluster.getJobFlowName().endsWith(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION)) {
        throw new AmazonServiceException(MockAwsOperationsHelper.AMAZON_SERVICE_EXCEPTION);
    }/*ww w. java  2s.c o m*/
    cluster.setStatus(ClusterState.TERMINATED.toString());
}

From source file:org.pentaho.amazon.client.impl.EmrClientImpl.java

License:Apache License

/**
 * Determine if the step flow is in a running state.
 *
 * @return true if it is not in COMPLETED or CANCELLED or FAILED or INTERRUPTED, and false otherwise.
 *//*from w w  w . j a  v a  2 s.  c o m*/
@Override
public boolean isClusterRunning() {
    if (ClusterState.WAITING.name().equalsIgnoreCase(currentClusterState)) {
        return false;
    }
    if (ClusterState.TERMINATED.name().equalsIgnoreCase(currentClusterState)) {
        return false;
    }
    if (ClusterState.TERMINATED_WITH_ERRORS.name().equalsIgnoreCase(currentClusterState)) {
        return false;
    }
    return true;
}

From source file:org.pentaho.amazon.client.impl.EmrClientImpl.java

License:Apache License

@Override
public boolean isClusterTerminated() {
    return ClusterState.TERMINATED.name().equalsIgnoreCase(currentClusterState)
            || ClusterState.TERMINATED_WITH_ERRORS.name().equalsIgnoreCase(currentClusterState);
}