org.apache.hadoop.hbase.io.hfile
Class HFileReaderV2.EncodedScannerV2

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner
      extended by org.apache.hadoop.hbase.io.hfile.HFileReaderV2.AbstractScannerV2
          extended by org.apache.hadoop.hbase.io.hfile.HFileReaderV2.EncodedScannerV2
All Implemented Interfaces:
HFileScanner
Enclosing class:
HFileReaderV2

protected static class HFileReaderV2.EncodedScannerV2
extends HFileReaderV2.AbstractScannerV2

ScannerV2 that operates on encoded data blocks.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.HFileReaderV2.AbstractScannerV2
block, nextIndexedKey
 
Fields inherited from class org.apache.hadoop.hbase.io.hfile.AbstractHFileReader.Scanner
blockBuffer, blockFetches, cacheBlocks, currKeyLen, currMemstoreTS, currMemstoreTSLen, currValueLen, isCompaction, pread, reader
 
Constructor Summary
HFileReaderV2.EncodedScannerV2(HFileReaderV2 reader, boolean cacheBlocks, boolean pread, boolean isCompaction, boolean includesMemstoreTS)
           
 
Method Summary
protected  ByteBuffer getFirstKeyInBlock(HFileBlock curBlock)
           
 ByteBuffer getKey()
          Gets a buffer view to the current key.
 String getKeyString()
          Convenience method to get a copy of the key as a string - interpreting the bytes as UTF8.
 KeyValue getKeyValue()
           
 ByteBuffer getValue()
          Gets a buffer view to the current value.
 String getValueString()
          Convenience method to get a copy of the value as a string - interpreting the bytes as UTF8.
protected  int loadBlockAndSeekToKey(HFileBlock seekToBlock, byte[] nextIndexedKey, boolean rewind, byte[] key, int offset, int length, boolean seekBefore)
           
 boolean next()
          Scans to the next entry in the file.
 boolean seekTo()
          Positions this scanner at the start of the file.
 
Methods inherited from class org.apache.hadoop.hbase.io.hfile.HFileReaderV2.AbstractScannerV2
readNextDataBlock, reseekTo, seekBefore, seekTo, seekTo
 
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
 

Constructor Detail

HFileReaderV2.EncodedScannerV2

public HFileReaderV2.EncodedScannerV2(HFileReaderV2 reader,
                                      boolean cacheBlocks,
                                      boolean pread,
                                      boolean isCompaction,
                                      boolean includesMemstoreTS)
Method Detail

seekTo

public boolean seekTo()
               throws IOException
Description copied from interface: HFileScanner
Positions this scanner at the start of the file.

Returns:
False if empty file; i.e. a call to next would return false and the current key and value are undefined.
Throws:
IOException

next

public boolean next()
             throws IOException
Description copied from interface: HFileScanner
Scans to the next entry in the file.

Returns:
Returns false if you are at the end otherwise true if more in file.
Throws:
IOException

getKey

public ByteBuffer getKey()
Description copied from interface: HFileScanner
Gets a buffer view to the current key. You must call HFileScanner.seekTo(byte[]) before this method.

Returns:
byte buffer for the key. The limit is set to the key size, and the position is 0, the start of the buffer view.

getValue

public ByteBuffer getValue()
Description copied from interface: HFileScanner
Gets a buffer view to the current value. You must call HFileScanner.seekTo(byte[]) before this method.

Returns:
byte buffer for the value. The limit is set to the value size, and the position is 0, the start of the buffer view.

getKeyValue

public KeyValue getKeyValue()
Returns:
Instance of KeyValue.

getKeyString

public String getKeyString()
Description copied from interface: HFileScanner
Convenience method to get a copy of the key as a string - interpreting the bytes as UTF8. You must call HFileScanner.seekTo(byte[]) before this method.

Returns:
key as a string

getValueString

public String getValueString()
Description copied from interface: HFileScanner
Convenience method to get a copy of the value as a string - interpreting the bytes as UTF8. You must call HFileScanner.seekTo(byte[]) before this method.

Returns:
value as a string

getFirstKeyInBlock

protected ByteBuffer getFirstKeyInBlock(HFileBlock curBlock)
Specified by:
getFirstKeyInBlock in class HFileReaderV2.AbstractScannerV2

loadBlockAndSeekToKey

protected int loadBlockAndSeekToKey(HFileBlock seekToBlock,
                                    byte[] nextIndexedKey,
                                    boolean rewind,
                                    byte[] key,
                                    int offset,
                                    int length,
                                    boolean seekBefore)
                             throws IOException
Specified by:
loadBlockAndSeekToKey in class HFileReaderV2.AbstractScannerV2
Throws:
IOException


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