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

项目:hadoop    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hadoop    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:aliyun-oss-hadoop-fs    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:aliyun-oss-hadoop-fs    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:aliyun-oss-hadoop-fs    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:aliyun-oss-hadoop-fs    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:big-c    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:big-c    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:big-c    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:big-c    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:hadoop-plus    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-plus    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hadoop-plus    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-plus    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:hops    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hops    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hops    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hops    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:hadoop-TCP    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-TCP    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hadoop-TCP    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-TCP    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:hardfs    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hardfs    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hardfs    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hardfs    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}
项目:hadoop-on-lustre2    文件:StartContainersResponsePBImpl.java   
private void initServicesMetaData() {
  if (this.servicesMetaData != null) {
    return;
  }
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServicesMetaDataList();
  this.servicesMetaData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.servicesMetaData.put(c.getKey(),
      convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-on-lustre2    文件:StartContainersResponsePBImpl.java   
private void addServicesMetaDataToProto() {
  maybeInitBuilder();
  builder.clearServicesMetaData();
  if (servicesMetaData == null)
    return;
  Iterable<StringBytesMapProto> iterable =
      new Iterable<StringBytesMapProto>() {

        @Override
        public Iterator<StringBytesMapProto> iterator() {
          return new Iterator<StringBytesMapProto>() {

            Iterator<String> keyIter = servicesMetaData.keySet().iterator();

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

            @Override
            public StringBytesMapProto next() {
              String key = keyIter.next();
              return StringBytesMapProto.newBuilder().setKey(key)
                .setValue(convertToProtoFormat(servicesMetaData.get(key)))
                .build();
            }

            @Override
            public boolean hasNext() {
              return keyIter.hasNext();
            }
          };
        }
      };
  builder.addAllServicesMetaData(iterable);
}
项目:hadoop-on-lustre2    文件:ContainerLaunchContextPBImpl.java   
private void initServiceData() {
  if (this.serviceData != null) {
    return;
  }
  ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
  List<StringBytesMapProto> list = p.getServiceDataList();
  this.serviceData = new HashMap<String, ByteBuffer>();

  for (StringBytesMapProto c : list) {
    this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue()));
  }
}
项目:hadoop-on-lustre2    文件:ContainerLaunchContextPBImpl.java   
private void addServiceDataToProto() {
  maybeInitBuilder();
  builder.clearServiceData();
  if (serviceData == null)
    return;
  Iterable<StringBytesMapProto> iterable = 
      new Iterable<StringBytesMapProto>() {

    @Override
    public Iterator<StringBytesMapProto> iterator() {
      return new Iterator<StringBytesMapProto>() {

        Iterator<String> keyIter = serviceData.keySet().iterator();

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

        @Override
        public StringBytesMapProto next() {
          String key = keyIter.next();
          return StringBytesMapProto.newBuilder().setKey(key).setValue(
              convertToProtoFormat(serviceData.get(key))).build();
        }

        @Override
        public boolean hasNext() {
          return keyIter.hasNext();
        }
      };
    }
  };
  builder.addAllServiceData(iterable);
}