Search in sources :

Example 1 with CheckpointSignatureProto

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

the class TestPBHelper method testConvertCheckpointSignature.

@Test
public void testConvertCheckpointSignature() {
    CheckpointSignature s = new CheckpointSignature(getStorageInfo(NodeType.NAME_NODE), "bpid", 100, 1);
    CheckpointSignatureProto sProto = PBHelper.convert(s);
    CheckpointSignature s1 = PBHelper.convert(sProto);
    assertEquals(s.getBlockpoolID(), s1.getBlockpoolID());
    assertEquals(s.getClusterID(), s1.getClusterID());
    assertEquals(s.getCTime(), s1.getCTime());
    assertEquals(s.getCurSegmentTxId(), s1.getCurSegmentTxId());
    assertEquals(s.getLayoutVersion(), s1.getLayoutVersion());
    assertEquals(s.getMostRecentCheckpointTxId(), s1.getMostRecentCheckpointTxId());
    assertEquals(s.getNamespaceID(), s1.getNamespaceID());
}
Also used : CheckpointSignatureProto(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.CheckpointSignatureProto) CheckpointSignature(org.apache.hadoop.hdfs.server.namenode.CheckpointSignature) Test(org.junit.Test)

Aggregations

CheckpointSignatureProto (org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.CheckpointSignatureProto)1 CheckpointSignature (org.apache.hadoop.hdfs.server.namenode.CheckpointSignature)1 Test (org.junit.Test)1