org.apache.accumulo.core.file.blockfile.impl
Class CachableBlockFile.BlockRead
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile.BlockRead
- All Implemented Interfaces:
- Closeable, DataInput, ABlockReader
- Enclosing class:
- CachableBlockFile
public static class CachableBlockFile.BlockRead
- extends DataInputStream
- implements ABlockReader
Class provides functionality to read one block from the underlying BCFile Since We are caching blocks in the Reader class as bytearrays, this class will
wrap a DataInputStream(ByteArrayStream(cachedBlock)).
Method Summary |
long |
getRawSize()
Size is the size of the bytearray that was read form the cache |
DataInputStream |
getStream()
It is intended that the caller of this method will close the stream we also only intend that this be called once per BlockRead. |
Methods inherited from class java.io.DataInputStream |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.accumulo.core.file.blockfile.ABlockReader |
close |
Methods inherited from interface java.io.DataInput |
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes |
CachableBlockFile.BlockRead
public CachableBlockFile.BlockRead(InputStream in,
long size)
getRawSize
public long getRawSize()
- Size is the size of the bytearray that was read form the cache
- Specified by:
getRawSize
in interface ABlockReader
getStream
public DataInputStream getStream()
throws IOException
- It is intended that the caller of this method will close the stream we also only intend that this be called once per BlockRead. This method is provide
for methods up stream that expect to receive a DataInputStream object.
- Specified by:
getStream
in interface ABlockReader
- Throws:
IOException
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.