Example usage for com.amazonaws.services.elasticmapreduce.model ClusterStatus getState

List of usage examples for com.amazonaws.services.elasticmapreduce.model ClusterStatus getState

Introduction

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

Prototype


public String getState() 

Source Link

Document

The current state of the cluster.

Usage

From source file:org.finra.herd.service.impl.EmrServiceImpl.java

License:Apache License

/**
 * Updates EMR cluster model object with the specified EMR cluster status information.
 *
 * @param emrCluster the EMR cluster/*from   w  ww . j  a  v  a  2 s .c  o  m*/
 * @param clusterStatus the EMR cluster status information
 */
private void setEmrClusterStatus(EmrCluster emrCluster, ClusterStatus clusterStatus) {
    // Log cluster status information.
    LOGGER.info("emrClusterId=\"{}\" emrClusterStatus={}", emrCluster.getId(),
            jsonHelper.objectToJson(clusterStatus));

    // Update the EMR cluster with the status information.
    emrCluster.setStatus(clusterStatus.getState());
    emrCluster.setStatusChangeReason(new StatusChangeReason(clusterStatus.getStateChangeReason().getCode(),
            clusterStatus.getStateChangeReason().getMessage()));
    emrCluster.setStatusTimeline(
            new StatusTimeline(toXmlGregorianCalendar(clusterStatus.getTimeline().getCreationDateTime()),
                    toXmlGregorianCalendar(clusterStatus.getTimeline().getReadyDateTime()),
                    toXmlGregorianCalendar(clusterStatus.getTimeline().getEndDateTime())));
}