Class BlockAliasMap<T extends BlockAlias>
java.lang.Object
org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap<T>
- Direct Known Subclasses:
LevelDBFileRegionAliasMap,NullBlockAliasMap,TextFileRegionAliasMap
An abstract class used to read and write block maps for provided blocks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassorg.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.ImmutableIteratorImmutableIterator is an Iterator that does not support the remove operation.static classorg.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader<U extends BlockAlias>An abstract class that is used to readBlockAliases for provided blocks.static classorg.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 -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()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 voidrefresh()Refresh the alias map.
-
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 optionsblockPoolID- block pool id to use- Returns:
BlockAliasMap.Readerto 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.Writerto the alias map.- Throws:
IOException
-
refresh
Refresh the alias map.- Throws:
IOException
-
close
- Throws:
IOException
-