MySQL 5.6.14 Source Code Document
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
innodb_config.h
Go to the documentation of this file.
1
/***********************************************************************
2
3
Copyright (c) 2013, Oracle and/or its affiliates. All Rights Reserved.
4
5
This program is free software; you can redistribute it and/or modify it
6
under the terms of the GNU General Public License as published by the
7
Free Software Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but
10
WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12
Public License for more details.
13
14
You should have received a copy of the GNU General Public License along
15
with this program; if not, write to the Free Software Foundation, Inc.,
16
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
18
***********************************************************************/
19
/**************************************************/
25
#ifndef innodb_config_h
26
#define innodb_config_h
27
28
#include "
api0api.h
"
29
#include "innodb_utility.h"
30
31
typedef
void
* hash_node_t;
32
33
/* Database name and table name for our metadata "system" tables for
34
InnoDB memcache. The table names are the same as those for the
35
NDB memcache, to make the memcache setup compatible between the two.
36
There are 3 "system tables":
37
1) containers - main configure table contains row describing which InnoDB
38
table is used to store/retrieve Memcached key/value if InnoDB
39
Memcached engine is used
40
2) cache_policies - decide whether to use "Memcached Default Engine" or "InnoDB
41
Memcached Engine" to handler the requests
42
3) config_options - for miscellaneous configuration options */
43
#define MCI_CFG_DB_NAME "innodb_memcache"
44
#define MCI_CFG_CONTAINER_TABLE "containers"
45
#define MCI_CFG_CACHE_POLICIES "cache_policies"
46
#define MCI_CFG_CONFIG_OPTIONS "config_options"
47
49
#define MAX_TABLE_NAME_LEN 192
50
#define MAX_DATABASE_NAME_LEN MAX_TABLE_NAME_LEN
51
#define MAX_FULL_NAME_LEN \
52
(MAX_TABLE_NAME_LEN + MAX_DATABASE_NAME_LEN + 14)
53
55
typedef
struct
meta_column
{
56
char
*
col_name
;
57
size_t
col_name_len
;
58
int
field_id
;
60
ib_col_meta_t
col_meta
;
61
}
meta_column_t
;
62
68
typedef
enum
container
{
69
CONTAINER_NAME
,
70
CONTAINER_DB
,
71
CONTAINER_TABLE
,
72
CONTAINER_KEY
,
74
CONTAINER_VALUE
,
76
CONTAINER_FLAG
,
78
CONTAINER_CAS
,
80
CONTAINER_EXP
,
82
CONTAINER_NUM_COLS
83
}
container_t
;
84
86
typedef
enum
cache_policy
{
87
CACHE_POLICY_NAME
,
89
CACHE_POLICY_GET
,
91
CACHE_POLICY_SET
,
93
CACHE_POLICY_DEL
,
95
CACHE_POLICY_FLUSH
,
97
CACHE_POLICY_NUM_COLS
98
}
cache_policy_t
;
99
101
typedef
enum
config_opt
{
102
CONFIG_OPT_KEY
,
103
CONFIG_OPT_VALUE
,
104
CONFIG_OPT_NUM_COLS
105
}
config_opt_t
;
106
114
typedef
enum
meta_use_idx
{
115
META_USE_NO_INDEX
= 1,
118
META_USE_CLUSTER
,
119
META_USE_SECONDARY
121
}
meta_use_idx_t
;
122
124
typedef
struct
meta_index
{
125
char
*
idx_name
;
126
int
idx_id
;
127
meta_use_idx_t
srch_use_idx
;
129
}
meta_index_t
;
130
133
typedef
enum
meta_cache_opt
{
134
META_CACHE_OPT_INNODB
= 1,
135
META_CACHE_OPT_DEFAULT
,
137
META_CACHE_OPT_MIX
,
139
META_CACHE_OPT_DISABLE
,
140
META_CACHE_NUM_OPT
141
}
meta_cache_opt_t
;
142
148
#define COLUMN_SEPARATOR "separator"
149
#define TABLE_MAP_SEPARATOR "table_map_delimiter"
150
151
/* list of configure options we support */
152
typedef
enum
option_id
{
153
OPTION_ID_COL_SEP
,
155
OPTION_ID_TBL_MAP_SEP
,
157
OPTION_ID_NUM_OPTIONS
158
} option_id_t;
159
161
#define MAX_DELIMITER_LEN 32
162
163
typedef
struct
option_value
{
164
char
value[
MAX_DELIMITER_LEN
+ 1];
165
/* option value */
166
int
value_len;
/* value length */
167
}
option_value_t
;
168
170
typedef
struct
option
{
171
option_id_t
id
;
172
const
char
*
name
;
175
option_value_t
default_value
;
176
}
option_t
;
177
184
#define GET_OPTION(meta_info, option, val, val_len) \
185
do { \
186
val_len = meta_info->options[option].value_len; \
187
\
188
if (val_len == 0) { \
189
val = config_option_names[option].default_value.value; \
190
val_len = config_option_names[option].default_value.value_len;\
191
} else { \
192
val = meta_info->options[option].value; \
193
} \
194
} while (0)
195
198
typedef
struct
meta_cfg_info
{
199
meta_column_t
col_info
[
CONTAINER_NUM_COLS
];
200
meta_column_t
*
extra_col_info
;
202
int
n_extra_col
;
204
meta_index_t
index_info
;
205
bool
flag_enabled
;
206
bool
cas_enabled
;
207
bool
exp_enabled
;
208
option_value_t
options
[
OPTION_ID_NUM_OPTIONS
];
211
meta_cache_opt_t
set_option
;
212
meta_cache_opt_t
get_option
;
213
meta_cache_opt_t
del_option
;
215
meta_cache_opt_t
flush_option
;
217
hash_node_t
name_hash
;
218
}
meta_cfg_info_t
;
219
220
221
/**********************************************************************/
230
meta_cfg_info_t
*
231
innodb_config
(
232
/*==========*/
233
const
char
*
name
,
234
size_t
name_len,
235
hash_table_t
** meta_hash);
237
/**********************************************************************/
241
bool
242
innodb_verify
(
243
/*==========*/
244
meta_cfg_info_t
* info);
246
/**********************************************************************/
248
void
249
innodb_config_free
(
250
/*===============*/
251
meta_cfg_info_t
* item);
254
/**********************************************************************/
258
meta_cfg_info_t
*
259
innodb_config_meta_hash_init
(
260
/*=========================*/
261
hash_table_t
* meta_hash);
263
#endif
plugin
innodb_memcached
innodb_memcache
include
innodb_config.h
Generated on Sat Nov 9 2013 01:25:13 for MySQL 5.6.14 Source Code Document by
1.8.1.2