org.apache.hadoop.hbase.codec
Interface Decoder

All Known Implementing Classes:
BaseDecoder, KeyValueCodec.KeyValueDecoder

@InterfaceAudience.Private
@InterfaceStability.Unstable
public interface Decoder

An interface for iterating through a sequence of KeyValues. Similar to Java's Iterator, but without the hasNext() or remove() methods. The hasNext() method is problematic because it may require actually loading the next object, which in turn requires storing the previous object somewhere.

The core data block decoder should be as fast as possible, so we push the complexity and performance expense of concurrently tracking multiple cells to layers above the Decoder.

The current() method will return a reference to a the decodable type.

Typical usage:

 while (scanner.next()) {
   KeyValue kv = scanner.get();
   // do something
 }
 


Method Summary
 boolean advance()
          Advance the scanner 1 object
 KeyValue current()
           
 

Method Detail

current

KeyValue current()
Returns:
the current object which may be mutable

advance

boolean advance()
                throws IOException
Advance the scanner 1 object

Returns:
true if the next cell is found and current() will return a valid object
Throws:
IOException - if there is an error reading the next entry


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