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


Java StringBytesMapProto类代码示例

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


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

示例1: initServicesMetaData

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

示例2: addServicesMetaDataToProto

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

示例3: initServiceData

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

示例4: addServiceDataToProto

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


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