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 #if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
00061 # error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
00062 #endif
00063 
00065 struct page_zip_des_struct
00066 {
00067   page_zip_t* data;   
00069 #ifdef UNIV_DEBUG
00070   unsigned  m_start:16; 
00071 #endif /* UNIV_DEBUG */
00072   unsigned  m_end:16; 
00073   unsigned  m_nonempty:1; 
00075   unsigned  n_blobs:12; 
00078   unsigned  ssize:PAGE_ZIP_SSIZE_BITS;
00082 };
00083 
00085 struct page_zip_stat_struct {
00087   ulint   compressed;
00089   ulint   compressed_ok;
00091   ulint   decompressed;
00093   ib_uint64_t compressed_usec;
00095   ib_uint64_t decompressed_usec;
00096 };
00097 
00099 typedef struct page_zip_stat_struct page_zip_stat_t;
00100 
00102 extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
00103 
00104 /**********************************************************************/
00107 UNIV_INTERN
00108 void
00109 page_zip_rec_set_deleted(
00110 /*=====================*/
00111   page_zip_des_t* page_zip,
00112   const byte* rec,  
00113   ulint   flag) 
00114   __attribute__((nonnull));
00115 
00116 /**********************************************************************/
00119 UNIV_INTERN
00120 void
00121 page_zip_rec_set_owned(
00122 /*===================*/
00123   page_zip_des_t* page_zip,
00124   const byte* rec,  
00125   ulint   flag) 
00126   __attribute__((nonnull));
00127 
00128 /**********************************************************************/
00130 UNIV_INTERN
00131 void
00132 page_zip_dir_delete(
00133 /*================*/
00134   page_zip_des_t* page_zip,
00135   byte*   rec,  
00136   dict_index_t* index,  
00137   const ulint*  offsets,
00138   const byte* free) 
00139   __attribute__((nonnull(1,2,3,4)));
00140 
00141 /**********************************************************************/
00143 UNIV_INTERN
00144 void
00145 page_zip_dir_add_slot(
00146 /*==================*/
00147   page_zip_des_t* page_zip, 
00148   ulint   is_clustered) 
00150   __attribute__((nonnull));
00151 #endif