MySQL 9.1.0
Source Code Documentation
compression.h File Reference
#include <sstream>
#include <string>
#include <vector>
#include "my_inttypes.h"
#include "mysql_com.h"

Go to the source code of this file.

Macros

#define COMPRESSION_ALGORITHM_ZLIB   "zlib"
 
#define COMPRESSION_ALGORITHM_ZSTD   "zstd"
 
#define COMPRESSION_ALGORITHM_UNCOMPRESSED   "uncompressed"
 
#define COMPRESSION_ALGORITHM_NAME_LENGTH_MAX   32
 
#define COMPRESSION_ALGORITHM_COUNT_MAX   3
 
#define COMPRESSION_ALGORITHM_NAME_BUFFER_SIZE
 
#define PROTOCOL_COMPRESSION_DEFAULT_VALUE   "zlib,zstd,uncompressed"
 

Functions

enum_compression_algorithm get_compression_algorithm (std::string name=std::string())
 This function is used to validate compression algorithm specified as part of change replication source to statement. More...
 
std::string get_compression_algorithm_name (enum_compression_algorithm)
 
void parse_compression_algorithms_list (std::string name, std::vector< std::string > &list)
 This function is used to parse comma separated list of compression algorithm names and return a list containing every algorithm name. More...
 
bool is_zstd_compression_level_valid (uint level)
 This function is used to validate compression level for zstd compression. More...
 
bool validate_compression_attributes (std::string algorithm_names, std::string channel_name, bool ignore_errors)
 This function is used to validate compression algorithm names and maximum names is not more than 3. More...
 

Variables

constexpr int default_zstd_compression_level = 3
 

Macro Definition Documentation

◆ COMPRESSION_ALGORITHM_COUNT_MAX

#define COMPRESSION_ALGORITHM_COUNT_MAX   3

◆ COMPRESSION_ALGORITHM_NAME_BUFFER_SIZE

#define COMPRESSION_ALGORITHM_NAME_BUFFER_SIZE
Value:
3)
#define COMPRESSION_ALGORITHM_NAME_LENGTH_MAX
Definition: compression.h:40
#define COMPRESSION_ALGORITHM_COUNT_MAX
Definition: compression.h:41

◆ COMPRESSION_ALGORITHM_NAME_LENGTH_MAX

#define COMPRESSION_ALGORITHM_NAME_LENGTH_MAX   32

◆ COMPRESSION_ALGORITHM_UNCOMPRESSED

#define COMPRESSION_ALGORITHM_UNCOMPRESSED   "uncompressed"

◆ COMPRESSION_ALGORITHM_ZLIB

#define COMPRESSION_ALGORITHM_ZLIB   "zlib"

◆ COMPRESSION_ALGORITHM_ZSTD

#define COMPRESSION_ALGORITHM_ZSTD   "zstd"

◆ PROTOCOL_COMPRESSION_DEFAULT_VALUE

#define PROTOCOL_COMPRESSION_DEFAULT_VALUE   "zlib,zstd,uncompressed"

Function Documentation

◆ get_compression_algorithm()

enum_compression_algorithm get_compression_algorithm ( std::string  name)

This function is used to validate compression algorithm specified as part of change replication source to statement.

Parameters
namecompression algorithm name. Name can be either zlib,zstd or empty string.
Return values
anenum to represents what algorithm is specified in case it is a valid algorithm else return INVALID.

◆ get_compression_algorithm_name()

std::string get_compression_algorithm_name ( enum_compression_algorithm  )

◆ is_zstd_compression_level_valid()

bool is_zstd_compression_level_valid ( uint  level)

This function is used to validate compression level for zstd compression.

Parameters
levelcompression level to be validated against compression name
Return values
falseif level is not valid.
trueif level is valid.

◆ parse_compression_algorithms_list()

void parse_compression_algorithms_list ( std::string  name,
std::vector< std::string > &  list 
)

This function is used to parse comma separated list of compression algorithm names and return a list containing every algorithm name.

Parameters
namecomma separated list of compression algorithm names
[out]listlist containing algorithm names

◆ validate_compression_attributes()

bool validate_compression_attributes ( std::string  algorithm_names,
std::string  channel_name,
bool  ignore_errors 
)

This function is used to validate compression algorithm names and maximum names is not more than 3.

Parameters
algorithm_nameslist of compression algorithm names.
channel_nameReplication channel name.
ignore_errorsIf set to false, report errors to the client, otherwise do not report errors"
Return values
0success
1error or warnings

Variable Documentation

◆ default_zstd_compression_level

constexpr int default_zstd_compression_level = 3
constexpr