MySQL 5.6.14 Source Code Document
 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;
62 
68 typedef enum container {
83 } container_t;
84 
86 typedef enum cache_policy {
99 
101 typedef enum config_opt {
105 } config_opt_t;
106 
114 typedef enum meta_use_idx {
122 
124 typedef struct meta_index {
125  char* idx_name;
126  int idx_id;
129 } meta_index_t;
130 
133 typedef enum meta_cache_opt {
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 {
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 */
168 
170 typedef struct option {
171  option_id_t id;
172  const char* name;
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 {
206  bool cas_enabled;
207  bool exp_enabled;
217  hash_node_t name_hash;
219 
220 
221 /**********************************************************************/
232 /*==========*/
233  const char* name,
234  size_t name_len,
235  hash_table_t** meta_hash);
237 /**********************************************************************/
241 bool
243 /*==========*/
244  meta_cfg_info_t* info);
246 /**********************************************************************/
248 void
250 /*===============*/
251  meta_cfg_info_t* item);
254 /**********************************************************************/
260 /*=========================*/
261  hash_table_t* meta_hash);
263 #endif