YARN-9547. ContainerStatusPBImpl default execution type is not returned. Contributed by Bilwa S T.
This commit is contained in:
parent
d9284d4a57
commit
3303723f55
|
@ -182,7 +182,7 @@ public class ContainerStatusPBImpl extends ContainerStatus {
|
||||||
public synchronized ExecutionType getExecutionType() {
|
public synchronized ExecutionType getExecutionType() {
|
||||||
ContainerStatusProtoOrBuilder p = viaProto ? proto : builder;
|
ContainerStatusProtoOrBuilder p = viaProto ? proto : builder;
|
||||||
if (!p.hasExecutionType()) {
|
if (!p.hasExecutionType()) {
|
||||||
return null;
|
return ExecutionType.GUARANTEED;
|
||||||
}
|
}
|
||||||
return convertFromProtoFormat(p.getExecutionType());
|
return convertFromProtoFormat(p.getExecutionType());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.ContainerId;
|
||||||
import org.apache.hadoop.yarn.api.records.ContainerState;
|
import org.apache.hadoop.yarn.api.records.ContainerState;
|
||||||
import org.apache.hadoop.yarn.api.records.ContainerStatus;
|
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.NodeId;
|
||||||
import org.apache.hadoop.yarn.api.records.Priority;
|
import org.apache.hadoop.yarn.api.records.Priority;
|
||||||
import org.apache.hadoop.yarn.api.records.Resource;
|
import org.apache.hadoop.yarn.api.records.Resource;
|
||||||
|
@ -207,7 +208,7 @@ public class TestProtocolRecords {
|
||||||
new ContainerStatusPBImpl(((ContainerStatusPBImpl) status).getProto());
|
new ContainerStatusPBImpl(((ContainerStatusPBImpl) status).getProto());
|
||||||
Assert.assertEquals(ips, pb.getIPs());
|
Assert.assertEquals(ips, pb.getIPs());
|
||||||
Assert.assertEquals("locahost123", pb.getHost());
|
Assert.assertEquals("locahost123", pb.getHost());
|
||||||
|
Assert.assertEquals(ExecutionType.GUARANTEED, pb.getExecutionType());
|
||||||
status.setIPs(null);
|
status.setIPs(null);
|
||||||
Assert.assertNull(status.getIPs());
|
Assert.assertNull(status.getIPs());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue