MySQL 8.4.0
Source Code Documentation
GR_decompress Class Reference

#include <gr_decompression.h>

Public Types

enum class  enum_decompression_error {
  DECOMPRESSION_OK = 0 , ER_COMPRESSION_TYPE_UNKOWN = 1 , ER_DECOMPRESSION_INIT_FAILURE = 2 , ER_DECOMPRESSION_EXCEEDS_MAX_BUFFER_SIZE = 3 ,
  ER_DECOMPRESSION_OUT_OF_MEMORY = 4 , ER_DECOMPRESSION_TRUNCATED = 5 , ER_DECOMPRESSION_CORRUPTED = 6 , ER_DECOMPRESSION_EOF = 7
}
 Decompression Error. More...
 
using Decompressor_t = mysql::binlog::event::compression::Decompressor
 
using Managed_buffer_t = Decompressor_t::Managed_buffer_t
 
using Decompress_status_t = mysql::binlog::event::compression::Decompress_status
 
using Char_t = Decompressor_t::Char_t
 
using String_t = std::basic_string< Char_t >
 

Public Member Functions

 GR_decompress (GR_compress::enum_compression_type compression_type=GR_compress::enum_compression_type::ZSTD_COMPRESSION)
 
 ~GR_decompress ()
 
GR_decompress::enum_decompression_error decompress (const unsigned char *compressed_data, size_t compressed_data_length, size_t output_size)
 This shall decompress the buffer provided and put the decompressed payload into the output buffer i.e. More...
 
std::pair< unsigned char *, std::size_t > get_buffer ()
 

Private Attributes

Decompressor_tm_decompressor {nullptr}
 ZSTD decompressor class object. More...
 
GR_compress::enum_compression_type m_compression_type
 The compression type. More...
 
std::string m_compressor_name {"Zstandard"}
 The compression library name. More...
 
Decompress_status_t m_status
 The compression status. More...
 
Managed_buffer_t m_managed_buffer
 The buffer holding decompressed data. More...
 

Member Typedef Documentation

◆ Char_t

◆ Decompress_status_t

◆ Decompressor_t

◆ Managed_buffer_t

◆ String_t

using GR_decompress::String_t = std::basic_string<Char_t>

Member Enumeration Documentation

◆ enum_decompression_error

Decompression Error.

Enumerator
DECOMPRESSION_OK 
ER_COMPRESSION_TYPE_UNKOWN 
ER_DECOMPRESSION_INIT_FAILURE 
ER_DECOMPRESSION_EXCEEDS_MAX_BUFFER_SIZE 
ER_DECOMPRESSION_OUT_OF_MEMORY 
ER_DECOMPRESSION_TRUNCATED 
ER_DECOMPRESSION_CORRUPTED 
ER_DECOMPRESSION_EOF 

Constructor & Destructor Documentation

◆ GR_decompress()

◆ ~GR_decompress()

GR_decompress::~GR_decompress ( )

Member Function Documentation

◆ decompress()

GR_decompress::enum_decompression_error GR_decompress::decompress ( const unsigned char *  compressed_data,
size_t  compressed_data_length,
size_t  output_size 
)

This shall decompress the buffer provided and put the decompressed payload into the output buffer i.e.

m_managed_buffer.

Parameters
compressed_datathe pointer to the input buffer holding the compressed data which needs to decompress.
compressed_data_lengththe size of the input data to decompress.
output_sizethe exact size of output decompressed data.

Note: The caller needs to provide exact expected decompressed data in in param 'output_size'. The ZSTD library api in libbinlogevents does have other api's which can be used to get decompressed data in several loops. But in this implementation user has to provide exact size he expects after decompressing data.

Returns
GR_compress::enum_decompression_error error type.

◆ get_buffer()

std::pair< unsigned char *, std::size_t > GR_decompress::get_buffer ( )

Member Data Documentation

◆ m_compression_type

GR_compress::enum_compression_type GR_decompress::m_compression_type
private

◆ m_compressor_name

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

The compression library name.

◆ m_decompressor

Decompressor_t* GR_decompress::m_decompressor {nullptr}
private

ZSTD decompressor class object.

◆ m_managed_buffer

Managed_buffer_t GR_decompress::m_managed_buffer
private

The buffer holding decompressed data.

◆ m_status

Decompress_status_t GR_decompress::m_status
private

The compression status.


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