0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::BlockCompressionCodecQuicklz Class Reference

Block compressor that uses the QUICKLZ algorithm. More...

#include <BlockCompressionCodecQuicklz.h>

Inheritance diagram for Hypertable::BlockCompressionCodecQuicklz:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::BlockCompressionCodecQuicklz:
Collaboration graph
[legend]

Public Member Functions

 BlockCompressionCodecQuicklz (const Args &args)
 Constructor. More...
 
virtual ~BlockCompressionCodecQuicklz ()
 Destructor. More...
 
virtual void deflate (const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header, size_t reserve=0)
 Compresses a buffer using the QUICKLZ algorithm. More...
 
virtual void inflate (const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header)
 Decompresses a buffer compressed with the QUICKLZ algorithm. More...
 
virtual int get_type ()
 Returns enum value representing compression type QUICKLZ. More...
 
- Public Member Functions inherited from Hypertable::BlockCompressionCodec
virtual ~BlockCompressionCodec ()
 Destructor. More...
 
virtual void set_args (const Args &args)
 Sets arguments to control compression behavior. More...
 

Private Attributes

qlz_state_compress m_compress
 Compression state. More...
 
qlz_state_decompress m_decompress
 Decompression state. More...
 

Additional Inherited Members

- Public Types inherited from Hypertable::BlockCompressionCodec
enum  Type {
  UNKNOWN =-1, NONE =0, BMZ =1, ZLIB =2,
  LZO =3, QUICKLZ =4, SNAPPY =5, COMPRESSION_TYPE_LIMIT =6
}
 Enumeration for compression type. More...
 
typedef std::vector< StringArgs
 Compression codec argument vector. More...
 
- Static Public Member Functions inherited from Hypertable::BlockCompressionCodec
static const char * get_compressor_name (uint16_t algo)
 Returns string mnemonic for compression type. More...
 

Detailed Description

Block compressor that uses the QUICKLZ algorithm.

This class provides a way to compress and decompress blocks of data using the quicklz algorithm, a general purpose compression algorithm that provides good compression speed. The quicklz compression algorithm is appropriate for compressing blocks for things like the commit log where compression speed is more important than decompression speed.

Definition at line 45 of file BlockCompressionCodecQuicklz.h.

Constructor & Destructor Documentation

Hypertable::BlockCompressionCodecQuicklz::BlockCompressionCodecQuicklz ( const Args args)
inline

Constructor.

This constructor passes args to the default implementation of set_args() since it does not support any arguments.

Parameters
argsArguments to control compression behavior
Exceptions
ExceptionCode set to Error::BLOCK_COMPRESSOR_INVALID_ARG

Definition at line 54 of file BlockCompressionCodecQuicklz.h.

virtual Hypertable::BlockCompressionCodecQuicklz::~BlockCompressionCodecQuicklz ( )
inlinevirtual

Destructor.

Definition at line 57 of file BlockCompressionCodecQuicklz.h.

Member Function Documentation

void BlockCompressionCodecQuicklz::deflate ( const DynamicBuffer input,
DynamicBuffer output,
BlockHeader header,
size_t  reserve = 0 
)
virtual

Compresses a buffer using the QUICKLZ algorithm.

This method reserves enough space in output to hold the serialized header followed by the compressed input followed by reserve bytes. If the resulting compressed buffer is larger than the input buffer, then the input buffer is copied directly to the output buffer and the compression type is set to BlockCompressionCodec::NONE. Before serailizing header, the data_length, data_zlength, data_checksum, and compression_type fields are set appropriately. The output buffer is formatted as follows:

headercompressed datareserve
Parameters
inputInput buffer
outputOutput buffer
headerBlock header populated by function
reserveAdditional space to reserve at end of output buffer

Implements Hypertable::BlockCompressionCodec.

Definition at line 42 of file BlockCompressionCodecQuicklz.cc.

virtual int Hypertable::BlockCompressionCodecQuicklz::get_type ( )
inlinevirtual

Returns enum value representing compression type QUICKLZ.

Returns the enum value QUICKLZ

See also
BlockCompressionCodec::QUICKLZ
Returns
Compression type (QUICKLZ)

Implements Hypertable::BlockCompressionCodec.

Definition at line 94 of file BlockCompressionCodecQuicklz.h.

void BlockCompressionCodecQuicklz::inflate ( const DynamicBuffer input,
DynamicBuffer output,
BlockHeader header 
)
virtual

Decompresses a buffer compressed with the QUICKLZ algorithm.

See also
deflate() for description of input buffer format
Parameters
inputInput buffer
outputOutput buffer
headerBlock header

Implements Hypertable::BlockCompressionCodec.

Definition at line 78 of file BlockCompressionCodecQuicklz.cc.

Member Data Documentation

qlz_state_compress Hypertable::BlockCompressionCodecQuicklz::m_compress
private

Compression state.

Definition at line 99 of file BlockCompressionCodecQuicklz.h.

qlz_state_decompress Hypertable::BlockCompressionCodecQuicklz::m_decompress
private

Decompression state.

Definition at line 102 of file BlockCompressionCodecQuicklz.h.


The documentation for this class was generated from the following files: