Search in sources :

Example 1 with NodeLabelProto

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

the class NodeHeartbeatRequestPBImpl method initNodeLabels.

private void initNodeLabels() {
    if (this.labels != null) {
        return;
    }
    NodeHeartbeatRequestProtoOrBuilder p = viaProto ? proto : builder;
    if (!p.hasNodeLabels()) {
        labels = null;
        return;
    }
    NodeLabelsProto nodeLabels = p.getNodeLabels();
    labels = new HashSet<NodeLabel>();
    for (NodeLabelProto nlp : nodeLabels.getNodeLabelsList()) {
        labels.add(convertFromProtoFormat(nlp));
    }
}
Also used : NodeLabelsProto(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto) NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) NodeLabelProto(org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto) NodeHeartbeatRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeHeartbeatRequestProtoOrBuilder)

Example 2 with NodeLabelProto

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

the class GetClusterNodeLabelsResponsePBImpl method initLocalNodeLabels.

private void initLocalNodeLabels() {
    GetClusterNodeLabelsResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<NodeLabelProto> attributesProtoList = p.getNodeLabelsList();
    this.updatedNodeLabels = new ArrayList<NodeLabel>();
    for (NodeLabelProto r : attributesProtoList) {
        this.updatedNodeLabels.add(convertFromProtoFormat(r));
    }
}
Also used : GetClusterNodeLabelsResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodeLabelsResponseProtoOrBuilder) NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) NodeLabelProto(org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto)

Example 3 with NodeLabelProto

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

the class GetClusterNodeLabelsResponsePBImpl method addNodeLabelsToProto.

private void addNodeLabelsToProto() {
    maybeInitBuilder();
    builder.clearNodeLabels();
    builder.clearDeprecatedNodeLabels();
    List<NodeLabelProto> protoList = new ArrayList<NodeLabelProto>();
    List<String> protoListString = new ArrayList<String>();
    for (NodeLabel r : this.updatedNodeLabels) {
        protoList.add(convertToProtoFormat(r));
        protoListString.add(r.getName());
    }
    builder.addAllNodeLabels(protoList);
    builder.addAllDeprecatedNodeLabels(protoListString);
}
Also used : NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) ArrayList(java.util.ArrayList) NodeLabelProto(org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto)

Example 4 with NodeLabelProto

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

the class AddToClusterNodeLabelsRequestPBImpl method addNodeLabelsToProto.

private void addNodeLabelsToProto() {
    maybeInitBuilder();
    builder.clearNodeLabels();
    builder.clearDeprecatedNodeLabels();
    List<NodeLabelProto> protoList = new ArrayList<NodeLabelProto>();
    List<String> protoListString = new ArrayList<String>();
    for (NodeLabel r : this.updatedNodeLabels) {
        protoList.add(convertToProtoFormat(r));
        protoListString.add(r.getName());
    }
    builder.addAllNodeLabels(protoList);
    builder.addAllDeprecatedNodeLabels(protoListString);
}
Also used : NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) ArrayList(java.util.ArrayList) NodeLabelProto(org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto)

Example 5 with NodeLabelProto

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

the class AddToClusterNodeLabelsRequestPBImpl method initLocalNodeLabels.

private void initLocalNodeLabels() {
    AddToClusterNodeLabelsRequestProtoOrBuilder p = viaProto ? proto : builder;
    List<NodeLabelProto> attributesProtoList = p.getNodeLabelsList();
    this.updatedNodeLabels = new ArrayList<NodeLabel>();
    for (NodeLabelProto r : attributesProtoList) {
        this.updatedNodeLabels.add(convertFromProtoFormat(r));
    }
}
Also used : NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) AddToClusterNodeLabelsRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.AddToClusterNodeLabelsRequestProtoOrBuilder) NodeLabelProto(org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto)

Aggregations

NodeLabel (org.apache.hadoop.yarn.api.records.NodeLabel)6 NodeLabelProto (org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto)6 ArrayList (java.util.ArrayList)2 NodeLabelsProto (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto)2 NodeHeartbeatRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeHeartbeatRequestProtoOrBuilder)1 RegisterNodeManagerRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.RegisterNodeManagerRequestProtoOrBuilder)1 AddToClusterNodeLabelsRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.AddToClusterNodeLabelsRequestProtoOrBuilder)1 GetClusterNodeLabelsResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodeLabelsResponseProtoOrBuilder)1