use of org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.LocalResourceStatusProto in project hadoop by apache.
the class LocalizerStatusPBImpl method initResources.
private void initResources() {
if (this.resources != null) {
return;
}
LocalizerStatusProtoOrBuilder p = viaProto ? proto : builder;
List<LocalResourceStatusProto> list = p.getResourcesList();
this.resources = new ArrayList<LocalResourceStatus>();
for (LocalResourceStatusProto c : list) {
this.resources.add(convertFromProtoFormat(c));
}
}
use of org.apache.hadoop.yarn.proto.YarnServerNodemanagerServiceProtos.LocalResourceStatusProto in project hadoop by apache.
the class TestPBRecordImpl method testLocalResourceStatusSerDe.
@Test(timeout = 10000)
public void testLocalResourceStatusSerDe() throws Exception {
LocalResourceStatus rsrcS = createLocalResourceStatus();
assertTrue(rsrcS instanceof LocalResourceStatusPBImpl);
LocalResourceStatusPBImpl rsrcPb = (LocalResourceStatusPBImpl) rsrcS;
DataOutputBuffer out = new DataOutputBuffer();
rsrcPb.getProto().writeDelimitedTo(out);
DataInputBuffer in = new DataInputBuffer();
in.reset(out.getData(), 0, out.getLength());
LocalResourceStatusProto rsrcPbD = LocalResourceStatusProto.parseDelimitedFrom(in);
assertNotNull(rsrcPbD);
LocalResourceStatus rsrcD = new LocalResourceStatusPBImpl(rsrcPbD);
assertEquals(rsrcS, rsrcD);
assertEquals(createResource(), rsrcS.getResource());
assertEquals(createResource(), rsrcD.getResource());
}
Aggregations