Class FixedBlockResolver

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.BlockResolver
org.apache.hadoop.hdfs.server.namenode.FixedBlockResolver
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
FixedBlockMultiReplicaResolver

@Public @Unstable public class FixedBlockResolver extends BlockResolver implements Configurable
Resolver mapping all files to a configurable, uniform blocksize.
  • Field Details

  • Constructor Details

    • FixedBlockResolver

      public FixedBlockResolver()
  • Method Details

    • setConf

      public void setConf(Configuration conf)
      Description copied from interface: Configurable
      Set the configuration to be used by this object.
      Specified by:
      setConf in interface Configurable
      Parameters:
      conf - configuration to be used
    • getConf

      public Configuration getConf()
      Description copied from interface: Configurable
      Return the configuration used by this object.
      Specified by:
      getConf in interface Configurable
      Returns:
      Configuration
    • blockLengths

      protected List<Long> blockLengths(FileStatus s)
      Specified by:
      blockLengths in class BlockResolver
      Parameters:
      s - the external reference.
      Returns:
      the lengths of the resultant blocks.
    • nextId

      public long nextId()
      Specified by:
      nextId in class BlockResolver
      Returns:
      the next block id.
    • lastId

      public long lastId()
      Specified by:
      lastId in class BlockResolver
      Returns:
      the maximum sequentially allocated block ID for this filesystem.
    • preferredBlockSize

      public long preferredBlockSize(FileStatus s)
      Overrides:
      preferredBlockSize in class BlockResolver
      Parameters:
      s - the external reference.
      Returns:
      the block size to assign to this external reference.
    • getReplication

      public int getReplication(FileStatus s)
      Specified by:
      getReplication in class BlockResolver
      Parameters:
      s - the external reference.
      Returns:
      the replication to assign to this external reference.