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

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

Introduction

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

Prototype

@Override
public void readFields(DataInput in) throws IOException 

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);
    switch (var.getType()) {
    case BTCurrKey:
        key.setKeyType(BlockKey.KeyType.CurrKey);
        break;//  w  w  w.  ja  v a 2  s  .c  o  m
    case BTNextKey:
        key.setKeyType(BlockKey.KeyType.NextKey);
        break;
    case BTSimpleKey:
        key.setKeyType(BlockKey.KeyType.SimpleKey);
    }
    return key;
}