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

项目:hadoop    文件:GetNodesToLabelsResponsePBImpl.java   
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()));
  }
}
项目:hadoop    文件:GetNodesToLabelsResponsePBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey()))
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:hadoop    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
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()));
  }
}
项目:hadoop    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeIdToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey())).clearNodeLabels()
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:big-c    文件:GetNodesToLabelsResponsePBImpl.java   
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()));
  }
}
项目:big-c    文件:GetNodesToLabelsResponsePBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey()))
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:big-c    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
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()));
  }
}
项目:big-c    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeIdToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey())).clearNodeLabels()
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:GetNodesToLabelsResponsePBImpl.java   
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()));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:GetNodesToLabelsResponsePBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey()))
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
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()));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeIdToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey())).clearNodeLabels()
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:hops    文件:GetNodesToLabelsResponsePBImpl.java   
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()));
  }
}
项目:hops    文件:GetNodesToLabelsResponsePBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey()))
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}
项目:hops    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
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()));
  }
}
项目:hops    文件:ReplaceLabelsOnNodeRequestPBImpl.java   
private void addNodeToLabelsToProto() {
  maybeInitBuilder();
  builder.clearNodeToLabels();
  if (nodeIdToLabels == null) {
    return;
  }
  Iterable<NodeIdToLabelsProto> iterable =
      new Iterable<NodeIdToLabelsProto>() {
        @Override
        public Iterator<NodeIdToLabelsProto> iterator() {
          return new Iterator<NodeIdToLabelsProto>() {

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

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

            @Override
            public NodeIdToLabelsProto next() {
              Entry<NodeId, Set<String>> now = iter.next();
              return NodeIdToLabelsProto.newBuilder()
                  .setNodeId(convertToProtoFormat(now.getKey())).clearNodeLabels()
                  .addAllNodeLabels(now.getValue()).build();
            }

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }
          };
        }
      };
  builder.addAllNodeToLabels(iterable);
}