org.apache.hadoop.hbase.codec
Class BaseEncoder

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

public abstract class BaseEncoder
extends Object
implements Codec.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(Cell 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(Cell cell)
                    throws IOException
Description copied from interface: CellOutputStream
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 CellOutputStream
Parameters:
cell - Cell to write out
Throws:
IOException

checkFlushed

protected void checkFlushed()
                     throws CodecException
Throws:
CodecException

flush

public void flush()
           throws IOException
Description copied from interface: CellOutputStream
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 CellOutputStream
Throws:
IOException


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