Search in sources :

Example 1 with BlockKeyProto

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

the class TestPBHelper method testConvertBlockKey.

@Test
public void testConvertBlockKey() {
    BlockKey key = getBlockKey(1);
    BlockKeyProto keyProto = PBHelper.convert(key);
    BlockKey key1 = PBHelper.convert(keyProto);
    compare(key, key1);
}
Also used : BlockKeyProto(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockKeyProto) BlockKey(org.apache.hadoop.hdfs.security.token.block.BlockKey) Test(org.junit.Test)

Example 2 with BlockKeyProto

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

the class PBHelper method convertBlockKeys.

public static BlockKey[] convertBlockKeys(List<BlockKeyProto> list) {
    BlockKey[] ret = new BlockKey[list.size()];
    int i = 0;
    for (BlockKeyProto k : list) {
        ret[i++] = convert(k);
    }
    return ret;
}
Also used : BlockKeyProto(org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockKeyProto) BlockKey(org.apache.hadoop.hdfs.security.token.block.BlockKey)

Aggregations

BlockKeyProto (org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.BlockKeyProto)2 BlockKey (org.apache.hadoop.hdfs.security.token.block.BlockKey)2 Test (org.junit.Test)1