org.apache.hadoop.hbase.regionserver
Class MemStore.MemStoreScanner

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.MemStore.MemStoreScanner
All Implemented Interfaces:
KeyValueScanner
Enclosing class:
MemStore

protected class MemStore.MemStoreScanner
extends Object
implements KeyValueScanner


Method Summary
 void close()
          Close the KeyValue scanner.
protected  KeyValue getLowest(KeyValue first, KeyValue second)
           
protected  KeyValue getNext(Iterator<KeyValue> it)
           
 long getSequenceID()
          MemStoreScanner returns max value as sequence id because it will always have the latest data among all files.
 KeyValue next()
          Return the next KeyValue in this scanner, iterating the scanner
 KeyValue peek()
          Look at the next KeyValue in this scanner, but do not iterate scanner.
 boolean reseek(KeyValue key)
          Move forward on the sub-lists set previously by seek.
 boolean seek(KeyValue key)
          Set the scanner at the seek key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNext

protected KeyValue getNext(Iterator<KeyValue> it)

seek

public boolean seek(KeyValue key)
Set the scanner at the seek key. Must be called only once: there is no thread safety between the scanner and the memStore.

Specified by:
seek in interface KeyValueScanner
Parameters:
key - seek value
Returns:
false if the key is null or if there is no data

reseek

public boolean reseek(KeyValue key)
Move forward on the sub-lists set previously by seek.

Specified by:
reseek in interface KeyValueScanner
Parameters:
key - seek value (should be non-null)
Returns:
true if there is at least one KV to read, false otherwise

peek

public KeyValue peek()
Description copied from interface: KeyValueScanner
Look at the next KeyValue in this scanner, but do not iterate scanner.

Specified by:
peek in interface KeyValueScanner
Returns:
the next KeyValue

next

public KeyValue next()
Description copied from interface: KeyValueScanner
Return the next KeyValue in this scanner, iterating the scanner

Specified by:
next in interface KeyValueScanner
Returns:
the next KeyValue

getLowest

protected KeyValue getLowest(KeyValue first,
                             KeyValue second)

close

public void close()
Description copied from interface: KeyValueScanner
Close the KeyValue scanner.

Specified by:
close in interface KeyValueScanner

getSequenceID

public long getSequenceID()
MemStoreScanner returns max value as sequence id because it will always have the latest data among all files.

Specified by:
getSequenceID in interface KeyValueScanner


Copyright © 2013 Cloudera. All Rights Reserved.