Java Code Examples for org.apache.hadoop.yarn.api.records.LocalResource#getPattern()
The following examples show how to use
org.apache.hadoop.yarn.api.records.LocalResource#getPattern() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DagTypeConverters.java From incubator-tez with Apache License 2.0 | 6 votes |
public static PlanLocalResource convertLocalResourceToPlanLocalResource( String name, LocalResource lr) { PlanLocalResource.Builder localResourcesBuilder = PlanLocalResource.newBuilder(); localResourcesBuilder.setName(name); localResourcesBuilder.setUri( DagTypeConverters.convertToDAGPlan(lr.getResource())); localResourcesBuilder.setSize(lr.getSize()); localResourcesBuilder.setTimeStamp(lr.getTimestamp()); localResourcesBuilder.setType( DagTypeConverters.convertToDAGPlan(lr.getType())); localResourcesBuilder.setVisibility( DagTypeConverters.convertToDAGPlan(lr.getVisibility())); if (lr.getType() == LocalResourceType.PATTERN) { if (lr.getPattern() == null || lr.getPattern().isEmpty()) { throw new TezUncheckedException("LocalResource type set to pattern" + " but pattern is null or empty"); } localResourcesBuilder.setPattern(lr.getPattern()); } return localResourcesBuilder.build(); }
Example 2
Source File: DagTypeConverters.java From tez with Apache License 2.0 | 6 votes |
public static List<PlanLocalResource> convertToDAGPlan(Map<String, LocalResource> lrs) { List<PlanLocalResource> planLrs = Lists.newArrayListWithCapacity(lrs.size()); for (Entry<String, LocalResource> entry : lrs.entrySet()) { PlanLocalResource.Builder localResourcesBuilder = PlanLocalResource.newBuilder(); String key = entry.getKey(); LocalResource lr = entry.getValue(); localResourcesBuilder.setName(key); localResourcesBuilder.setUri( DagTypeConverters.convertToDAGPlan(lr.getResource())); localResourcesBuilder.setSize(lr.getSize()); localResourcesBuilder.setTimeStamp(lr.getTimestamp()); localResourcesBuilder.setType( DagTypeConverters.convertToDAGPlan(lr.getType())); localResourcesBuilder.setVisibility( DagTypeConverters.convertToDAGPlan(lr.getVisibility())); if (lr.getType() == LocalResourceType.PATTERN) { if (lr.getPattern() == null || lr.getPattern().isEmpty()) { throw new TezUncheckedException("LocalResource type set to pattern" + " but pattern is null or empty"); } localResourcesBuilder.setPattern(lr.getPattern()); } planLrs.add(localResourcesBuilder.build()); } return planLrs; }
Example 3
Source File: DagTypeConverters.java From tez with Apache License 2.0 | 6 votes |
public static PlanLocalResource convertLocalResourceToPlanLocalResource( String name, LocalResource lr) { PlanLocalResource.Builder localResourcesBuilder = PlanLocalResource.newBuilder(); localResourcesBuilder.setName(name); localResourcesBuilder.setUri( DagTypeConverters.convertToDAGPlan(lr.getResource())); localResourcesBuilder.setSize(lr.getSize()); localResourcesBuilder.setTimeStamp(lr.getTimestamp()); localResourcesBuilder.setType( DagTypeConverters.convertToDAGPlan(lr.getType())); localResourcesBuilder.setVisibility( DagTypeConverters.convertToDAGPlan(lr.getVisibility())); if (lr.getType() == LocalResourceType.PATTERN) { if (lr.getPattern() == null || lr.getPattern().isEmpty()) { throw new TezUncheckedException("LocalResource type set to pattern" + " but pattern is null or empty"); } localResourcesBuilder.setPattern(lr.getPattern()); } return localResourcesBuilder.build(); }
Example 4
Source File: LocalResourceRequest.java From hadoop with Apache License 2.0 | 5 votes |
/** * Wrap API resource to match against cache of localized resources. * @param resource Resource requested by container * @throws URISyntaxException If the path is malformed */ public LocalResourceRequest(LocalResource resource) throws URISyntaxException { this(ConverterUtils.getPathFromYarnURL(resource.getResource()), resource.getTimestamp(), resource.getType(), resource.getVisibility(), resource.getPattern()); }
Example 5
Source File: LocalResourceRequest.java From big-c with Apache License 2.0 | 5 votes |
/** * Wrap API resource to match against cache of localized resources. * @param resource Resource requested by container * @throws URISyntaxException If the path is malformed */ public LocalResourceRequest(LocalResource resource) throws URISyntaxException { this(ConverterUtils.getPathFromYarnURL(resource.getResource()), resource.getTimestamp(), resource.getType(), resource.getVisibility(), resource.getPattern()); }