Search in sources :

Example 1 with ResourceLocalizationSpecProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder in project hadoop by apache.

the class ResourceLocalizationSpecPBImpl method getResource.

@Override
public LocalResource getResource() {
    ResourceLocalizationSpecProtoOrBuilder p = viaProto ? proto : builder;
    if (resource != null) {
        return resource;
    }
    if (!p.hasResource()) {
        return null;
    }
    resource = new LocalResourcePBImpl(p.getResource());
    return resource;
}
Also used : ResourceLocalizationSpecProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder) LocalResourcePBImpl(org.apache.hadoop.yarn.api.records.impl.pb.LocalResourcePBImpl)

Example 2 with ResourceLocalizationSpecProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder in project hadoop by apache.

the class ResourceLocalizationSpecPBImpl method mergeLocalToBuilder.

private void mergeLocalToBuilder() {
    ResourceLocalizationSpecProtoOrBuilder l = viaProto ? proto : builder;
    if (this.resource != null && !(l.getResource().equals(((LocalResourcePBImpl) resource).getProto()))) {
        maybeInitBuilder();
        builder.setResource(((LocalResourcePBImpl) resource).getProto());
    }
    if (this.destinationDirectory != null && !(l.getDestinationDirectory().equals(((URLPBImpl) destinationDirectory).getProto()))) {
        maybeInitBuilder();
        builder.setDestinationDirectory(((URLPBImpl) destinationDirectory).getProto());
    }
}
Also used : ResourceLocalizationSpecProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder) LocalResourcePBImpl(org.apache.hadoop.yarn.api.records.impl.pb.LocalResourcePBImpl) URLPBImpl(org.apache.hadoop.yarn.api.records.impl.pb.URLPBImpl)

Example 3 with ResourceLocalizationSpecProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder in project hadoop by apache.

the class ResourceLocalizationSpecPBImpl method getDestinationDirectory.

@Override
public URL getDestinationDirectory() {
    ResourceLocalizationSpecProtoOrBuilder p = viaProto ? proto : builder;
    if (destinationDirectory != null) {
        return destinationDirectory;
    }
    if (!p.hasDestinationDirectory()) {
        return null;
    }
    destinationDirectory = new URLPBImpl(p.getDestinationDirectory());
    return destinationDirectory;
}
Also used : ResourceLocalizationSpecProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder) URLPBImpl(org.apache.hadoop.yarn.api.records.impl.pb.URLPBImpl)

Aggregations

ResourceLocalizationSpecProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.ResourceLocalizationSpecProtoOrBuilder)3 LocalResourcePBImpl (org.apache.hadoop.yarn.api.records.impl.pb.LocalResourcePBImpl)2 URLPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.URLPBImpl)2