BlockResolver (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode, class: BlockResolver

Package org.apache.hadoop.hdfs.server.namenode

# Class BlockResolver

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.BlockResolver

Direct Known Subclasses:
  `FixedBlockResolver`

@Public @Unstable public abstract class BlockResolver extends Object
Given an external reference, create a sequence of blocks and associated metadata.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlockResolver()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract List<Long>`
  `blockLengths(FileStatus status)`
  `protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto`
  `buildBlock(long blockId, long bytes)`
  `protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto`
  `buildBlock(long blockId, long bytes, long genstamp)`
  `abstract int`
  `getReplication(FileStatus status)`
  `protected abstract long`
  `lastId()`
  `abstract long`
  `nextId()`
  `long`
  `preferredBlockSize(FileStatus status)`
  `Iterable<org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto>`
  `resolve(FileStatus s)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BlockResolver

    public BlockResolver()

- ## Method Details

  - ### buildBlock

    protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto buildBlock(long blockId, long bytes)

  - ### buildBlock

    protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto buildBlock(long blockId, long bytes, long genstamp)

  - ### resolve

    public Iterable<org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto> resolve(FileStatus s)
    Parameters:
      `s` - the external reference.
    Returns:
      sequence of blocks that make up the reference.

  - ### nextId

    public abstract long nextId()
    Returns:
      the next block id.

  - ### lastId

    protected abstract long lastId()
    Returns:
      the maximum sequentially allocated block ID for this filesystem.

  - ### blockLengths

    protected abstract List<Long> blockLengths(FileStatus status)
    Parameters:
      `status` - the external reference.
    Returns:
      the lengths of the resultant blocks.

  - ### preferredBlockSize

    public long preferredBlockSize(FileStatus status)
    Parameters:
      `status` - the external reference.
    Returns:
      the block size to assign to this external reference.

  - ### getReplication

    public abstract int getReplication(FileStatus status)
    Parameters:
      `status` - the external reference.
    Returns:
      the replication to assign to this external reference.