YARN-9547. ContainerStatusPBImpl default execution type is not returned. Contributed by Bilwa S T.

This commit is contained in:
bibinchundatt 2019-06-11 23:42:29 +05:30
parent d9284d4a57
commit 3303723f55
2 changed files with 3 additions and 2 deletions

View File

@ -182,7 +182,7 @@ public class ContainerStatusPBImpl extends ContainerStatus {
public synchronized ExecutionType getExecutionType() {
ContainerStatusProtoOrBuilder p = viaProto ? proto : builder;
if (!p.hasExecutionType()) {
return null;
return ExecutionType.GUARANTEED;
}
return convertFromProtoFormat(p.getExecutionType());
}

View File

@ -38,6 +38,7 @@ import org.apache.hadoop.yarn.api.records.ContainerExitStatus;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.ContainerState;
import org.apache.hadoop.yarn.api.records.ContainerStatus;
import org.apache.hadoop.yarn.api.records.ExecutionType;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.Priority;
import org.apache.hadoop.yarn.api.records.Resource;
@ -207,7 +208,7 @@ public class TestProtocolRecords {
new ContainerStatusPBImpl(((ContainerStatusPBImpl) status).getProto());
Assert.assertEquals(ips, pb.getIPs());
Assert.assertEquals("locahost123", pb.getHost());
Assert.assertEquals(ExecutionType.GUARANTEED, pb.getExecutionType());
status.setIPs(null);
Assert.assertNull(status.getIPs());
}