本文整理汇总了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()));
}
}
示例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);
}
示例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()));
}
}
示例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);
}