Search in sources :

Example 1 with GetNodesToLabelsResponseProtoOrBuilder

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

the class GetNodesToLabelsResponsePBImpl method initNodeToLabels.

private void initNodeToLabels() {
    if (this.nodeToLabels != null) {
        return;
    }
    GetNodesToLabelsResponseProtoOrBuilder p = viaProto ? proto : builder;
    List<NodeIdToLabelsProto> list = p.getNodeToLabelsList();
    this.nodeToLabels = new HashMap<NodeId, Set<String>>();
    for (NodeIdToLabelsProto c : list) {
        this.nodeToLabels.put(new NodeIdPBImpl(c.getNodeId()), Sets.newHashSet(c.getNodeLabelsList()));
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) GetNodesToLabelsResponseProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNodesToLabelsResponseProtoOrBuilder) 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

HashSet (java.util.HashSet)1 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 GetNodesToLabelsResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNodesToLabelsResponseProtoOrBuilder)1