Search in sources :

Example 1 with ReplaceLabelsOnNodeRequestProtoOrBuilder

use of org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.ReplaceLabelsOnNodeRequestProtoOrBuilder in project hadoop by apache.

the class ReplaceLabelsOnNodeRequestPBImpl method initNodeToLabels.

private void initNodeToLabels() {
    if (this.nodeIdToLabels != null) {
        return;
    }
    ReplaceLabelsOnNodeRequestProtoOrBuilder p = viaProto ? proto : builder;
    List<NodeIdToLabelsProto> list = p.getNodeToLabelsList();
    this.nodeIdToLabels = new HashMap<NodeId, Set<String>>();
    for (NodeIdToLabelsProto c : list) {
        this.nodeIdToLabels.put(new NodeIdPBImpl(c.getNodeId()), Sets.newHashSet(c.getNodeLabelsList()));
    }
}
Also used : ReplaceLabelsOnNodeRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.ReplaceLabelsOnNodeRequestProtoOrBuilder) Set(java.util.Set) NodeId(org.apache.hadoop.yarn.api.records.NodeId) NodeIdPBImpl(org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl) NodeIdToLabelsProto(org.apache.hadoop.yarn.proto.YarnProtos.NodeIdToLabelsProto)

Aggregations

Set (java.util.Set)1 NodeId (org.apache.hadoop.yarn.api.records.NodeId)1 NodeIdPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl)1 NodeIdToLabelsProto (org.apache.hadoop.yarn.proto.YarnProtos.NodeIdToLabelsProto)1 ReplaceLabelsOnNodeRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.ReplaceLabelsOnNodeRequestProtoOrBuilder)1