drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ha0ha.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1994, 2009, Innobase Oy. 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., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#pragma once
27#ifndef ha0ha_h
28#define ha0ha_h
29
30#include "univ.i"
31
32#include "hash0hash.h"
33#include "page0types.h"
34#include "buf0types.h"
35
36/*************************************************************/
40UNIV_INLINE
41void*
43/*===================*/
44 hash_table_t* table,
45 ulint fold);
46/*********************************************************/
49UNIV_INTERN
50void
52/*===============================*/
53 hash_table_t* table,
54 ulint fold,
55 void* data,
56#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
57 buf_block_t* new_block,
58#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
59 void* new_data);
60
61#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
69# define ha_search_and_update_if_found(table,fold,data,new_block,new_data) \
70 ha_search_and_update_if_found_func(table,fold,data,new_block,new_data)
71#else /* UNIV_AHI_DEBUG || UNIV_DEBUG */
79# define ha_search_and_update_if_found(table,fold,data,new_block,new_data) \
80 ha_search_and_update_if_found_func(table,fold,data,new_data)
81#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
82/*************************************************************/
86UNIV_INTERN
87hash_table_t*
89/*===========*/
90 ulint n,
91#ifdef UNIV_SYNC_DEBUG
92 ulint mutex_level,
94#endif /* UNIV_SYNC_DEBUG */
95 ulint n_mutexes);
97#ifdef UNIV_SYNC_DEBUG
105# define ha_create(n_c,n_m,level) ha_create_func(n_c,level,n_m)
106#else /* UNIV_SYNC_DEBUG */
114# define ha_create(n_c,n_m,level) ha_create_func(n_c,n_m)
115#endif /* UNIV_SYNC_DEBUG */
116
117/*************************************************************/
119UNIV_INTERN
120void
122/*=====*/
123 hash_table_t* table);
124
125/*************************************************************/
130UNIV_INTERN
131ibool
133/*====================*/
134 hash_table_t* table,
135 ulint fold,
139#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
140 buf_block_t* block,
141#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
142 void* data);
143
144#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
154# define ha_insert_for_fold(t,f,b,d) ha_insert_for_fold_func(t,f,b,d)
155#else /* UNIV_AHI_DEBUG || UNIV_DEBUG */
165# define ha_insert_for_fold(t,f,b,d) ha_insert_for_fold_func(t,f,d)
166#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
167
168/*********************************************************/
172UNIV_INLINE
173ibool
175/*==========================*/
176 hash_table_t* table,
177 ulint fold,
178 void* data);
179#ifndef UNIV_HOTBACKUP
180/*****************************************************************/
183UNIV_INTERN
184void
186/*========================*/
187 hash_table_t* table,
188 ulint fold,
189 const page_t* page);
190#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
191/*************************************************************/
194UNIV_INTERN
195ibool
196ha_validate(
197/*========*/
198 hash_table_t* table,
199 ulint start_index,
200 ulint end_index);
201#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
202/*************************************************************/
204UNIV_INTERN
205void
207/*==========*/
208 FILE* file,
209 hash_table_t* table);
210#endif /* !UNIV_HOTBACKUP */
211
214
218#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
219 buf_block_t* block;
220#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
221 void* data;
222 ulint fold;
223};
224
225#ifndef UNIV_HOTBACKUP
230# define ASSERT_HASH_MUTEX_OWN(table, fold) \
231 ut_ad(!(table)->mutexes || mutex_own(hash_get_mutex(table, fold)))
232#else /* !UNIV_HOTBACKUP */
237# define ASSERT_HASH_MUTEX_OWN(table, fold) ((void) 0)
238#endif /* !UNIV_HOTBACKUP */
239
240#ifndef UNIV_NONINL
241#include "ha0ha.ic"
242#endif
243
244#endif
struct buf_block_struct buf_block_t
Definition buf0types.h:33
UNIV_INTERN ibool ha_insert_for_fold_func(hash_table_t *table, ulint fold, void *data)
Definition ha0ha.cc:133
struct ha_node_struct ha_node_t
Definition ha0ha.h:213
UNIV_INTERN void ha_print_info(FILE *file, hash_table_t *table)
Definition ha0ha.cc:410
UNIV_INLINE ibool ha_search_and_delete_if_found(hash_table_t *table, ulint fold, void *data)
UNIV_INTERN hash_table_t * ha_create_func(ulint n, ulint n_mutexes)
Definition ha0ha.cc:43
UNIV_INTERN void ha_remove_all_nodes_to_page(hash_table_t *table, ulint fold, const page_t *page)
Definition ha0ha.cc:314
UNIV_INTERN void ha_clear(hash_table_t *table)
Definition ha0ha.cc:95
UNIV_INLINE void * ha_search_and_get_data(hash_table_t *table, ulint fold)
UNIV_INTERN void ha_search_and_update_if_found_func(hash_table_t *table, ulint fold, void *data, void *new_data)
Definition ha0ha.cc:271
#define page_t
Definition page0types.h:35
void * data
Definition ha0ha.h:221
ulint fold
Definition ha0ha.h:222
ha_node_t * next
Definition ha0ha.h:217