org.apache.accumulo.core.file.blockfile.impl
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 |
CachableBlockFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path dataFile,
org.apache.hadoop.conf.Configuration conf,
BlockCache data,
BlockCache index)
|
CachableBlockFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsin,
long len,
org.apache.hadoop.conf.Configuration conf)
|
CachableBlockFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsin,
long len,
org.apache.hadoop.conf.Configuration conf,
BlockCache data,
BlockCache index)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachableBlockFile.Reader
public CachableBlockFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path dataFile,
org.apache.hadoop.conf.Configuration conf,
BlockCache data,
BlockCache index)
throws IOException
- Throws:
IOException
CachableBlockFile.Reader
public CachableBlockFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsin,
long len,
org.apache.hadoop.conf.Configuration conf,
BlockCache data,
BlockCache index)
throws IOException
- Throws:
IOException
CachableBlockFile.Reader
public CachableBlockFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsin,
long len,
org.apache.hadoop.conf.Configuration conf)
throws IOException
- Throws:
IOException
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 interface BlockFileReader
- Throws:
IOException
getMetaBlock
public ABlockReader getMetaBlock(long offset,
long compressedSize,
long rawSize)
throws IOException
- Specified by:
getMetaBlock
in interface BlockFileReader
- 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 interface BlockFileReader
- Throws:
IOException
getDataBlock
public ABlockReader getDataBlock(long offset,
long compressedSize,
long rawSize)
throws IOException
- Specified by:
getDataBlock
in interface BlockFileReader
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface BlockFileReader
- Throws:
IOException
Copyright © 2013 Apache Accumulo Project. All Rights Reserved.