Example usage for org.apache.hadoop.yarn.server.timeline NameValuePair getValue

List of usage examples for org.apache.hadoop.yarn.server.timeline NameValuePair getValue

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.server.timeline NameValuePair getValue.

Prototype

public Object getValue() 

Source Link

Document

Get the value.

Usage

From source file:org.apache.spark.deploy.history.yarn.plugin.SparkATSPlugin.java

License:Apache License

@Override
public Set<TimelineEntityGroupId> getTimelineEntityGroupId(String entityType, NameValuePair filter,
        Collection<NameValuePair> secondaryFilters) {
    LOG.debug("getTimelineEntityGroupId({}, [{}]", entityType, filter);

    Set<TimelineEntityGroupId> result = null;
    try {/*  ww w. j av a  2  s . c o  m*/
        if (entityType.equals(SPARK_DETAIL_ENTITY_TYPE) && filter != null) {
            String value = filter.getValue().toString();
            switch (filter.getName()) {
            case FIELD_APPLICATION_ID:
                result = toGroupId(value);
                break;
            case FIELD_ATTEMPT_ID:
                result = toGroupId(value);
                break;
            default:
                // no-op
            }
        }
    } catch (Exception e) {
        LOG.error("Failed to process entity type {} and primary filter {}", entityType, filter, e);
        throw new IllegalArgumentException(e);
    }
    return result;
}

From source file:org.apache.tez.dag.history.logging.ats.TimelineCachePluginImpl.java

License:Apache License

@Override
public Set<TimelineEntityGroupId> getTimelineEntityGroupId(String entityType, NameValuePair primaryFilter,
        Collection<NameValuePair> secondaryFilters) {
    if (!knownEntityTypes.contains(entityType) || primaryFilter == null
            || !knownEntityTypes.contains(primaryFilter.getName()) || summaryEntityTypes.contains(entityType)) {
        return null;
    }/*from   ww  w. j a v a 2  s  . c om*/
    TimelineEntityGroupId groupId = convertToTimelineEntityGroupId(primaryFilter.getName(),
            primaryFilter.getValue().toString());
    if (groupId != null) {
        TimelineEntityGroupId appGroupId = TimelineEntityGroupId.newInstance(groupId.getApplicationId(),
                groupId.getApplicationId().toString());
        return Sets.newHashSet(groupId, appGroupId);
    }
    return null;
}