use of org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamespaceInfoProto in project hadoop by apache.
the class TestPBHelper method testConvertNamespaceInfo.
@Test
public void testConvertNamespaceInfo() {
NamespaceInfo info = new NamespaceInfo(37, "clusterID", "bpID", 2300);
NamespaceInfoProto proto = PBHelper.convert(info);
NamespaceInfo info2 = PBHelper.convert(proto);
//Compare the StorageInfo
compare(info, info2);
assertEquals(info.getBlockPoolID(), info2.getBlockPoolID());
assertEquals(info.getBuildVersion(), info2.getBuildVersion());
}
use of org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NamespaceInfoProto in project hadoop by apache.
the class PBHelper method convert.
public static NamespaceInfoProto convert(NamespaceInfo info) {
NamespaceInfoProto.Builder builder = NamespaceInfoProto.newBuilder();
builder.setBlockPoolID(info.getBlockPoolID()).setBuildVersion(info.getBuildVersion()).setUnused(0).setStorageInfo(PBHelper.convert((StorageInfo) info)).setSoftwareVersion(info.getSoftwareVersion()).setCapabilities(info.getCapabilities());
HAServiceState state = info.getState();
if (state != null) {
builder.setState(convert(info.getState()));
}
return builder.build();
}
Aggregations