Search in sources :

Example 1 with ContainerStatusPBImpl

use of org.apache.hadoop.yarn.api.records.impl.pb.ContainerStatusPBImpl in project hadoop by apache.

the class TestProtocolRecords method testContainerStatus.

@Test
public void testContainerStatus() {
    ContainerStatus status = Records.newRecord(ContainerStatus.class);
    List<String> ips = Arrays.asList("127.0.0.1", "139.5.25.2");
    status.setIPs(ips);
    status.setHost("locahost123");
    ContainerStatusPBImpl pb = new ContainerStatusPBImpl(((ContainerStatusPBImpl) status).getProto());
    Assert.assertEquals(ips, pb.getIPs());
    Assert.assertEquals("locahost123", pb.getHost());
    status.setIPs(null);
    Assert.assertNull(status.getIPs());
}
Also used : NMContainerStatusPBImpl(org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.NMContainerStatusPBImpl) ContainerStatusPBImpl(org.apache.hadoop.yarn.api.records.impl.pb.ContainerStatusPBImpl) ContainerStatus(org.apache.hadoop.yarn.api.records.ContainerStatus) Test(org.junit.Test)

Aggregations

ContainerStatus (org.apache.hadoop.yarn.api.records.ContainerStatus)1 ContainerStatusPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.ContainerStatusPBImpl)1 NMContainerStatusPBImpl (org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.NMContainerStatusPBImpl)1 Test (org.junit.Test)1