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