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

Block compressor that performs no compression. More...

#include <BlockCompressionCodecNone.h>

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

Public Member Functions

 BlockCompressionCodecNone (const Args &args)
 Constructor. More...
 
virtual void deflate (const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header, size_t reserve=0)
 Transforms a buffer into a serialized block using no compression. More...
 
virtual void inflate (const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header)
 Deserializes a block produced by deflate(). More...
 
virtual int get_type ()
 Returns enum value representing compression type NONE. 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...
 

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 performs no compression.

This class exists provides a way to produce uncompressed serialized blocks using the BlockCompressionCodec framework.

Definition at line 40 of file BlockCompressionCodecNone.h.

Constructor & Destructor Documentation

Hypertable::BlockCompressionCodecNone::BlockCompressionCodecNone ( 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 49 of file BlockCompressionCodecNone.h.

Member Function Documentation

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

Transforms a buffer into a serialized block using no compression.

This method reserves enough space in output to hold the serialized header followed by the input buffer followed by reserve bytes. 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:

headeruncompressed 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 39 of file BlockCompressionCodecNone.cc.

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

Returns enum value representing compression type NONE.

Returns the enum value NONE

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

Implements Hypertable::BlockCompressionCodec.

Definition at line 85 of file BlockCompressionCodecNone.h.

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

Deserializes a block produced by deflate().

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

Implements Hypertable::BlockCompressionCodec.

Definition at line 58 of file BlockCompressionCodecNone.cc.


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