Drizzled Public API Documentation

page0types.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003 Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
00004 
00005 This program is free software; you can redistribute it and/or modify it under
00006 the terms of the GNU General Public License as published by the Free Software
00007 Foundation; version 2 of the License.
00008 
00009 This program is distributed in the hope that it will be useful, but WITHOUT
00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License along with
00014 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
00015 St, Fifth Floor, Boston, MA 02110-1301 USA
00016 
00017 *****************************************************************************/
00018 
00019 /**************************************************/
00026 #pragma once
00027 #ifndef page0types_h
00028 #define page0types_h
00029 
00030 #include "univ.i"
00031 #include "dict0types.h"
00032 #include "mtr0types.h"
00033 
00035 #define page_t     ib_page_t
00036 
00037 typedef byte    page_t;
00039 typedef struct page_cur_struct  page_cur_t;
00040 
00042 typedef byte        page_zip_t;
00044 typedef struct page_zip_des_struct  page_zip_des_t;
00045 
00046 /* The following definitions would better belong to page0zip.h,
00047 but we cannot include page0zip.h from rem0rec.ic, because
00048 page0*.h includes rem0rec.h and may include rem0rec.ic. */
00049 
00051 #define PAGE_ZIP_SSIZE_BITS 3
00052 
00054 #define PAGE_ZIP_MIN_SIZE_SHIFT 10
00055 
00056 #define PAGE_ZIP_MIN_SIZE (1 << PAGE_ZIP_MIN_SIZE_SHIFT)
00057 
00059 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
00060 #define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
00061 #if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
00062 # error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
00063 #endif
00064 
00066 struct page_zip_des_struct
00067 {
00068   page_zip_t* data;   
00070 #ifdef UNIV_DEBUG
00071   unsigned  m_start:16; 
00072 #endif /* UNIV_DEBUG */
00073   unsigned  m_end:16; 
00074   unsigned  m_nonempty:1; 
00076   unsigned  n_blobs:12; 
00079   unsigned  ssize:PAGE_ZIP_SSIZE_BITS;
00083 };
00084 
00086 struct page_zip_stat_struct {
00088   ulint   compressed;
00090   ulint   compressed_ok;
00092   ulint   decompressed;
00094   ib_uint64_t compressed_usec;
00096   ib_uint64_t decompressed_usec;
00097 };
00098 
00100 typedef struct page_zip_stat_struct page_zip_stat_t;
00101 
00103 extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
00104 
00105 /**********************************************************************/
00108 UNIV_INTERN
00109 void
00110 page_zip_rec_set_deleted(
00111 /*=====================*/
00112   page_zip_des_t* page_zip,
00113   const byte* rec,  
00114   ulint   flag) 
00115   __attribute__((nonnull));
00116 
00117 /**********************************************************************/
00120 UNIV_INTERN
00121 void
00122 page_zip_rec_set_owned(
00123 /*===================*/
00124   page_zip_des_t* page_zip,
00125   const byte* rec,  
00126   ulint   flag) 
00127   __attribute__((nonnull));
00128 
00129 /**********************************************************************/
00131 UNIV_INTERN
00132 void
00133 page_zip_dir_delete(
00134 /*================*/
00135   page_zip_des_t* page_zip,
00136   byte*   rec,  
00137   dict_index_t* index,  
00138   const ulint*  offsets,
00139   const byte* free) 
00140   __attribute__((nonnull(1,2,3,4)));
00141 
00142 /**********************************************************************/
00144 UNIV_INTERN
00145 void
00146 page_zip_dir_add_slot(
00147 /*==================*/
00148   page_zip_des_t* page_zip, 
00149   ulint   is_clustered) 
00151   __attribute__((nonnull));
00152 #endif