当前位置: 首页>>代码示例>>Java>>正文


Java NodeIdProto类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto的典型用法代码示例。如果您正苦于以下问题:Java NodeIdProto类的具体用法?Java NodeIdProto怎么用?Java NodeIdProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NodeIdProto类属于org.apache.hadoop.yarn.proto.YarnProtos包,在下文中一共展示了NodeIdProto类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initLabelsToNodes

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
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);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:GetLabelsToNodesResponsePBImpl.java

示例2: initLabelsToNodes

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
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);
    }
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:GetLabelsToNodesResponsePBImpl.java

示例3: initLabelsToNodes

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
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);
    }
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:21,代码来源:GetLabelsToNodesResponsePBImpl.java

示例4: addDecommissioningNodesToProto

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
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);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:12,代码来源:CheckForDecommissioningNodesResponsePBImpl.java

示例5: initNodesDecommissioning

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
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));
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:13,代码来源:CheckForDecommissioningNodesResponsePBImpl.java

示例6: setUp

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
@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()));
}
 
开发者ID:apache,项目名称:incubator-myriad,代码行数:11,代码来源:OfferLifeCycleManagerTest.java

示例7: addLabelsToNodesToProto

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:42,代码来源:GetLabelsToNodesResponsePBImpl.java

示例8: convertToProtoFormat

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
private NodeIdProto convertToProtoFormat(NodeId t) {
  return ((NodeIdPBImpl)t).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:GetLabelsToNodesResponsePBImpl.java

示例9: convertFromProtoFormat

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
private NodeIdPBImpl convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:ContainerPBImpl.java

示例10: NodeIdPBImpl

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
public NodeIdPBImpl() {
  builder = NodeIdProto.newBuilder();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:NodeIdPBImpl.java

示例11: getProto

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
public NodeIdProto getProto() {
  return proto;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:NodeIdPBImpl.java

示例12: convertToProtoFormat

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
private NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl) nodeId).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:NodeReportPBImpl.java

示例13: convertFromProtoFormat

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
private synchronized NodeId convertFromProtoFormat(NodeIdProto p) {
  return new NodeIdPBImpl(p);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:NMTokenPBImpl.java

示例14: convertToProtoFormat

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
private synchronized NodeIdProto convertToProtoFormat(NodeId nodeId) {
  return ((NodeIdPBImpl)nodeId).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:NMTokenPBImpl.java

示例15: convertToProtoFormat

import org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto; //导入依赖的package包/类
public static NodeIdProto convertToProtoFormat(NodeId e) {
  return ((NodeIdPBImpl)e).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:ProtoUtils.java


注:本文中的org.apache.hadoop.yarn.proto.YarnProtos.NodeIdProto类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。