Example usage for org.apache.hadoop.yarn.api.records.timeline TimelineEntities getEntities

List of usage examples for org.apache.hadoop.yarn.api.records.timeline TimelineEntities getEntities

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.records.timeline TimelineEntities getEntities.

Prototype

@XmlElement(name = "entities")
public List<TimelineEntity> getEntities() 

Source Link

Document

Get a list of entities

Usage

From source file:org.Microsoft.Telemetry.IntermediateHistoryStore.java

License:Open Source License

/**
 * This method is Main of My Project , this IntermediateHistoryStore class
 * extends TimelineStore of yarn and Override all function To pass the
 * information of each job to Timeline Storage original And This project
 * takes the Intermediate information and pulls out What is important and
 * sends the information as Telemetry to Application Insights Any errors
 * occurring for individual put request objects will be reported in the
 * response./*from ww  w  .j  av  a2s  . c  om*/
 *
 * @param data a {@link TimelineEntities} object.
 * @return a {@link TimelinePutResponse} object.
 * @throws IOException
 */
@Override
public TimelinePutResponse put(TimelineEntities data) throws IOException {

    TimelinePutResponse response = null;

    try {

        if (originalStorage != null) {
            response = originalStorage.put(data);
        }

        if (data != null) {

            if (data.getEntities().size() > 0) {
                for (TimelineEntity entity : data.getEntities()) {

                    if (entity != null) {

                        serviceInformation.SendInfoToApplicationInsights(entity);
                        //putToLog(entity);
                    }
                }
            }
        }

    } catch (IOException e) {

        String message = PATTERN_LOG_ERROR + "Creating a problem while send TimelineEntity ";
        LOG.error(message, e);

    } catch (Exception ex) {

        String message = PATTERN_LOG_ERROR + "Creating a problem while send TimelineEntity ";
        LOG.error(message, ex);
    }

    return response;
}