Compression algorithm.  
 More...
#include <file.h>
◆ Type
Algorithm types supported. 
| Enumerator | 
|---|
| NONE  | No compression.  
 | 
| ZLIB  | Use ZLib.  
 | 
| LZ4  | Use LZ4 faster variant, usually lower compression.  
 | 
 
 
◆ Compression() [1/2]
  
  
      
        
          | Compression::Compression  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ Compression() [2/2]
  
  
      
        
          | Compression::Compression  | 
          ( | 
          Type  | 
          type | ) | 
           | 
         
       
   | 
  
inlineexplicit   | 
  
 
Specific constructor. 
- Parameters
 - 
  
  
 
 
 
◆ check()
Check whether the compression algorithm is supported. 
- Parameters
 - 
  
    | [in] | algorithm | Compression algorithm to check  | 
    | [out] | compression | The type that algorithm maps to  | 
  
   
- Returns
 - DB_SUCCESS or error code 
 
 
 
◆ deserialize()
Decompress the page data contents. 
Page type must be FIL_PAGE_COMPRESSED, if not then the source contents are left unchanged and DB_SUCCESS is returned. 
- Parameters
 - 
  
    | [in] | dblwr_read | true if double write recovery in progress  | 
    | [in,out] | src | Data read from disk, decompressed data will be copied to this page  | 
    | [in,out] | dst | Scratch area to use for decompression or nullptr.  | 
    | [in] | dst_len | If dst is valid, size of the scratch area in bytes.  | 
  
   
- Returns
 - DB_SUCCESS or error code 
 
 
 
◆ deserialize_header()
Deserizlise the page header compression meta-data. 
- Parameters
 - 
  
    | [in] | page | Pointer to the page header  | 
    | [out] | control | Deserialised data  | 
  
   
 
 
◆ is_compressed_encrypted_page()
  
  
      
        
          | bool Compression::is_compressed_encrypted_page  | 
          ( | 
          const byte *  | 
          page | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Check the page header type field. 
- Parameters
 - 
  
  
 
- Returns
 - true if it is a compressed and encrypted page 
 
 
 
◆ is_compressed_page()
  
  
      
        
          | bool Compression::is_compressed_page  | 
          ( | 
          const byte *  | 
          page | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Check the page header type field. 
- Parameters
 - 
  
  
 
- Returns
 - true if it is a compressed page
 
- 
true if it is a compressed page 
 
 
 
◆ is_none()
  
  
      
        
          | bool Compression::is_none  | 
          ( | 
          const char *  | 
          algorithm | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Check if the string is "empty" or "none". 
- Parameters
 - 
  
    | [in] | algorithm | Compression algorithm to check  | 
  
   
- Returns
 - true if no algorithm requested 
 
 
 
◆ is_valid_page_version()
  
  
      
        
          | bool Compression::is_valid_page_version  | 
          ( | 
          uint8_t  | 
          version | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Check if the version on page is valid. 
- Parameters
 - 
  
  
 
- Returns
 - true if version is valid 
 
 
 
◆ to_string() [1/3]
  
  
      
        
          | std::string Compression::to_string  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
- Returns
 - string representation. 
 
 
 
◆ to_string() [2/3]
  
  
      
        
          | std::string Compression::to_string  | 
          ( | 
          const meta_t &  | 
          meta | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Convert the meta data to a std::string. 
- Parameters
 - 
  
  
 
- Returns
 - the string representation 
 
 
 
◆ to_string() [3/3]
  
  
      
        
          | const char * Compression::to_string  | 
          ( | 
          Type  | 
          type | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Convert to a "string". 
- Parameters
 - 
  
    | [in] | type | The compression type  | 
  
   
- Returns
 - the string representation 
 
 
 
◆ validate() [1/2]
  
  
      
        
          | dberr_t Compression::validate  | 
          ( | 
          const char *  | 
          algorithm | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Validate the algorithm string. 
- Parameters
 - 
  
    | [in] | algorithm | Compression algorithm to check  | 
  
   
- Returns
 - DB_SUCCESS or error code 
 
 
 
◆ validate() [2/2]
  
  
      
        
          | bool Compression::validate  | 
          ( | 
          const Type  | 
          type | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Validate the algorithm string. 
- Parameters
 - 
  
  
 
- Returns
 - true if type is valid, else false 
 
 
 
◆ FIL_PAGE_VERSION_1
  
  
      
        
          | constexpr uint8_t Compression::FIL_PAGE_VERSION_1 = 1 | 
         
       
   | 
  
staticconstexpr   | 
  
 
Version of compressed page. 
 
 
◆ FIL_PAGE_VERSION_2
  
  
      
        
          | constexpr uint8_t Compression::FIL_PAGE_VERSION_2 = 2 | 
         
       
   | 
  
staticconstexpr   | 
  
 
 
◆ m_type
The documentation for this struct was generated from the following files: