Class WALCellCodec
java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.WALCellCodec
- All Implemented Interfaces:
Codec
- Direct Known Subclasses:
SecureWALCellCodec
@LimitedPrivate({"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
Modifier and TypeClassDescription(package private) static class
static interface
static interface
(package private) static class
(package private) static class
static class
(package private) static class
(package private) static class
(package private) static class
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.codec.Codec
Codec.Decoder, Codec.Encoder
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CompressionContext
static final String
Configuration key for the class to use when encoding cells in the WAL -
Constructor Summary
ConstructorDescriptionAll subclasses must implement a no argument constructorWALCellCodec
(org.apache.hadoop.conf.Configuration conf, CompressionContext compression) Default constructor - all subclasses must implement a constructor with this signature if they are to be dynamically loaded from theConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionstatic WALCellCodec
create
(org.apache.hadoop.conf.Configuration conf, String cellCodecClsName, CompressionContext compression) Create and setup aWALCellCodec
from thecellCodecClsName
and CompressionContext, ifcellCodecClsName
is specified.static WALCellCodec
create
(org.apache.hadoop.conf.Configuration conf, CompressionContext compression) Create and setup aWALCellCodec
from the CompressionContext.getDecoder
(ByteBuff buf) static Class<?>
getWALCellCodecClass
(org.apache.hadoop.conf.Configuration conf) private static byte[]
uncompressByteString
(org.apache.hbase.thirdparty.com.google.protobuf.ByteString bs, Dictionary dict)
-
Field Details
-
WAL_CELL_CODEC_CLASS_KEY
Configuration key for the class to use when encoding cells in the WAL- See Also:
-
compression
-
-
Constructor Details
-
WALCellCodec
public WALCellCodec()All subclasses must implement a no argument constructor -
WALCellCodec
Default constructor - all subclasses must implement a constructor with this signature if they are to be dynamically loaded from theConfiguration
.- Parameters:
conf
- configuration to configure thiscompression
- compression the codec should support, can be null to indicate no compression
-
-
Method Details
-
getWALCellCodecClass
-
create
public static WALCellCodec create(org.apache.hadoop.conf.Configuration conf, String cellCodecClsName, CompressionContext compression) throws UnsupportedOperationException Create and setup aWALCellCodec
from thecellCodecClsName
and CompressionContext, ifcellCodecClsName
is specified. Otherwise Cell Codec classname is read fromConfiguration
. Fully prepares the codec for use.- Parameters:
conf
-Configuration
to read for the user-specified codec. If none is specified, uses aWALCellCodec
.cellCodecClsName
- name of codeccompression
- 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, CompressionContext compression) throws UnsupportedOperationException Create and setup aWALCellCodec
from the CompressionContext. Cell Codec classname is read fromConfiguration
. Fully prepares the codec for use.- Parameters:
conf
-Configuration
to read for the user-specified codec. If none is specified, uses aWALCellCodec
.compression
- compression the codec should use- Returns:
- a
WALCellCodec
ready for use. - Throws:
UnsupportedOperationException
- if the codec cannot be instantiated
-
uncompressByteString
private static byte[] uncompressByteString(org.apache.hbase.thirdparty.com.google.protobuf.ByteString bs, Dictionary dict) throws IOException - Throws:
IOException
-
getDecoder
- Specified by:
getDecoder
in interfaceCodec
-
getDecoder
- Specified by:
getDecoder
in interfaceCodec
-
getEncoder
- Specified by:
getEncoder
in interfaceCodec
-
getByteStringCompressor
-
getByteStringUncompressor
-
getNoneCompressor
-
getNoneUncompressor
-