org.apache.hadoop.hbase.io.hfile
Class HFileReaderV1.AbstractScannerV1

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner
      extended by org.apache.hadoop.hbase.io.hfile.HFileReaderV1.AbstractScannerV1
All Implemented Interfaces:
HFileScanner
Direct Known Subclasses:
HFileReaderV1.ScannerV1
Enclosing class:
HFileReaderV1

protected abstract static class HFileReaderV1.AbstractScannerV1
extends AbstractHFileReader.Scanner


Field Summary
protected  int currBlock
           
protected  HFileReaderV1 reader
          This masks a field with the same name in the superclass and saves us the runtime overhead of casting from abstract reader to reader V1.
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner
blockBuffer, blockFetches, cacheBlocks, currKeyLen, currMemstoreTS, currMemstoreTSLen, currValueLen, isCompaction, pread
 
Constructor Summary
HFileReaderV1.AbstractScannerV1(HFileReaderV1 reader, boolean cacheBlocks, boolean pread, boolean isCompaction)
           
 
Method Summary
protected abstract  int blockSeek(byte[] key, int offset, int length, boolean seekBefore)
          Within a loaded block, seek looking for the first key that is smaller than (or equal to?) the key we are interested in.
protected abstract  void loadBlock(int bloc, boolean rewind)
           
 int reseekTo(byte[] key, int offset, int length)
           
 boolean seekBefore(byte[] key, int offset, int length)
           
 int seekTo(byte[] key, int offset, int length)
           
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner
assertSeeked, getReader, isSeeked, reseekTo, seekBefore, seekTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hbase.io.hfile.HFileScanner
getKey, getKeyString, getKeyValue, getValue, getValueString, next, seekTo
 

Field Detail

currBlock

protected int currBlock

reader

protected HFileReaderV1 reader
This masks a field with the same name in the superclass and saves us the runtime overhead of casting from abstract reader to reader V1.

Constructor Detail

HFileReaderV1.AbstractScannerV1

public HFileReaderV1.AbstractScannerV1(HFileReaderV1 reader,
                                       boolean cacheBlocks,
                                       boolean pread,
                                       boolean isCompaction)
Method Detail

blockSeek

protected abstract int blockSeek(byte[] key,
                                 int offset,
                                 int length,
                                 boolean seekBefore)
Within a loaded block, seek looking for the first key that is smaller than (or equal to?) the key we are interested in. A note on the seekBefore - if you have seekBefore = true, AND the first key in the block = key, then you'll get thrown exceptions.

Parameters:
key - to find
seekBefore - find the key before the exact match.
Returns:

loadBlock

protected abstract void loadBlock(int bloc,
                                  boolean rewind)
                           throws IOException
Throws:
IOException

seekTo

public int seekTo(byte[] key,
                  int offset,
                  int length)
           throws IOException
Throws:
IOException

reseekTo

public int reseekTo(byte[] key,
                    int offset,
                    int length)
             throws IOException
Throws:
IOException

seekBefore

public boolean seekBefore(byte[] key,
                          int offset,
                          int length)
                   throws IOException
Throws:
IOException


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