Package org.apache.hadoop.fs.store
Class DataBlocks.BlockFactory
java.lang.Object
org.apache.hadoop.fs.store.DataBlocks.BlockFactory
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- DataBlocks
Base class for block factories.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Implement any close/cleanup operation.abstract DataBlocks.DataBlockcreate(long index, int limit, BlockUploadStatistics statistics) Create a block.protected ConfigurationgetConf()Configuration.Key to Buffer Directory config for a FS instance.
-
Constructor Details
-
BlockFactory
-
-
Method Details
-
create
public abstract DataBlocks.DataBlock create(long index, int limit, BlockUploadStatistics statistics) throws IOException Create a block.- Parameters:
index- index of blocklimit- limit of the block.statistics- stats to work with- Returns:
- a new block.
- Throws:
IOException- raised on errors performing I/O.
-
close
Implement any close/cleanup operation. Base class is a no-op.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- Inherited exception; implementations should avoid raising it.
-
getConf
Configuration.- Returns:
- config passed to create the factory.
-
getKeyToBufferDir
Key to Buffer Directory config for a FS instance.- Returns:
- String containing key to Buffer dir.
-