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

This commit is contained in:
bibinchundatt 2019-05-15 13:21:39 +05:30
parent 2d8282bb82
commit 2de1e30658
2 changed files with 3 additions and 2 deletions

View File

@ -184,7 +184,7 @@ private void initContainerAttributes() {
public synchronized ExecutionType getExecutionType() {
ContainerStatusProtoOrBuilder p = viaProto ? proto : builder;
if (!p.hasExecutionType()) {
return null;
return ExecutionType.GUARANTEED;
}
return convertFromProtoFormat(p.getExecutionType());
}

View File

@ -37,6 +37,7 @@
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.NodeAttribute;
import org.apache.hadoop.yarn.api.records.NodeAttributeType;
import org.apache.hadoop.yarn.api.records.NodeId;
@ -210,7 +211,7 @@ public void testContainerStatus() {
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());
}