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

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

Introduction

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

Prototype

public String getName() 

Source Link

Document

Get the name.

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  a v a  2s.c  om
        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  .ja  v  a2s . 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;
}