Search in sources :

Example 1 with StorageInfoProto

use of org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.StorageInfoProto in project hadoop by apache.

the class TestPBHelper method testConvertStoragInfo.

@Test
public void testConvertStoragInfo() {
    StorageInfo info = getStorageInfo(NodeType.NAME_NODE);
    StorageInfoProto infoProto = PBHelper.convert(info);
    StorageInfo info2 = PBHelper.convert(infoProto, NodeType.NAME_NODE);
    assertEquals(info.getClusterID(), info2.getClusterID());
    assertEquals(info.getCTime(), info2.getCTime());
    assertEquals(info.getLayoutVersion(), info2.getLayoutVersion());
    assertEquals(info.getNamespaceID(), info2.getNamespaceID());
}
Also used : StorageInfoProto(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.StorageInfoProto) StorageInfo(org.apache.hadoop.hdfs.server.common.StorageInfo) DatanodeStorageInfo(org.apache.hadoop.hdfs.server.blockmanagement.DatanodeStorageInfo) Test(org.junit.Test)

Aggregations

StorageInfoProto (org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.StorageInfoProto)1 DatanodeStorageInfo (org.apache.hadoop.hdfs.server.blockmanagement.DatanodeStorageInfo)1 StorageInfo (org.apache.hadoop.hdfs.server.common.StorageInfo)1 Test (org.junit.Test)1