org.apache.hadoop.hbase.regionserver.wal
Class WALCellCodec

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.wal.WALCellCodec
All Implemented Interfaces:
Codec
Direct Known Subclasses:
SecureWALCellCodec

@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix","Configuration"})
public class WALCellCodec
extends Object
implements Codec

Compression in this class is lifted off Compressor/KeyValueCompression. This is a pure coincidence... they are independent and don't have to be compatible. This codec is used at server side for writing cells to WAL as well as for sending edits as part of the distributed splitting process.


Nested Class Summary
static interface WALCellCodec.ByteStringCompressor
           
static interface WALCellCodec.ByteStringUncompressor
           
 class WALCellCodec.EnsureKvEncoder
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.codec.Codec
Codec.Decoder, Codec.Encoder
 
Field Summary
protected  org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression
           
protected  WALCellCodec.ByteStringUncompressor statelessUncompressor
           
static String WAL_CELL_CODEC_CLASS_KEY
          Configuration key for the class to use when encoding cells in the WAL
 
Constructor Summary
WALCellCodec()
          All subclasses must implement a no argument constructor
WALCellCodec(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
          Default constructor - all subclasses must implement a constructor with this signature if they are to be dynamically loaded from the Configuration.
 
Method Summary
static WALCellCodec create(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
          Create and setup a WALCellCodec from the CompressionContext.
static WALCellCodec create(org.apache.hadoop.conf.Configuration conf, String cellCodecClsName, org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
          Create and setup a WALCellCodec from the cellCodecClsName and CompressionContext, if cellCodecClsName is specified.
 WALCellCodec.ByteStringCompressor getByteStringCompressor()
           
 WALCellCodec.ByteStringUncompressor getByteStringUncompressor()
           
 Codec.Decoder getDecoder(InputStream is)
           
 Codec.Encoder getEncoder(OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAL_CELL_CODEC_CLASS_KEY

public static final String WAL_CELL_CODEC_CLASS_KEY
Configuration key for the class to use when encoding cells in the WAL

See Also:
Constant Field Values

compression

protected final org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression

statelessUncompressor

protected final WALCellCodec.ByteStringUncompressor statelessUncompressor
Constructor Detail

WALCellCodec

public WALCellCodec()
All subclasses must implement a no argument constructor


WALCellCodec

public WALCellCodec(org.apache.hadoop.conf.Configuration conf,
                    org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
Default constructor - all subclasses must implement a constructor with this signature if they are to be dynamically loaded from the Configuration.

Parameters:
conf - configuration to configure this
compression - compression the codec should support, can be null to indicate no compression
Method Detail

create

public static WALCellCodec create(org.apache.hadoop.conf.Configuration conf,
                                  String cellCodecClsName,
                                  org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
                           throws UnsupportedOperationException
Create and setup a WALCellCodec from the cellCodecClsName and CompressionContext, if cellCodecClsName is specified. Otherwise Cell Codec classname is read from Configuration. Fully prepares the codec for use.

Parameters:
conf - Configuration to read for the user-specified codec. If none is specified, uses a WALCellCodec.
compression - compression the codec should use
Returns:
a WALCellCodec ready for use.
Throws:
UnsupportedOperationException - if the codec cannot be instantiated

create

public static WALCellCodec create(org.apache.hadoop.conf.Configuration conf,
                                  org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
                           throws UnsupportedOperationException
Create and setup a WALCellCodec from the CompressionContext. Cell Codec classname is read from Configuration. Fully prepares the codec for use.

Parameters:
conf - Configuration to read for the user-specified codec. If none is specified, uses a WALCellCodec.
compression - compression the codec should use
Returns:
a WALCellCodec ready for use.
Throws:
UnsupportedOperationException - if the codec cannot be instantiated

getDecoder

public Codec.Decoder getDecoder(InputStream is)
Specified by:
getDecoder in interface Codec

getEncoder

public Codec.Encoder getEncoder(OutputStream os)
Specified by:
getEncoder in interface Codec

getByteStringCompressor

public WALCellCodec.ByteStringCompressor getByteStringCompressor()

getByteStringUncompressor

public WALCellCodec.ByteStringUncompressor getByteStringUncompressor()


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.