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
Nested ClassesModifier and TypeClassDescription(package private) static classstatic interfacestatic interface(package private) static class(package private) static classstatic class(package private) static class(package private) static class(package private) static classNested classes/interfaces inherited from interface org.apache.hadoop.hbase.codec.Codec
Codec.Decoder, Codec.Encoder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CompressionContextstatic final StringConfiguration key for the class to use when encoding cells in the WAL -
Constructor Summary
ConstructorsConstructorDescriptionAll 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 WALCellCodeccreate(org.apache.hadoop.conf.Configuration conf, String cellCodecClsName, CompressionContext compression) Create and setup aWALCellCodecfrom thecellCodecClsNameand CompressionContext, ifcellCodecClsNameis specified.static WALCellCodeccreate(org.apache.hadoop.conf.Configuration conf, CompressionContext compression) Create and setup aWALCellCodecfrom 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 aWALCellCodecfrom thecellCodecClsNameand CompressionContext, ifcellCodecClsNameis specified. Otherwise Cell Codec classname is read fromConfiguration. Fully prepares the codec for use.- Parameters:
conf-Configurationto read for the user-specified codec. If none is specified, uses aWALCellCodec.cellCodecClsName- name of codeccompression- compression the codec should use- Returns:
- a
WALCellCodecready 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 aWALCellCodecfrom the CompressionContext. Cell Codec classname is read fromConfiguration. Fully prepares the codec for use.- Parameters:
conf-Configurationto read for the user-specified codec. If none is specified, uses aWALCellCodec.compression- compression the codec should use- Returns:
- a
WALCellCodecready 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:
getDecoderin interfaceCodec
-
getDecoder
- Specified by:
getDecoderin interfaceCodec
-
getEncoder
- Specified by:
getEncoderin interfaceCodec
-
getByteStringCompressor
-
getByteStringUncompressor
-
getNoneCompressor
-
getNoneUncompressor
-