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

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

Introduction

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

Prototype


public ClusterTimeline getTimeline() 

Source Link

Document

A timeline that represents the status of a cluster over the lifetime 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  w w .j a va  2 s .  c  om*/
 * @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())));
}