Example usage for org.apache.hadoop.hdfs.protocol ExtendedBlock ExtendedBlock

List of usage examples for org.apache.hadoop.hdfs.protocol ExtendedBlock ExtendedBlock

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.protocol ExtendedBlock ExtendedBlock.

Prototype

public ExtendedBlock(final String poolId, final long blkid, final long len, final long genstamp) 

Source Link

Usage

From source file:com.bigstep.datalake.JsonUtil.java

License:Apache License

/** Convert a Json map to an ExtendedBlock object. */
private static ExtendedBlock toExtendedBlock(final Map<?, ?> m) {
    if (m == null) {
        return null;
    }// ww  w .j av a2  s  .c om

    final String blockPoolId = (String) m.get("blockPoolId");
    final long blockId = ((Number) m.get("blockId")).longValue();
    final long numBytes = ((Number) m.get("numBytes")).longValue();
    final long generationStamp = ((Number) m.get("generationStamp")).longValue();
    return new ExtendedBlock(blockPoolId, blockId, numBytes, generationStamp);
}