Class BlockAliasMap<T extends BlockAlias>

java.lang.Object
org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap<T>
Direct Known Subclasses:
LevelDBFileRegionAliasMap, NullBlockAliasMap, TextFileRegionAliasMap

@Public @Unstable public abstract class BlockAliasMap<T extends BlockAlias> extends Object
An abstract class used to read and write block maps for provided blocks.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.ImmutableIterator
    ImmutableIterator is an Iterator that does not support the remove operation.
    static class 
    org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader<U extends BlockAlias>
    An abstract class that is used to read BlockAliases for provided blocks.
    static class 
    org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Writer<U extends BlockAlias>
    An abstract class used as a writer for the provided block map.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
     
    abstract org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader<T>
    getReader(org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader.Options opts, String blockPoolID)
    Returns a reader to the alias map.
    abstract org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Writer<T>
    getWriter(org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Writer.Options opts, String blockPoolID)
    Returns the writer for the alias map.
    abstract void
    Refresh the alias map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlockAliasMap

      public BlockAliasMap()
  • Method Details

    • getReader

      public abstract org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader<T> getReader(org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader.Options opts, String blockPoolID) throws IOException
      Returns a reader to the alias map.
      Parameters:
      opts - reader options
      blockPoolID - block pool id to use
      Returns:
      BlockAliasMap.Reader to the alias map. If a Reader for the blockPoolID cannot be created, this will return null.
      Throws:
      IOException
    • getWriter

      public abstract org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Writer<T> getWriter(org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Writer.Options opts, String blockPoolID) throws IOException
      Returns the writer for the alias map.
      Parameters:
      opts - writer options.
      blockPoolID - block pool id to use
      Returns:
      BlockAliasMap.Writer to the alias map.
      Throws:
      IOException
    • refresh

      public abstract void refresh() throws IOException
      Refresh the alias map.
      Throws:
      IOException
    • close

      public abstract void close() throws IOException
      Throws:
      IOException