1/*****************************************************************************
2
3Copyright (C) 2013, 2017, MariaDB Corporation. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc.,
1551 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/******************************************************************//**
20@file include/fsp0pagecompress.h
21Helper functions for extracting/storing page compression and
22atomic writes information to file space.
23
24Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
25***********************************************************************/
26
27#ifndef fsp0pagecompress_h
28#define fsp0pagecompress_h
29
30/* Supported page compression methods */
31
32#define PAGE_UNCOMPRESSED 0
33#define PAGE_ZLIB_ALGORITHM 1
34#define PAGE_LZ4_ALGORITHM 2
35#define PAGE_LZO_ALGORITHM 3
36#define PAGE_LZMA_ALGORITHM 4
37#define PAGE_BZIP2_ALGORITHM 5
38#define PAGE_SNAPPY_ALGORITHM 6
39#define PAGE_ALGORITHM_LAST PAGE_SNAPPY_ALGORITHM
40
41/**********************************************************************//**
42Reads the page compression level from the first page of a tablespace.
43@return page compression level, or 0 if uncompressed */
44UNIV_INTERN
45ulint
46fsp_header_get_compression_level(
47/*=============================*/
48 const page_t* page); /*!< in: first page of a tablespace */
49
50/********************************************************************//**
51Extract the page compression level from tablespace flags.
52A tablespace has only one physical page compression level
53whether that page is compressed or not.
54@return page compression level of the file-per-table tablespace,
55or zero if the table is not compressed. */
56UNIV_INLINE
57ulint
58fsp_flags_get_page_compression_level(
59/*=================================*/
60 ulint flags); /*!< in: tablespace flags */
61
62#include "fsp0pagecompress.ic"
63
64#endif
65