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

(cherry picked from commit 3303723f55)
This commit is contained in:
bibinchundatt 2019-06-11 23:42:29 +05:30
parent d386f595f9
commit f42e246f8a
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

@ -36,6 +36,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;
@ -195,7 +196,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());
}