MySQL 9.1.0
Source Code Documentation
GR_compress Class Reference

#include <gr_compression.h>

Public Types

enum class  enum_compression_type { NO_COMPRESSION = 0 , ZSTD_COMPRESSION = 1 }
 Compression Type. More...
 
enum class  enum_compression_error {
  COMPRESSION_OK = 0 , ER_COMPRESSION_TYPE_UNKOWN = 1 , ER_COMPRESSION_INIT_FAILURE = 2 , ER_COMPRESSION_EXCEEDS_MAX_BUFFER_SIZE = 3 ,
  ER_COMPRESSION_OUT_OF_MEMORY = 4
}
 Compression Error. More...
 
using Compressor_t = mysql::binlog::event::compression::Compressor
 
using Compress_status_t = mysql::containers::buffers::Grow_status
 
using Managed_buffer_sequence_t = mysql::containers::buffers::Managed_buffer_sequence<>
 
using Char_t = Managed_buffer_sequence_t::Char_t
 

Public Member Functions

 GR_compress (enum_compression_type compression_type=enum_compression_type::ZSTD_COMPRESSION)
 
 ~GR_compress ()
 
GR_compress::enum_compression_error compress (unsigned char *data, size_t length)
 This shall compress the buffer provided and put the compressed payload into the m_managed_buffer_sequence which is non-contiguous growable memory buffer. More...
 
std::pair< unsigned char *, std::size_t > allocate_and_get_buffer ()
 
size_t get_uncompressed_data_size ()
 

Private Attributes

Compressor_tm_compressor {nullptr}
 ZSTD compressor class object. More...
 
enum_compression_type m_compression_type
 The compression type. More...
 
std::string m_compressor_name {"Zstandard"}
 The compression library name. More...
 
Compress_status_t m_status
 The compression status. More...
 
Managed_buffer_sequence_t m_managed_buffer_sequence
 The buffer holding compressed data. More...
 
size_t m_uncompressed_data_size {0}
 The uncompressed data size. More...
 
size_t m_compressed_data_size {0}
 The compressed data size. More...
 

Member Typedef Documentation

◆ Char_t

◆ Compress_status_t

◆ Compressor_t

◆ Managed_buffer_sequence_t

Member Enumeration Documentation

◆ enum_compression_error

Compression Error.

Enumerator
COMPRESSION_OK 
ER_COMPRESSION_TYPE_UNKOWN 
ER_COMPRESSION_INIT_FAILURE 
ER_COMPRESSION_EXCEEDS_MAX_BUFFER_SIZE 
ER_COMPRESSION_OUT_OF_MEMORY 

◆ enum_compression_type

Compression Type.

Enumerator
NO_COMPRESSION 
ZSTD_COMPRESSION 

Constructor & Destructor Documentation

◆ GR_compress()

GR_compress::GR_compress ( enum_compression_type  compression_type = enum_compression_type::ZSTD_COMPRESSION)

◆ ~GR_compress()

GR_compress::~GR_compress ( )

Member Function Documentation

◆ allocate_and_get_buffer()

std::pair< unsigned char *, std::size_t > GR_compress::allocate_and_get_buffer ( )

◆ compress()

GR_compress::enum_compression_error GR_compress::compress ( unsigned char *  data,
size_t  length 
)

This shall compress the buffer provided and put the compressed payload into the m_managed_buffer_sequence which is non-contiguous growable memory buffer.

Parameters
dataa pointer to the buffer holding the data to compress
lengththe size of the data to compress.
Returns
enum_compression_error error type. The compressed data is stored in m_managed_buffer_sequence which can be retrieved using allocate_and_get_buffer().

◆ get_uncompressed_data_size()

size_t GR_compress::get_uncompressed_data_size ( )

Member Data Documentation

◆ m_compressed_data_size

size_t GR_compress::m_compressed_data_size {0}
private

The compressed data size.

◆ m_compression_type

enum_compression_type GR_compress::m_compression_type
private

◆ m_compressor

Compressor_t* GR_compress::m_compressor {nullptr}
private

ZSTD compressor class object.

◆ m_compressor_name

std::string GR_compress::m_compressor_name {"Zstandard"}
private

The compression library name.

◆ m_managed_buffer_sequence

Managed_buffer_sequence_t GR_compress::m_managed_buffer_sequence
private

The buffer holding compressed data.

◆ m_status

Compress_status_t GR_compress::m_status
private

The compression status.

◆ m_uncompressed_data_size

size_t GR_compress::m_uncompressed_data_size {0}
private

The uncompressed data size.


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