MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
innodb_config.h File Reference
#include "api0api.h"
#include "innodb_utility.h"
Include dependency graph for innodb_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  meta_column
struct  meta_index
struct  option_value
struct  option
struct  meta_cfg_info

Macros

#define MCI_CFG_DB_NAME   "innodb_memcache"
#define MCI_CFG_CONTAINER_TABLE   "containers"
#define MCI_CFG_CACHE_POLICIES   "cache_policies"
#define MCI_CFG_CONFIG_OPTIONS   "config_options"
#define MAX_TABLE_NAME_LEN   192
#define MAX_DATABASE_NAME_LEN   MAX_TABLE_NAME_LEN
#define MAX_FULL_NAME_LEN   (MAX_TABLE_NAME_LEN + MAX_DATABASE_NAME_LEN + 14)
#define COLUMN_SEPARATOR   "separator"
#define TABLE_MAP_SEPARATOR   "table_map_delimiter"
#define MAX_DELIMITER_LEN   32
#define GET_OPTION(meta_info, option, val, val_len)

Typedefs

typedef void * hash_node_t
typedef struct meta_column meta_column_t
typedef enum container container_t
typedef enum cache_policy cache_policy_t
typedef enum config_opt config_opt_t
typedef enum meta_use_idx meta_use_idx_t
typedef struct meta_index meta_index_t
typedef enum meta_cache_opt meta_cache_opt_t
typedef enum option_id option_id_t
typedef struct option_value option_value_t
typedef struct option option_t
typedef struct meta_cfg_info meta_cfg_info_t

Enumerations

enum  container {
  CONTAINER_NAME, CONTAINER_DB, CONTAINER_TABLE, CONTAINER_KEY,
  CONTAINER_VALUE, CONTAINER_FLAG, CONTAINER_CAS, CONTAINER_EXP,
  CONTAINER_NUM_COLS
}
enum  cache_policy {
  CACHE_POLICY_NAME, CACHE_POLICY_GET, CACHE_POLICY_SET, CACHE_POLICY_DEL,
  CACHE_POLICY_FLUSH, CACHE_POLICY_NUM_COLS
}
enum  config_opt { CONFIG_OPT_KEY, CONFIG_OPT_VALUE, CONFIG_OPT_NUM_COLS }
enum  meta_use_idx { META_USE_NO_INDEX = 1, META_USE_CLUSTER, META_USE_SECONDARY }
enum  meta_cache_opt {
  META_CACHE_OPT_INNODB = 1, META_CACHE_OPT_DEFAULT, META_CACHE_OPT_MIX, META_CACHE_OPT_DISABLE,
  META_CACHE_NUM_OPT
}
enum  option_id {
  OPTION_ID_COL_SEP, OPTION_ID_TBL_MAP_SEP, OPTION_ID_NUM_OPTIONS, OPT_port = 1,
  OPT_socket, OPT_compress, OPT_password, OPT_pipe,
  OPT_timeout, OPT_user, OPT_init_command, OPT_host,
  OPT_database, OPT_debug, OPT_return_found_rows, OPT_ssl_key,
  OPT_ssl_cert, OPT_ssl_ca, OPT_ssl_capath, OPT_character_sets_dir,
  OPT_default_character_set, OPT_interactive_timeout, OPT_connect_timeout, OPT_local_infile,
  OPT_disable_local_infile, OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol,
  OPT_shared_memory_base_name, OPT_multi_results, OPT_multi_statements, OPT_multi_queries,
  OPT_secure_auth, OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth,
  OPT_bind_address, OPT_ssl_crl, OPT_ssl_crlpath, OPT_enable_cleartext_plugin,
  OPT_keep_this_one_last
}

Functions

meta_cfg_info_tinnodb_config (const char *name, size_t name_len, hash_table_t **meta_hash)
bool innodb_verify (meta_cfg_info_t *info)
void innodb_config_free (meta_cfg_info_t *item)
meta_cfg_info_tinnodb_config_meta_hash_init (hash_table_t *meta_hash)

Detailed Description

Created 03/15/2011 Jimmy Yang

Definition in file innodb_config.h.

Macro Definition Documentation

#define COLUMN_SEPARATOR   "separator"
The "names" in the "config_option" table to identify possible

config options. Both are optional. "COLUMN_SEPARATOR" is the delimiter that separates multiple columns and "TABLE_MAP_SEPARATOR" is the delimiter that separates table map name and key value

Definition at line 148 of file innodb_config.h.

#define GET_OPTION (   meta_info,
  option,
  val,
  val_len 
)
Value:
do { \
val_len = meta_info->options[option].value_len; \
\
if (val_len == 0) { \
val_len = config_option_names[option].default_value.value_len;\
} else { \
val = meta_info->options[option].value; \
} \
} while (0)
Get configure option value. If the value is not configured by

user, obtain its default value from "config_option_names"

Parameters
meta_infometadata structure contains configure options
optionoption whose value to get
valvalue to fetch
val_lenvalue length

Definition at line 184 of file innodb_config.h.

#define MAX_DELIMITER_LEN   32

Maximum delimiter length

Definition at line 161 of file innodb_config.h.

#define MAX_TABLE_NAME_LEN   192

Max table name length as defined in univ.i

Definition at line 49 of file innodb_config.h.

Typedef Documentation

columns in the "cache_policy" table

typedef enum config_opt config_opt_t

columns in the "config_options" table

typedef enum container container_t
Following are enums defining column IDs indexing into each of three

system tables Columns in the "containers" system table, this maps the Memcached operation to a consistent InnoDB table

Cache options, tells if we will used Memcached default engine or InnoDB

Memcached engine to handle the request

In memory structure contains most necessary metadata info

to configure an InnoDB Memcached engine

typedef struct meta_column meta_column_t

structure describes each column's basic info (name, field_id etc.)

typedef struct meta_index meta_index_t

Describes the index's name and ID of the index on the "key" column

Following are some value defines describes the options that configures

the InnoDB Memcached Values to set up "m_use_idx" field of "meta_index_t" structure, indicating whether we will use cluster or secondary index on the "key" column to perform the search. Please note the index must be unique index

typedef struct option option_t

structure to define some default "config_option" option settings

Enumeration Type Documentation

columns in the "cache_policy" table

Enumerator:
CACHE_POLICY_NAME 

"name" column, for the "cache_policy" name

CACHE_POLICY_GET 

"get" column, specifies the cache policy for "get" command

CACHE_POLICY_SET 

"set" column, specifies the cache policy for "set" command

CACHE_POLICY_DEL 

"delete" column, specifies the cache policy for "delete" command

CACHE_POLICY_FLUSH 

"flush_all" column, specifies the cache policy for "flush_all" command

CACHE_POLICY_NUM_COLS 

total 5 columns

Definition at line 86 of file innodb_config.h.

enum config_opt

columns in the "config_options" table

Enumerator:
CONFIG_OPT_KEY 

key column in the "config_option" table

CONFIG_OPT_VALUE 

value column

CONFIG_OPT_NUM_COLS 

number of columns (currently 2) in table

Definition at line 101 of file innodb_config.h.

enum container
Following are enums defining column IDs indexing into each of three

system tables Columns in the "containers" system table, this maps the Memcached operation to a consistent InnoDB table

Enumerator:
CONTAINER_NAME 

name for this mapping

CONTAINER_DB 

database name

CONTAINER_TABLE 

table name

CONTAINER_KEY 

column name for column maps to memcached "key"

CONTAINER_VALUE 

column name for column maps to memcached "value"

CONTAINER_FLAG 

column name for column maps to memcached "flag" value

CONTAINER_CAS 

column name for column maps to memcached "cas" value

CONTAINER_EXP 

column name for column maps to "expiration" value

CONTAINER_NUM_COLS 

number of columns

Definition at line 68 of file innodb_config.h.

Cache options, tells if we will used Memcached default engine or InnoDB

Memcached engine to handle the request

Enumerator:
META_CACHE_OPT_INNODB 

Use InnoDB Memcached Engine only

META_CACHE_OPT_DEFAULT 

Use Default Memcached Engine only

META_CACHE_OPT_MIX 

Use both, first use default memcached engine

META_CACHE_OPT_DISABLE 

This operation is disabled

META_CACHE_NUM_OPT 

Number of options

Definition at line 133 of file innodb_config.h.

Following are some value defines describes the options that configures

the InnoDB Memcached Values to set up "m_use_idx" field of "meta_index_t" structure, indicating whether we will use cluster or secondary index on the "key" column to perform the search. Please note the index must be unique index

Enumerator:
META_USE_NO_INDEX 

no cluster or unique secondary index on the key column. This is an error, will cause setup to fail

META_USE_CLUSTER 

have cluster index on the key column

META_USE_SECONDARY 

have unique secondary index on the key column

Definition at line 114 of file innodb_config.h.

enum option_id
Enumerator:
OPTION_ID_COL_SEP 

ID for character(s) separating multiple column mapping

OPTION_ID_TBL_MAP_SEP 

ID for character(s) separating table map name and key

OPTION_ID_NUM_OPTIONS 

number of options

Definition at line 152 of file innodb_config.h.

Function Documentation

meta_cfg_info_t* innodb_config ( const char *  name,
size_t  name_len,
hash_table_t **  meta_hash 
)

This function opens the default configuration table, and find the table and column info that used for InnoDB Memcached, and set up InnoDB Memcached's meta_cfg_info_t structure. If the "name" parameter is not NULL, it will find the specified setting in the "container" table. If "name" field is NULL, it will then look for setting with the name of "default". Otherwise, it returns the setting corresponding to the first row of the configure table.

Returns
meta_cfg_info_t* structure if configure option found, otherwise NULL in: engine hash table

If the hash table (meta_hash) is NULL, then initialise the hash table with data in the configure tables. And return the "default" item. If there is no setting named "default" then use the first row in the table. This is currently only used at the engine initialization time. If the hash table (meta_hash) is created, then look for the meta-data based on specified configuration name parameter. If such metadata does not exist in the hash table, then add such metadata into hash table.

Returns
meta_cfg_info_t* structure if configure option found, otherwise NULL
Parameters
namein: config option name
name_lenin: name length
meta_hashin/out: engine hash table. If NULL, it will be created and initialized

Definition at line 1173 of file innodb_config.c.

Here is the call graph for this function:

void innodb_config_free ( meta_cfg_info_t item)

This function frees meta info structure in/own: meta info structure

This function frees meta info structures

Parameters
itemin: meta info structure

Definition at line 68 of file innodb_config.c.

meta_cfg_info_t* innodb_config_meta_hash_init ( hash_table_t meta_hash)

This function opens the "containers" table, reads in all rows and instantiates the metadata hash table.

Returns
the default configuration setting (whose mapping name is "default") in/out: InnoDB Memcached engine

This function opens the "containers" table, reads in all rows and instantiates the metadata hash table.

Returns
the default configuration setting (whose mapping name is "default")
Parameters
meta_hashin/out: InnoDB Memcached engine

Definition at line 505 of file innodb_config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

bool innodb_verify ( meta_cfg_info_t info)

This function verifies the table configuration information, and fills in columns used for memcached functionalities (cas, exp etc.)

Returns
true if everything works out fine in: meta info structure

This function verifies the table configuration information, and fills in columns used for memcached functionalities (cas, exp etc.)

Returns
true if everything works out fine
Parameters
infoin: meta info structure

Definition at line 1122 of file innodb_config.c.

Here is the call graph for this function: