org.apache.hadoop.hbase.codec
Class BaseEncoder

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.BaseEncoder
All Implemented Interfaces:
Encoder
Direct Known Subclasses:
KeyValueCodec.KeyValueEncoder

public abstract class BaseEncoder
extends Object
implements Encoder


Field Summary
protected  boolean flushed
           
protected  OutputStream out
           
 
Constructor Summary
BaseEncoder(OutputStream out)
           
 
Method Summary
protected  void checkFlushed()
           
 void flush()
          Let the implementation decide what to do.
abstract  void write(KeyValue cell)
          Implementation must copy the entire state of the cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected final OutputStream out

flushed

protected boolean flushed
Constructor Detail

BaseEncoder

public BaseEncoder(OutputStream out)
Method Detail

write

public abstract void write(KeyValue cell)
                    throws IOException
Description copied from interface: Encoder
Implementation must copy the entire state of the cell. If the written cell is modified immediately after the write method returns, the modifications must have absolutely no effect on the copy of the cell that was added in the write.

Specified by:
write in interface Encoder
Parameters:
cell - cell to serialize
Throws:
IOException

checkFlushed

protected void checkFlushed()
                     throws CodecException
Throws:
CodecException

flush

public void flush()
           throws IOException
Description copied from interface: Encoder
Let the implementation decide what to do. Usually means writing accumulated data into a byte[] that can then be read from the implementation to be sent to disk, put in the block cache, or sent over the network.

Specified by:
flush in interface Encoder
Throws:
IOException


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