Class CachableBlockFile.Reader
- java.lang.Object
-
- org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile.Reader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- CachableBlockFile
public static class CachableBlockFile.Reader extends Object implements Closeable
Class wraps the BCFile reader.
-
-
Constructor Summary
Constructors Constructor Description Reader(CachableBlockFile.CachableBuilder b)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
CachableBlockFile.CachedBlockRead
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.CachableBlockFile.CachedBlockRead
getDataBlock(long offset, long compressedSize, long rawSize)
CachableBlockFile.CachedBlockRead
getMetaBlock(long offset, long compressedSize, long rawSize)
CachableBlockFile.CachedBlockRead
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(CachableBlockFile.CachableBuilder b)
-
-
Method Detail
-
getMetaBlock
public CachableBlockFile.CachedBlockRead 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.- Throws:
IOException
-
getMetaBlock
public CachableBlockFile.CachedBlockRead getMetaBlock(long offset, long compressedSize, long rawSize) throws IOException
- Throws:
IOException
-
getDataBlock
public CachableBlockFile.CachedBlockRead 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.- Throws:
IOException
-
getDataBlock
public CachableBlockFile.CachedBlockRead getDataBlock(long offset, long compressedSize, long rawSize) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-