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

Abstract base class for block compression codecs. More...

#include <BlockCompressionCodec.h>

Inheritance diagram for Hypertable::BlockCompressionCodec:
Inheritance graph
[legend]

Public Types

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...
 

Public Member Functions

virtual ~BlockCompressionCodec ()
 Destructor. More...
 
virtual void deflate (const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header, size_t reserve=0)=0
 Compresses a buffer. More...
 
virtual void inflate (const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header)=0
 Decompresses a buffer. More...
 
virtual void set_args (const Args &args)
 Sets arguments to control compression behavior. More...
 
virtual int get_type ()=0
 Returns compression type enum. More...
 

Static Public Member Functions

static const char * get_compressor_name (uint16_t algo)
 Returns string mnemonic for compression type. More...
 

Detailed Description

Abstract base class for block compression codecs.

Definition at line 47 of file BlockCompressionCodec.h.

Member Typedef Documentation

Compression codec argument vector.

Definition at line 63 of file BlockCompressionCodec.h.

Constructor & Destructor Documentation

virtual Hypertable::BlockCompressionCodec::~BlockCompressionCodec ( )
inlinevirtual

Destructor.

Definition at line 71 of file BlockCompressionCodec.h.

Member Function Documentation

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

Compresses a buffer.

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

Implemented in Hypertable::BlockCompressionCodecZlib, Hypertable::BlockCompressionCodecBmz, Hypertable::BlockCompressionCodecLzo, Hypertable::BlockCompressionCodecQuicklz, Hypertable::BlockCompressionCodecSnappy, and Hypertable::BlockCompressionCodecNone.

const char * BlockCompressionCodec::get_compressor_name ( uint16_t  algo)
static

Returns string mnemonic for compression type.

Parameters
algoCompression type (see BlockCompressionCodec::Type)
Returns
String mnemonic representing name of compression algorithm

Definition at line 44 of file BlockCompressionCodec.cc.

virtual int Hypertable::BlockCompressionCodec::get_type ( )
pure virtual
virtual void Hypertable::BlockCompressionCodec::inflate ( const DynamicBuffer input,
DynamicBuffer output,
BlockHeader header 
)
pure virtual
virtual void Hypertable::BlockCompressionCodec::set_args ( const Args args)
inlinevirtual

Sets arguments to control compression behavior.

This method provides a default implementation for derived classes and simply throws an exception for each argument

Parameters
argsCompressor specific arguments
Exceptions
ExceptionCode set to Error::BLOCK_COMPRESSOR_INVALID_ARG

Reimplemented in Hypertable::BlockCompressionCodecBmz, and Hypertable::BlockCompressionCodecZlib.

Definition at line 93 of file BlockCompressionCodec.h.


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