org.apache.hadoop.hbase.regionserver
Interface KeyValueScanner

All Known Implementing Classes:
KeyValueHeap, MemStore.MemStoreScanner

public interface KeyValueScanner

Scanner that returns the next KeyValue.


Method Summary
 void close()
          Close the KeyValue scanner.
 long getSequenceID()
          Get the sequence id associated with this KeyValueScanner.
 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)
          Reseek the scanner at or after the specified KeyValue.
 boolean seek(KeyValue key)
          Seek the scanner at or after the specified KeyValue.
 

Method Detail

peek

KeyValue peek()
Look at the next KeyValue in this scanner, but do not iterate scanner.

Returns:
the next KeyValue

next

KeyValue next()
              throws IOException
Return the next KeyValue in this scanner, iterating the scanner

Returns:
the next KeyValue
Throws:
IOException

seek

boolean seek(KeyValue key)
             throws IOException
Seek the scanner at or after the specified KeyValue.

Parameters:
key - seek value
Returns:
true if scanner has values left, false if end of scanner
Throws:
IOException

reseek

boolean reseek(KeyValue key)
               throws IOException
Reseek the scanner at or after the specified KeyValue. This method is guaranteed to seek to or before the required key only if the key comes after the current position of the scanner. Should not be used to seek to a key which may come before the current position.

Parameters:
key - seek value (should be non-null)
Returns:
true if scanner has values left, false if end of scanner
Throws:
IOException

getSequenceID

long getSequenceID()
Get the sequence id associated with this KeyValueScanner. This is required for comparing multiple files to find out which one has the latest data. The default implementation for this would be to return 0. A file having lower sequence id will be considered to be the older one.


close

void close()
Close the KeyValue scanner.



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