Search in sources :

Example 1 with ContainerStatusProto

use of org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto 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 2 with ContainerStatusProto

use of org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto in project hadoop by apache.

the class GetContainerStatusesResponsePBImpl method addLocalContainerStatusesToProto.

private void addLocalContainerStatusesToProto() {
    maybeInitBuilder();
    builder.clearStatus();
    if (this.containerStatuses == null)
        return;
    List<ContainerStatusProto> protoList = new ArrayList<ContainerStatusProto>();
    for (ContainerStatus status : containerStatuses) {
        protoList.add(convertToProtoFormat(status));
    }
    builder.addAllStatus(protoList);
}
Also used : ContainerStatusProto(org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto) ContainerStatus(org.apache.hadoop.yarn.api.records.ContainerStatus) ArrayList(java.util.ArrayList)

Example 3 with ContainerStatusProto

use of org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto in project hadoop by apache.

the class GetContainerStatusesResponsePBImpl method initLocalContainerStatuses.

private void initLocalContainerStatuses() {
    if (this.containerStatuses != null) {
        return;
    }
    GetContainerStatusesResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<ContainerStatusProto> statuses = p.getStatusList();
    this.containerStatuses = new ArrayList<ContainerStatus>();
    for (ContainerStatusProto status : statuses) {
        this.containerStatuses.add(convertFromProtoFormat(status));
    }
}
Also used : ContainerStatusProto(org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto) ContainerStatus(org.apache.hadoop.yarn.api.records.ContainerStatus) GetContainerStatusesResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusesResponseProtoOrBuilder)

Example 4 with ContainerStatusProto

use of org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto in project hadoop by apache.

the class NodeStatusPBImpl method initContainers.

private synchronized void initContainers() {
    if (this.containers != null) {
        return;
    }
    NodeStatusProtoOrBuilder p = viaProto ? proto : builder;
    List<ContainerStatusProto> list = p.getContainersStatusesList();
    this.containers = new ArrayList<ContainerStatus>();
    for (ContainerStatusProto c : list) {
        this.containers.add(convertFromProtoFormat(c));
    }
}
Also used : ContainerStatusProto(org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto) ContainerStatus(org.apache.hadoop.yarn.api.records.ContainerStatus) NodeStatusProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerCommonProtos.NodeStatusProtoOrBuilder)

Aggregations

ContainerStatus (org.apache.hadoop.yarn.api.records.ContainerStatus)4 ContainerStatusProto (org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto)4 ArrayList (java.util.ArrayList)1 NodeStatusProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonProtos.NodeStatusProtoOrBuilder)1 AllocateResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.AllocateResponseProtoOrBuilder)1 GetContainerStatusesResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusesResponseProtoOrBuilder)1