Class CachableBlockFile.Reader
- java.lang.Object
-
- org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile.Reader
-
- All Implemented Interfaces:
BlockFileReader
- Enclosing class:
- CachableBlockFile
public static class CachableBlockFile.Reader extends Object implements BlockFileReader
Class wraps the BCFile reader.
-
-
Constructor Summary
Constructors Constructor Description Reader(String cacheId, InputStreamType fsin, long len, org.apache.hadoop.conf.Configuration conf, AccumuloConfiguration accumuloConfiguration)
Reader(String cacheId, InputStreamType fsin, long len, org.apache.hadoop.conf.Configuration conf, BlockCache data, BlockCache index, AccumuloConfiguration accumuloConfiguration)
Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dataFile, org.apache.hadoop.conf.Configuration conf, com.google.common.cache.Cache<String,Long> fileLenCache, BlockCache data, BlockCache index, RateLimiter readLimiter, AccumuloConfiguration accumuloConfiguration)
Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dataFile, org.apache.hadoop.conf.Configuration conf, BlockCache data, BlockCache index, AccumuloConfiguration accumuloConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cacheMetaBlock(String blockName, byte[] b)
CachableBlockFile.BlockRead
cacheMetaBlock(String blockName, BCFile.Reader.BlockReader _currBlock)
void
close()
CachableBlockFile.BlockRead
getCachedMetaBlock(String blockName)
CachableBlockFile.BlockRead
getDataBlock(int blockIndex)
It is intended that once the BlockRead object is returned to the caller, that the caller will read the entire block and then call close on the BlockRead class.ABlockReader
getDataBlock(long offset, long compressedSize, long rawSize)
ABlockReader
getMetaBlock(long offset, long compressedSize, long rawSize)
CachableBlockFile.BlockRead
getMetaBlock(String blockName)
It is intended that once the BlockRead object is returned to the caller, that the caller will read the entire block and then call close on the BlockRead class.
-
-
-
Constructor Detail
-
Reader
public Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dataFile, org.apache.hadoop.conf.Configuration conf, BlockCache data, BlockCache index, AccumuloConfiguration accumuloConfiguration) throws IOException
- Throws:
IOException
-
Reader
public Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dataFile, org.apache.hadoop.conf.Configuration conf, com.google.common.cache.Cache<String,Long> fileLenCache, BlockCache data, BlockCache index, RateLimiter readLimiter, AccumuloConfiguration accumuloConfiguration) throws IOException
- Throws:
IOException
-
Reader
public Reader(String cacheId, InputStreamType fsin, long len, org.apache.hadoop.conf.Configuration conf, BlockCache data, BlockCache index, AccumuloConfiguration accumuloConfiguration) throws IOException
- Throws:
IOException
-
Reader
public Reader(String cacheId, InputStreamType fsin, long len, org.apache.hadoop.conf.Configuration conf, AccumuloConfiguration accumuloConfiguration) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getCachedMetaBlock
public CachableBlockFile.BlockRead getCachedMetaBlock(String blockName) throws IOException
- Throws:
IOException
-
cacheMetaBlock
public CachableBlockFile.BlockRead cacheMetaBlock(String blockName, BCFile.Reader.BlockReader _currBlock) throws IOException
- Throws:
IOException
-
cacheMetaBlock
public void cacheMetaBlock(String blockName, byte[] b)
-
getMetaBlock
public CachableBlockFile.BlockRead getMetaBlock(String blockName) throws IOException
It is intended that once the BlockRead object is returned to the caller, that the caller will read the entire block and then call close on the BlockRead class. NOTE: In the case of multi-read threads: This method can do redundant work where an entry is read from disk and other threads check the cache before it has been inserted.- Specified by:
getMetaBlock
in interfaceBlockFileReader
- Throws:
IOException
-
getMetaBlock
public ABlockReader getMetaBlock(long offset, long compressedSize, long rawSize) throws IOException
- Specified by:
getMetaBlock
in interfaceBlockFileReader
- Throws:
IOException
-
getDataBlock
public CachableBlockFile.BlockRead getDataBlock(int blockIndex) throws IOException
It is intended that once the BlockRead object is returned to the caller, that the caller will read the entire block and then call close on the BlockRead class. NOTE: In the case of multi-read threads: This method can do redundant work where an entry is read from disk and other threads check the cache before it has been inserted.- Specified by:
getDataBlock
in interfaceBlockFileReader
- Throws:
IOException
-
getDataBlock
public ABlockReader getDataBlock(long offset, long compressedSize, long rawSize) throws IOException
- Specified by:
getDataBlock
in interfaceBlockFileReader
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceBlockFileReader
- Throws:
IOException
-
-