Search in sources :

Example 1 with AllocateResponseProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder in project hadoop by apache.

the class AllocateResponsePBImpl method initLocalUpdatedContainerList.

private synchronized void initLocalUpdatedContainerList() {
    if (this.updatedContainers != null) {
        return;
    }
    AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<YarnServiceProtos.UpdatedContainerProto> list = p.getUpdatedContainersList();
    updatedContainers = new ArrayList<>();
    for (YarnServiceProtos.UpdatedContainerProto c : list) {
        updatedContainers.add(convertFromProtoFormat(c));
    }
}
Also used : AllocateResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder) YarnServiceProtos(org.apache.hadoop.yarn.proto.YarnServiceProtos)

Example 2 with AllocateResponseProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder in project hadoop by apache.

the class AllocateResponsePBImpl method initLocalFinishedContainerList.

// Once this is called. containerList will never be null - until a getProto
// is called.
private synchronized void initLocalFinishedContainerList() {
    if (this.completedContainersStatuses != null) {
        return;
    }
    AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<ContainerStatusProto> list = p.getCompletedContainerStatusesList();
    completedContainersStatuses = new ArrayList<ContainerStatus>();
    for (ContainerStatusProto c : list) {
        completedContainersStatuses.add(convertFromProtoFormat(c));
    }
}
Also used : ContainerStatusProto(org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto) ContainerStatus(org.apache.hadoop.yarn.api.records.ContainerStatus) AllocateResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder)

Example 3 with AllocateResponseProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder in project hadoop by apache.

the class AllocateResponsePBImpl method getAvailableResources.

@Override
public synchronized Resource getAvailableResources() {
    if (this.limit != null) {
        return this.limit;
    }
    AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
    if (!p.hasLimit()) {
        return null;
    }
    this.limit = convertFromProtoFormat(p.getLimit());
    return this.limit;
}
Also used : AllocateResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder)

Example 4 with AllocateResponseProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder in project hadoop by apache.

the class AllocateResponsePBImpl method initLocalNewNMTokenList.

private synchronized void initLocalNewNMTokenList() {
    if (nmTokens != null) {
        return;
    }
    AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<NMTokenProto> list = p.getNmTokensList();
    nmTokens = new ArrayList<NMToken>();
    for (NMTokenProto t : list) {
        nmTokens.add(convertFromProtoFormat(t));
    }
}
Also used : NMToken(org.apache.hadoop.yarn.api.records.NMToken) AllocateResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder) NMTokenProto(org.apache.hadoop.yarn.proto.YarnServiceProtos.NMTokenProto)

Example 5 with AllocateResponseProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder in project hadoop by apache.

the class AllocateResponsePBImpl method initLocalNewContainerList.

// Once this is called. containerList will never be null - until a getProto
// is called.
private synchronized void initLocalNewContainerList() {
    if (this.allocatedContainers != null) {
        return;
    }
    AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<ContainerProto> list = p.getAllocatedContainersList();
    allocatedContainers = new ArrayList<Container>();
    for (ContainerProto c : list) {
        allocatedContainers.add(convertFromProtoFormat(c));
    }
}
Also used : UpdatedContainer(org.apache.hadoop.yarn.api.records.UpdatedContainer) Container(org.apache.hadoop.yarn.api.records.Container) ContainerProto(org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto) AllocateResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder)

Aggregations

AllocateResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder)10 YarnServiceProtos (org.apache.hadoop.yarn.proto.YarnServiceProtos)2 Container (org.apache.hadoop.yarn.api.records.Container)1 ContainerStatus (org.apache.hadoop.yarn.api.records.ContainerStatus)1 NMToken (org.apache.hadoop.yarn.api.records.NMToken)1 NodeReport (org.apache.hadoop.yarn.api.records.NodeReport)1 UpdateContainerError (org.apache.hadoop.yarn.api.records.UpdateContainerError)1 UpdatedContainer (org.apache.hadoop.yarn.api.records.UpdatedContainer)1 ContainerProto (org.apache.hadoop.yarn.proto.YarnProtos.ContainerProto)1 ContainerStatusProto (org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto)1 NodeReportProto (org.apache.hadoop.yarn.proto.YarnProtos.NodeReportProto)1 NMTokenProto (org.apache.hadoop.yarn.proto.YarnServiceProtos.NMTokenProto)1