Package org.apache.hadoop.yarn.api.records.impl.pb

Examples of org.apache.hadoop.yarn.api.records.impl.pb.LocalResourcePBImpl


  public static Map<String, LocalResource> createLocalResourceMapFromDAGPlan(
      List<PlanLocalResource> localResourcesList) {
    Map<String, LocalResource> map = new HashMap<String, LocalResource>();
    for(PlanLocalResource res : localResourcesList){
      LocalResource r = new LocalResourcePBImpl();

      //NOTE: have to check every optional field in protobuf generated classes for existence before accessing
      //else we will receive a default value back, eg ""
      if(res.hasPattern()){
        r.setPattern(res.getPattern());
      }
      r.setResource(ConverterUtils.getYarnUrlFromPath(new Path(res.getUri())))// see above notes on HDFS URL handling
      r.setSize(res.getSize());
      r.setTimestamp(res.getTimeStamp());
      r.setType(DagTypeConverters.convertFromDAGPlan(res.getType()));
      r.setVisibility(DagTypeConverters.convertFromDAGPlan(res.getVisibility()));
      map.put(res.getName(), r);
    }
    return map;
  }
View Full Code Here


  private LocalResourceProto convertToProtoFormat(LocalResource rsrc) {
    return ((LocalResourcePBImpl)rsrc).getProto();
  }

  private LocalResourcePBImpl convertFromProtoFormat(LocalResourceProto rsrc) {
    return new LocalResourcePBImpl(rsrc);
  }
View Full Code Here

    initResources();
    this.resources.clear();
  }

  private LocalResource convertFromProtoFormat(LocalResourceProto p) {
    return new LocalResourcePBImpl(p);
  }
View Full Code Here

  private LocalResourceProto convertToProtoFormat(LocalResource rsrc) {
    return ((LocalResourcePBImpl)rsrc).getProto();
  }

  private LocalResourcePBImpl convertFromProtoFormat(LocalResourceProto rsrc) {
    return new LocalResourcePBImpl(rsrc);
  }
View Full Code Here

      return resource;
    }
    if (!p.hasResource()) {
      return null;
    }
    resource = new LocalResourcePBImpl(p.getResource());
    return resource;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.api.records.impl.pb.LocalResourcePBImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.