org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto Java Examples

The following examples show how to use org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GetLabelsToNodesResponsePBImpl.java    From big-c with Apache License 2.0 6 votes vote down vote up
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);
    }
  }
}
 
Example #2
Source File: GetLabelsToNodesResponsePBImpl.java    From hadoop with Apache License 2.0 6 votes vote down vote up
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);
    }
  }
}
 
Example #3
Source File: OfferLifeCycleManagerTest.java    From incubator-myriad with Apache License 2.0 5 votes vote down vote up
@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()));
}
 
Example #4
Source File: NMTokenPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private synchronized NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
 
Example #5
Source File: ContainerStartDataPBImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto nodeId) {
  return new NodeIdPBImpl(nodeId);
}
 
Example #6
Source File: GetLabelsToNodesResponsePBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private void addLabelsToNodesToProto() {
  maybeInitBuilder();
  builder.clearLabelsToNodes();
  if (labelsToNodes == null) {
    return;
  }
  Iterable<LabelsToNodeIdsProto> iterable =
      new Iterable<LabelsToNodeIdsProto>() {
        @Override
        public Iterator<LabelsToNodeIdsProto> iterator() {
          return new Iterator<LabelsToNodeIdsProto>() {

            Iterator<Entry<String, Set<NodeId>>> iter =
                labelsToNodes.entrySet().iterator();

            @Override
            public void remove() {
              throw new UnsupportedOperationException();
            }

            @Override
            public LabelsToNodeIdsProto next() {
              Entry<String, Set<NodeId>> now = iter.next();
              Set<NodeIdProto> nodeProtoSet = new HashSet<NodeIdProto>();
              for(NodeId n : now.getValue()) {
                nodeProtoSet.add(convertToProtoFormat(n));
              }
              return LabelsToNodeIdsProto.newBuilder()
                  .setNodeLabels(now.getKey()).addAllNodeId(nodeProtoSet)
                  .build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllLabelsToNodes(iterable);
}
 
Example #7
Source File: GetLabelsToNodesResponsePBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
 
Example #8
Source File: GetNodesToLabelsResponsePBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
 
Example #9
Source File: ContainerPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
Example #10
Source File: ContainerPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
 
Example #11
Source File: NodeIdPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
public NodeIdPBImpl() {
  builder = NodeIdProto.newBuilder();
}
 
Example #12
Source File: NodeIdPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
public NodeIdPBImpl(NodeIdProto proto) {
  this.proto = proto;
}
 
Example #13
Source File: NodeIdPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
public NodeIdProto getProto() {
  return proto;
}
 
Example #14
Source File: NodeReportPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
Example #15
Source File: NodeReportPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl) nodeId).getProto();
}
 
Example #16
Source File: NMTokenPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private synchronized NodeId convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
Example #17
Source File: ContainerStartDataPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto nodeId) {
  return new NodeIdPBImpl(nodeId);
}
 
Example #18
Source File: ProtoUtils.java    From big-c with Apache License 2.0 4 votes vote down vote up
public static NodeIdProto convertToProtoFormat(NodeId e) {
  return ((NodeIdPBImpl)e).getProto();
}
 
Example #19
Source File: ProtoUtils.java    From big-c with Apache License 2.0 4 votes vote down vote up
public static NodeId convertFromProtoFormat(NodeIdProto e) {
  return new NodeIdPBImpl(e);
}
 
Example #20
Source File: ContainerReportPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
Example #21
Source File: ContainerReportPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl) t).getProto();
}
 
Example #22
Source File: ReplaceLabelsOnNodeRequestPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl) t).getProto();
}
 
Example #23
Source File: UpdateNodeResourceRequestPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
 
Example #24
Source File: UpdateNodeResourceRequestPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeId convertFromProtoFormat(NodeIdProto proto) {
  return new NodeIdPBImpl(proto);
}
 
Example #25
Source File: RegisterNodeManagerRequestPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
Example #26
Source File: RegisterNodeManagerRequestPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
 
Example #27
Source File: NodeStatusPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
 
Example #28
Source File: NodeStatusPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeId convertFromProtoFormat(NodeIdProto proto) {
  return new NodeIdPBImpl(proto);
}
 
Example #29
Source File: ContainerStartDataPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl) nodeId).getProto();
}
 
Example #30
Source File: NMTokenPBImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private synchronized NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}