MySQL 8.4.2
Source Code Documentation
mysql::binlog::event::compression::Zstd_dec Class Reference

Decompressor class that uses the ZSTD library. More...

#include <zstd_dec.h>

Inheritance diagram for mysql::binlog::event::compression::Zstd_dec:
[legend]

Public Types

using Memory_resource_t = mysql::binlog::event::resource::Memory_resource
 
using Char_t = unsigned char
 
using Grow_constraint_t = mysql::binlog::event::compression::buffer::Grow_constraint
 
using Size_t = mysql::binlog::event::compression::buffer::Buffer_view< Char_t >::Size_t
 
- Public Types inherited from mysql::binlog::event::compression::Decompressor
using Char_t = unsigned char
 
using Size_t = mysql::binlog::event::compression::buffer::Buffer_view< Char_t >::Size_t
 
using Managed_buffer_t = mysql::binlog::event::compression::buffer::Managed_buffer< Char_t >
 
using Grow_constraint_t = mysql::binlog::event::compression::buffer::Grow_constraint
 

Public Member Functions

 Zstd_dec (const Memory_resource_t &memory_resource=Memory_resource_t())
 
 ~Zstd_dec () override
 
 Zstd_dec (const Zstd_dec &)=delete
 
 Zstd_dec (const Zstd_dec &&)=delete
 
Zstd_decoperator= (const Zstd_dec &)=delete
 
Zstd_decoperator= (const Zstd_dec &&)=delete
 
- Public Member Functions inherited from mysql::binlog::event::compression::Decompressor
 Decompressor ()=default
 
 Decompressor (const Decompressor &)=delete
 
 Decompressor (const Decompressor &&)=delete
 
const Decompressoroperator= (const Decompressor &)=delete
 
const Decompressoroperator= (const Decompressor &&)=delete
 
virtual ~Decompressor ()=default
 
type get_type_code () const
 
void reset ()
 Reset the frame. More...
 
template<class Input_char_t >
void feed (const Input_char_t *input_data, Size_t input_size)
 Submit data to decompress. More...
 
Decompress_status decompress (Managed_buffer_t &out, Size_t output_size)
 Decompress an exact, given number of bytes. More...
 
std::pair< Decompress_status, Size_tdecompress (Char_t *out, Size_t output_size)
 Decompress an exact, given number of bytes. More...
 
Grow_constraint_t get_grow_constraint_hint () const
 Return a Grow_constraint that may be used with the Managed_buffer storing the output, in order to optimize memory usage for a particular compression algorithm. More...
 

Static Public Attributes

static constexpr type type_code = ZSTD
 

Private Member Functions

type do_get_type_code () const override
 
void do_reset () override
 Implement do_reset. More...
 
void do_feed (const Char_t *input_data, Size_t input_size) override
 Implement feed. More...
 
std::pair< Decompress_status, Size_tdo_decompress (Char_t *out, Size_t output_size) override
 Implement decompress. More...
 
Grow_constraint_t do_get_grow_constraint_hint () const override
 Implement get_grow_constraint_hint. More...
 
void destroy ()
 Deallocate the ZSTD decompression context. More...
 

Static Private Member Functions

static void * zstd_mem_res_alloc (void *opaque, size_t size)
 
static void zstd_mem_res_free (void *opaque, void *address)
 

Private Attributes

ZSTD_DStream * m_ctx {nullptr}
 ZSTD decompression context object. More...
 
ZSTD_inBuffer m_ibuf {nullptr, 0, 0}
 ZSTD input buffer. More...
 
bool m_frame_boundary = false
 
Memory_resource_t m_memory_resource
 Instrumented memory allocator object. More...
 
ZSTD_customMem m_zstd_custom_mem
 ZSTD memory allocator objects and functions. More...
 

Detailed Description

Decompressor class that uses the ZSTD library.

Member Typedef Documentation

◆ Char_t

◆ Grow_constraint_t

◆ Memory_resource_t

◆ Size_t

Constructor & Destructor Documentation

◆ Zstd_dec() [1/3]

mysql::binlog::event::compression::Zstd_dec::Zstd_dec ( const Memory_resource_t memory_resource = Memory_resource_t())

◆ ~Zstd_dec()

mysql::binlog::event::compression::Zstd_dec::~Zstd_dec ( )
override

◆ Zstd_dec() [2/3]

mysql::binlog::event::compression::Zstd_dec::Zstd_dec ( const Zstd_dec )
delete

◆ Zstd_dec() [3/3]

mysql::binlog::event::compression::Zstd_dec::Zstd_dec ( const Zstd_dec &&  )
delete

Member Function Documentation

◆ destroy()

void mysql::binlog::event::compression::Zstd_dec::destroy ( )
private

Deallocate the ZSTD decompression context.

◆ do_decompress()

std::pair< Decompress_status, Decompressor::Size_t > mysql::binlog::event::compression::Zstd_dec::do_decompress ( Char_t out,
Size_t  output_size 
)
overrideprivatevirtual

Implement decompress.

This differs from decompress in that it does not have to reset the frame when returning out_of_memory or corrupted; the caller does that.

Implements mysql::binlog::event::compression::Decompressor.

◆ do_feed()

void mysql::binlog::event::compression::Zstd_dec::do_feed ( const Char_t input_data,
Size_t  input_size 
)
overrideprivatevirtual

◆ do_get_grow_constraint_hint()

Decompressor::Grow_constraint_t mysql::binlog::event::compression::Zstd_dec::do_get_grow_constraint_hint ( ) const
overrideprivatevirtual

Implement get_grow_constraint_hint.

In this base class, the function returns a default-constructed Grow_constraint, i.e., one which does not limit the Grow_calculator.

Reimplemented from mysql::binlog::event::compression::Decompressor.

◆ do_get_type_code()

type mysql::binlog::event::compression::Zstd_dec::do_get_type_code ( ) const
overrideprivatevirtual

◆ do_reset()

void mysql::binlog::event::compression::Zstd_dec::do_reset ( )
overrideprivatevirtual

Implement do_reset.

Implements mysql::binlog::event::compression::Decompressor.

◆ operator=() [1/2]

Zstd_dec & mysql::binlog::event::compression::Zstd_dec::operator= ( const Zstd_dec &&  )
delete

◆ operator=() [2/2]

Zstd_dec & mysql::binlog::event::compression::Zstd_dec::operator= ( const Zstd_dec )
delete

◆ zstd_mem_res_alloc()

void * mysql::binlog::event::compression::Zstd_dec::zstd_mem_res_alloc ( void *  opaque,
size_t  size 
)
staticprivate

◆ zstd_mem_res_free()

void mysql::binlog::event::compression::Zstd_dec::zstd_mem_res_free ( void *  opaque,
void *  address 
)
staticprivate

Member Data Documentation

◆ m_ctx

ZSTD_DStream* mysql::binlog::event::compression::Zstd_dec::m_ctx {nullptr}
private

ZSTD decompression context object.

◆ m_frame_boundary

bool mysql::binlog::event::compression::Zstd_dec::m_frame_boundary = false
private

◆ m_ibuf

ZSTD_inBuffer mysql::binlog::event::compression::Zstd_dec::m_ibuf {nullptr, 0, 0}
private

ZSTD input buffer.

◆ m_memory_resource

Memory_resource_t mysql::binlog::event::compression::Zstd_dec::m_memory_resource
private

Instrumented memory allocator object.

◆ m_zstd_custom_mem

ZSTD_customMem mysql::binlog::event::compression::Zstd_dec::m_zstd_custom_mem
private

ZSTD memory allocator objects and functions.

◆ type_code

constexpr type mysql::binlog::event::compression::Zstd_dec::type_code = ZSTD
staticconstexpr

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