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

项目:hadoop    文件:UpdateNodeResourceRequestPBImpl.java   
private void initNodeResourceMap() {
  if (this.nodeResourceMap != null) {
    return;
  }
  UpdateNodeResourceRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<NodeResourceMapProto> list = p.getNodeResourceMapList();
  this.nodeResourceMap = new HashMap<NodeId, ResourceOption>(list
      .size());
  for (NodeResourceMapProto nodeResourceProto : list) {
    this.nodeResourceMap.put(convertFromProtoFormat(nodeResourceProto.getNodeId()), 
        convertFromProtoFormat(nodeResourceProto.getResourceOption()));
  }
}
项目:hadoop    文件:UpdateNodeResourceRequestPBImpl.java   
private void addNodeResourceMap() {
  maybeInitBuilder();
  builder.clearNodeResourceMap();
  if (nodeResourceMap == null) {
    return;
  }
  Iterable<? extends NodeResourceMapProto> values
      = new Iterable<NodeResourceMapProto>() {

    @Override
    public Iterator<NodeResourceMapProto> iterator() {
      return new Iterator<NodeResourceMapProto>() {
        Iterator<NodeId> nodeIterator = nodeResourceMap
            .keySet().iterator();

        @Override
        public boolean hasNext() {
          return nodeIterator.hasNext();
        }

        @Override
        public NodeResourceMapProto next() {
          NodeId nodeId = nodeIterator.next();
          return NodeResourceMapProto.newBuilder().setNodeId(
              convertToProtoFormat(nodeId)).setResourceOption(
              convertToProtoFormat(nodeResourceMap.get(nodeId))).build();
        }

        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  this.builder.addAllNodeResourceMap(values);
}
项目:aliyun-oss-hadoop-fs    文件:UpdateNodeResourceRequestPBImpl.java   
private void initNodeResourceMap() {
  if (this.nodeResourceMap != null) {
    return;
  }
  UpdateNodeResourceRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<NodeResourceMapProto> list = p.getNodeResourceMapList();
  this.nodeResourceMap = new HashMap<NodeId, ResourceOption>(list
      .size());
  for (NodeResourceMapProto nodeResourceProto : list) {
    this.nodeResourceMap.put(convertFromProtoFormat(nodeResourceProto.getNodeId()), 
        convertFromProtoFormat(nodeResourceProto.getResourceOption()));
  }
}
项目:aliyun-oss-hadoop-fs    文件:UpdateNodeResourceRequestPBImpl.java   
private void addNodeResourceMap() {
  maybeInitBuilder();
  builder.clearNodeResourceMap();
  if (nodeResourceMap == null) {
    return;
  }
  Iterable<? extends NodeResourceMapProto> values
      = new Iterable<NodeResourceMapProto>() {

    @Override
    public Iterator<NodeResourceMapProto> iterator() {
      return new Iterator<NodeResourceMapProto>() {
        Iterator<NodeId> nodeIterator = nodeResourceMap
            .keySet().iterator();

        @Override
        public boolean hasNext() {
          return nodeIterator.hasNext();
        }

        @Override
        public NodeResourceMapProto next() {
          NodeId nodeId = nodeIterator.next();
          return NodeResourceMapProto.newBuilder().setNodeId(
              convertToProtoFormat(nodeId)).setResourceOption(
              convertToProtoFormat(nodeResourceMap.get(nodeId))).build();
        }

        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  this.builder.addAllNodeResourceMap(values);
}
项目:big-c    文件:UpdateNodeResourceRequestPBImpl.java   
private void initNodeResourceMap() {
  if (this.nodeResourceMap != null) {
    return;
  }
  UpdateNodeResourceRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<NodeResourceMapProto> list = p.getNodeResourceMapList();
  this.nodeResourceMap = new HashMap<NodeId, ResourceOption>(list
      .size());
  for (NodeResourceMapProto nodeResourceProto : list) {
    this.nodeResourceMap.put(convertFromProtoFormat(nodeResourceProto.getNodeId()), 
        convertFromProtoFormat(nodeResourceProto.getResourceOption()));
  }
}
项目:big-c    文件:UpdateNodeResourceRequestPBImpl.java   
private void addNodeResourceMap() {
  maybeInitBuilder();
  builder.clearNodeResourceMap();
  if (nodeResourceMap == null) {
    return;
  }
  Iterable<? extends NodeResourceMapProto> values
      = new Iterable<NodeResourceMapProto>() {

    @Override
    public Iterator<NodeResourceMapProto> iterator() {
      return new Iterator<NodeResourceMapProto>() {
        Iterator<NodeId> nodeIterator = nodeResourceMap
            .keySet().iterator();

        @Override
        public boolean hasNext() {
          return nodeIterator.hasNext();
        }

        @Override
        public NodeResourceMapProto next() {
          NodeId nodeId = nodeIterator.next();
          return NodeResourceMapProto.newBuilder().setNodeId(
              convertToProtoFormat(nodeId)).setResourceOption(
              convertToProtoFormat(nodeResourceMap.get(nodeId))).build();
        }

        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  this.builder.addAllNodeResourceMap(values);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:UpdateNodeResourceRequestPBImpl.java   
private void initNodeResourceMap() {
  if (this.nodeResourceMap != null) {
    return;
  }
  UpdateNodeResourceRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<NodeResourceMapProto> list = p.getNodeResourceMapList();
  this.nodeResourceMap = new HashMap<NodeId, ResourceOption>(list
      .size());
  for (NodeResourceMapProto nodeResourceProto : list) {
    this.nodeResourceMap.put(convertFromProtoFormat(nodeResourceProto.getNodeId()), 
        convertFromProtoFormat(nodeResourceProto.getResourceOption()));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:UpdateNodeResourceRequestPBImpl.java   
private void addNodeResourceMap() {
  maybeInitBuilder();
  builder.clearNodeResourceMap();
  if (nodeResourceMap == null) {
    return;
  }
  Iterable<? extends NodeResourceMapProto> values
      = new Iterable<NodeResourceMapProto>() {

    @Override
    public Iterator<NodeResourceMapProto> iterator() {
      return new Iterator<NodeResourceMapProto>() {
        Iterator<NodeId> nodeIterator = nodeResourceMap
            .keySet().iterator();

        @Override
        public boolean hasNext() {
          return nodeIterator.hasNext();
        }

        @Override
        public NodeResourceMapProto next() {
          NodeId nodeId = nodeIterator.next();
          return NodeResourceMapProto.newBuilder().setNodeId(
              convertToProtoFormat(nodeId)).setResourceOption(
              convertToProtoFormat(nodeResourceMap.get(nodeId))).build();
        }

        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  this.builder.addAllNodeResourceMap(values);
}
项目:hops    文件:UpdateNodeResourceRequestPBImpl.java   
private void initNodeResourceMap() {
  if (this.nodeResourceMap != null) {
    return;
  }
  UpdateNodeResourceRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<NodeResourceMapProto> list = p.getNodeResourceMapList();
  this.nodeResourceMap = new HashMap<NodeId, ResourceOption>(list
      .size());
  for (NodeResourceMapProto nodeResourceProto : list) {
    this.nodeResourceMap.put(convertFromProtoFormat(nodeResourceProto.getNodeId()), 
        convertFromProtoFormat(nodeResourceProto.getResourceOption()));
  }
}
项目:hops    文件:UpdateNodeResourceRequestPBImpl.java   
private void addNodeResourceMap() {
  maybeInitBuilder();
  builder.clearNodeResourceMap();
  if (nodeResourceMap == null) {
    return;
  }
  Iterable<? extends NodeResourceMapProto> values
      = new Iterable<NodeResourceMapProto>() {

    @Override
    public Iterator<NodeResourceMapProto> iterator() {
      return new Iterator<NodeResourceMapProto>() {
        Iterator<NodeId> nodeIterator = nodeResourceMap
            .keySet().iterator();

        @Override
        public boolean hasNext() {
          return nodeIterator.hasNext();
        }

        @Override
        public NodeResourceMapProto next() {
          NodeId nodeId = nodeIterator.next();
          return NodeResourceMapProto.newBuilder().setNodeId(
              convertToProtoFormat(nodeId)).setResourceOption(
              convertToProtoFormat(nodeResourceMap.get(nodeId))).build();
        }

        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  this.builder.addAllNodeResourceMap(values);
}
项目:hadoop-on-lustre2    文件:UpdateNodeResourceRequestPBImpl.java   
private void initNodeResourceMap() {
  if (this.nodeResourceMap != null) {
    return;
  }
  UpdateNodeResourceRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<NodeResourceMapProto> list = p.getNodeResourceMapList();
  this.nodeResourceMap = new HashMap<NodeId, ResourceOption>(list
      .size());
  for (NodeResourceMapProto nodeResourceProto : list) {
    this.nodeResourceMap.put(convertFromProtoFormat(nodeResourceProto.getNodeId()), 
        convertFromProtoFormat(nodeResourceProto.getResourceOption()));
  }
}
项目:hadoop-on-lustre2    文件:UpdateNodeResourceRequestPBImpl.java   
private void addNodeResourceMap() {
  maybeInitBuilder();
  builder.clearNodeResourceMap();
  if (nodeResourceMap == null) {
    return;
  }
  Iterable<? extends NodeResourceMapProto> values
      = new Iterable<NodeResourceMapProto>() {

    @Override
    public Iterator<NodeResourceMapProto> iterator() {
      return new Iterator<NodeResourceMapProto>() {
        Iterator<NodeId> nodeIterator = nodeResourceMap
            .keySet().iterator();

        @Override
        public boolean hasNext() {
          return nodeIterator.hasNext();
        }

        @Override
        public NodeResourceMapProto next() {
          NodeId nodeId = nodeIterator.next();
          return NodeResourceMapProto.newBuilder().setNodeId(
              convertToProtoFormat(nodeId)).setResourceOption(
              convertToProtoFormat(nodeResourceMap.get(nodeId))).build();
        }

        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  this.builder.addAllNodeResourceMap(values);
}