org.apache.accumulo.core.file.blockfile.impl
Class CachableBlockFile.BlockRead

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by 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)).


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
CachableBlockFile.BlockRead(InputStream in, long size)
           
 
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.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
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
 

Constructor Detail

CachableBlockFile.BlockRead

public CachableBlockFile.BlockRead(InputStream in,
                                   long size)
Method Detail

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 © 2014 The Apache Software Foundation. All Rights Reserved.