use of org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl in project hadoop by apache.
the class GetLabelsToNodesResponsePBImpl method initLabelsToNodes.
private void initLabelsToNodes() {
if (this.labelsToNodes != null) {
return;
}
GetLabelsToNodesResponseProtoOrBuilder p = viaProto ? proto : builder;
List<LabelsToNodeIdsProto> list = p.getLabelsToNodesList();
this.labelsToNodes = new HashMap<String, Set<NodeId>>();
for (LabelsToNodeIdsProto c : list) {
Set<NodeId> setNodes = new HashSet<NodeId>();
for (NodeIdProto n : c.getNodeIdList()) {
NodeId node = new NodeIdPBImpl(n);
setNodes.add(node);
}
if (!setNodes.isEmpty()) {
this.labelsToNodes.put(c.getNodeLabels(), setNodes);
}
}
}
use of org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl 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()));
}
}
use of org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl 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()));
}
}
use of org.apache.hadoop.yarn.api.records.impl.pb.NodeIdPBImpl in project incubator-myriad by apache.
the class OfferLifeCycleManagerTest method setUp.
@Before
public void setUp() throws Exception {
NodeStore store = new NodeStore();
NodeIdProto nodeId = NodeIdProto.newBuilder().setHost("localhost").setPort(8000).build();
RMNode rmNode = new RMNodeImpl(new NodeIdPBImpl(nodeId), new MockRMContext(), "localhost", 8000, 8070, new NodeBase(), new ResourcePBImpl(), "1.0");
SchedulerNode node = new FiCaSchedulerNode(rmNode, false);
store.add(node);
manager = new OfferLifecycleManager(store, new MyriadDriver(new MockSchedulerDriver()));
}
Aggregations