Java 类org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto 实例源码

项目:hadoop    文件:GetLabelsToNodesResponsePBImpl.java   
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);
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:GetLabelsToNodesResponsePBImpl.java   
private void initLabelsToNodes() {
  if (this.labelsToNodes != null) {
    return;
  }
  GetLabelsToNodesResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<LabelsToNodeIdsProto> list = p.getLabelsToNodesList();
  this.labelsToNodes = new HashMap<NodeLabel, 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(new NodeLabelPBImpl(c.getNodeLabels()), setNodes);
    }
  }
}
项目:big-c    文件:GetLabelsToNodesResponsePBImpl.java   
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);
    }
  }
}
项目:hops    文件:GetLabelsToNodesResponsePBImpl.java   
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);
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:CheckForDecommissioningNodesResponsePBImpl.java   
private void addDecommissioningNodesToProto() {
  maybeInitBuilder();
  builder.clearDecommissioningNodes();
  if (this.decommissioningNodes == null)
    return;
  Set<NodeIdProto> nodeIdProtos = new HashSet<NodeIdProto>();
  for (NodeId nodeId : decommissioningNodes) {
    nodeIdProtos.add(convertToProtoFormat(nodeId));
  }
  builder.addAllDecommissioningNodes(nodeIdProtos);
}
项目:aliyun-oss-hadoop-fs    文件:CheckForDecommissioningNodesResponsePBImpl.java   
private void initNodesDecommissioning() {
  if (this.decommissioningNodes != null) {
    return;
  }
  CheckForDecommissioningNodesResponseProtoOrBuilder p = viaProto ? proto
      : builder;
  List<NodeIdProto> nodeIds = p.getDecommissioningNodesList();
  this.decommissioningNodes = new HashSet<NodeId>();
  for (NodeIdProto nodeIdProto : nodeIds) {
    this.decommissioningNodes.add(convertFromProtoFormat(nodeIdProto));
  }
}
项目:hops    文件:CheckForDecommissioningNodesResponsePBImpl.java   
private void addDecommissioningNodesToProto() {
  maybeInitBuilder();
  builder.clearDecommissioningNodes();
  if (this.decommissioningNodes == null)
    return;
  Set<NodeIdProto> nodeIdProtos = new HashSet<NodeIdProto>();
  for (NodeId nodeId : decommissioningNodes) {
    nodeIdProtos.add(convertToProtoFormat(nodeId));
  }
  builder.addAllDecommissioningNodes(nodeIdProtos);
}
项目:hops    文件:CheckForDecommissioningNodesResponsePBImpl.java   
private void initNodesDecommissioning() {
  if (this.decommissioningNodes != null) {
    return;
  }
  CheckForDecommissioningNodesResponseProtoOrBuilder p = viaProto ? proto
      : builder;
  List<NodeIdProto> nodeIds = p.getDecommissioningNodesList();
  this.decommissioningNodes = new HashSet<NodeId>();
  for (NodeIdProto nodeIdProto : nodeIds) {
    this.decommissioningNodes.add(convertFromProtoFormat(nodeIdProto));
  }
}
项目:incubator-myriad    文件:OfferLifeCycleManagerTest.java   
@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()));
}
项目:hadoop    文件:GetLabelsToNodesResponsePBImpl.java   
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);
}
项目:hadoop    文件:GetLabelsToNodesResponsePBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:hadoop    文件:GetNodesToLabelsResponsePBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:hadoop    文件:ContainerPBImpl.java   
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
项目:hadoop    文件:ContainerPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:hadoop    文件:NodeIdPBImpl.java   
public NodeIdPBImpl() {
  builder = NodeIdProto.newBuilder();
}
项目:hadoop    文件:NodeIdPBImpl.java   
public NodeIdPBImpl(NodeIdProto proto) {
  this.proto = proto;
}
项目:hadoop    文件:NodeIdPBImpl.java   
public NodeIdProto getProto() {
  return proto;
}
项目:hadoop    文件:NodeReportPBImpl.java   
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
项目:hadoop    文件:NodeReportPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl) nodeId).getProto();
}
项目:hadoop    文件:NMTokenPBImpl.java   
private synchronized NodeId convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
项目:hadoop    文件:NMTokenPBImpl.java   
private synchronized NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
项目:hadoop    文件:ProtoUtils.java   
public static NodeIdProto convertToProtoFormat(NodeId e) {
  return ((NodeIdPBImpl)e).getProto();
}
项目:hadoop    文件:ProtoUtils.java   
public static NodeId convertFromProtoFormat(NodeIdProto e) {
  return new NodeIdPBImpl(e);
}
项目:hadoop    文件:ContainerReportPBImpl.java   
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
项目:hadoop    文件:ContainerReportPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl) t).getProto();
}
项目:hadoop    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl) t).getProto();
}
项目:hadoop    文件:UpdateNodeResourceRequestPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
项目:hadoop    文件:UpdateNodeResourceRequestPBImpl.java   
private NodeId convertFromProtoFormat(NodeIdProto proto) {
  return new NodeIdPBImpl(proto);
}
项目:hadoop    文件:RegisterNodeManagerRequestPBImpl.java   
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
项目:hadoop    文件:RegisterNodeManagerRequestPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:hadoop    文件:NodeStatusPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
项目:hadoop    文件:NodeStatusPBImpl.java   
private NodeId convertFromProtoFormat(NodeIdProto proto) {
  return new NodeIdPBImpl(proto);
}
项目:hadoop    文件:ContainerStartDataPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl) nodeId).getProto();
}
项目:hadoop    文件:ContainerStartDataPBImpl.java   
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto nodeId) {
  return new NodeIdPBImpl(nodeId);
}
项目:aliyun-oss-hadoop-fs    文件:GetLabelsToNodesResponsePBImpl.java   
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<NodeLabel, Set<NodeId>>> iter =
                labelsToNodes.entrySet().iterator();

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

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

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllLabelsToNodes(iterable);
}
项目:aliyun-oss-hadoop-fs    文件:GetLabelsToNodesResponsePBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:GetNodesToLabelsResponsePBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:ContainerPBImpl.java   
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
项目:aliyun-oss-hadoop-fs    文件:ContainerPBImpl.java   
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:NodeIdPBImpl.java   
public NodeIdPBImpl() {
  builder = NodeIdProto.newBuilder();
}