use of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationUpdateTimeoutMapProto in project hadoop by apache.
the class UpdateApplicationTimeoutsRequestPBImpl method addApplicationTimeouts.
private void addApplicationTimeouts() {
maybeInitBuilder();
builder.clearApplicationTimeouts();
if (applicationTimeouts == null) {
return;
}
Iterable<? extends ApplicationUpdateTimeoutMapProto> values = new Iterable<ApplicationUpdateTimeoutMapProto>() {
@Override
public Iterator<ApplicationUpdateTimeoutMapProto> iterator() {
return new Iterator<ApplicationUpdateTimeoutMapProto>() {
private Iterator<ApplicationTimeoutType> iterator = applicationTimeouts.keySet().iterator();
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public ApplicationUpdateTimeoutMapProto next() {
ApplicationTimeoutType key = iterator.next();
return ApplicationUpdateTimeoutMapProto.newBuilder().setExpireTime(applicationTimeouts.get(key)).setApplicationTimeoutType(ProtoUtils.convertToProtoFormat(key)).build();
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
this.builder.addAllApplicationTimeouts(values);
}
use of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationUpdateTimeoutMapProto in project hadoop by apache.
the class UpdateApplicationTimeoutsRequestPBImpl method initApplicationTimeout.
private void initApplicationTimeout() {
if (this.applicationTimeouts != null) {
return;
}
UpdateApplicationTimeoutsRequestProtoOrBuilder p = viaProto ? proto : builder;
List<ApplicationUpdateTimeoutMapProto> lists = p.getApplicationTimeoutsList();
this.applicationTimeouts = new HashMap<ApplicationTimeoutType, String>(lists.size());
for (ApplicationUpdateTimeoutMapProto timeoutProto : lists) {
this.applicationTimeouts.put(ProtoUtils.convertFromProtoFormat(timeoutProto.getApplicationTimeoutType()), timeoutProto.getExpireTime());
}
}
Aggregations