org.apache.hadoop.hbase.regionserver.wal
Class WALEditCodec
java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.WALEditCodec
- All Implemented Interfaces:
- Codec
public class WALEditCodec
- extends Object
- implements Codec
Constructor Summary |
WALEditCodec()
Nullary Constructor - all subclass must support this to load from configuration. |
Method Summary |
static WALEditCodec |
create(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext)
Create and setup a WALEditCodec from the Configuration , if one has been
specified. |
Decoder |
getDecoder(InputStream is)
|
Encoder |
getEncoder(OutputStream os)
|
void |
init(org.apache.hadoop.conf.Configuration conf)
Initialize this - called exactly once after the object is instantiated and before any
other method in this class. |
void |
setCompression(org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WAL_EDIT_CODEC_CLASS_KEY
public static final String WAL_EDIT_CODEC_CLASS_KEY
- Configuration key for a custom class to use when serializing the WALEdits to the HLog
- See Also:
- Constant Field Values
WALEditCodec
public WALEditCodec()
- Nullary Constructor - all subclass must support this to load from configuration. Setup can be
completed in the
init(org.apache.hadoop.conf.Configuration)
method.
This implementation defaults to having no compression on the resulting Encoder
/
Decoder
, though it can be added via setCompression(CompressionContext)
init
public void init(org.apache.hadoop.conf.Configuration conf)
- Initialize this - called exactly once after the object is instantiated and before any
other method in this class. By default, does nothing.
- Parameters:
conf
- Configuration
from which to configure this
setCompression
public void setCompression(org.apache.hadoop.hbase.regionserver.wal.CompressionContext compression)
getDecoder
public Decoder getDecoder(InputStream is)
- Specified by:
getDecoder
in interface Codec
getEncoder
public Encoder getEncoder(OutputStream os)
- Specified by:
getEncoder
in interface Codec
create
public static WALEditCodec create(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext)
throws IOException
- Create and setup a
WALEditCodec
from the Configuration
, if one has been
specified. Fully prepares the codec for use in serialization.
- Parameters:
conf
- Configuration
to read for the user-specified codec. If none is specified,
uses a WALEditCodec
.compressionContext
- compression to setup on the codec.
- Returns:
- a
WALEditCodec
ready for use.
- Throws:
IOException
- if the codec cannot be created
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.