Example usage for org.apache.hadoop.hdfs.security.token.block BlockKey BlockKey

List of usage examples for org.apache.hadoop.hdfs.security.token.block BlockKey BlockKey

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.security.token.block BlockKey BlockKey.

Prototype

public BlockKey() 

Source Link

Usage

From source file:io.hops.metadata.HdfsVariables.java

License:Apache License

private static BlockKey deserializeBlockKey(ByteArrayVariable var) throws IOException {
    ByteArrayInputStream is = new ByteArrayInputStream((byte[]) var.getValue());
    DataInputStream dis = new DataInputStream(is);
    BlockKey key = new BlockKey();
    key.readFields(dis);/*from ww w .  j av  a2  s. c o m*/
    switch (var.getType()) {
    case BTCurrKey:
        key.setKeyType(BlockKey.KeyType.CurrKey);
        break;
    case BTNextKey:
        key.setKeyType(BlockKey.KeyType.NextKey);
        break;
    case BTSimpleKey:
        key.setKeyType(BlockKey.KeyType.SimpleKey);
    }
    return key;
}