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