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

java.lang.Object
  extended by org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile.Reader
All Implemented Interfaces:
BlockFileReader
Enclosing class:
CachableBlockFile

public static class CachableBlockFile.Reader
extends java.lang.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)
           
 
Method Summary
 void close()
           
 long getBlockCount()
           
 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.
 CachableBlockFile.BlockRead getMetaBlock(java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 java.io.IOException
Throws:
java.io.IOException

CachableBlockFile.Reader

public CachableBlockFile.Reader(org.apache.hadoop.fs.FSDataInputStream fsin,
                                long len,
                                org.apache.hadoop.conf.Configuration conf)
                         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getMetaBlock

public CachableBlockFile.BlockRead getMetaBlock(java.lang.String blockName)
                                         throws java.io.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:
java.io.IOException

getDataBlock

public CachableBlockFile.BlockRead getDataBlock(int blockIndex)
                                         throws java.io.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:
java.io.IOException

getBlockCount

public long getBlockCount()

close

public void close()
           throws java.io.IOException
Specified by:
close in interface BlockFileReader
Throws:
java.io.IOException


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.