MySQL  8.0.18
Source Code Documentation
innodb_config.h File Reference


Created 03/15/2011 Jimmy Yang More...

#include "api0api.h"
#include "innodb_utility.h"

Go to the source code of this file.

Classes

struct  meta_column
 structure describes each column's basic info (name, field_id etc.) More...
 
struct  meta_index
 Describes the index's name and ID of the index on the "key" column. More...
 
struct  option_value
 
struct  option
 structure to define some default "config_option" option settings More...
 
struct  meta_cfg_info
 In memory structure contains most necessary metadata info to configure an InnoDB Memcached engine. More...
 

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
 Max table name length as defined in univ.i. More...
 
#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"
 The "names" in the "config_option" table to identify possible config options. More...
 
#define TABLE_MAP_SEPARATOR   "table_map_delimiter"
 
#define MAX_DELIMITER_LEN   32
 Maximum delimiter length. More...
 
#define GET_OPTION(meta_info, option, val, val_len)
 Get configure option value. More...
 

Typedefs

typedef void * hash_node_t
 
typedef struct meta_column meta_column_t
 structure describes each column's basic info (name, field_id etc.) More...
 
typedef enum container container_t
 Following are enums defining column IDs indexing into each of three system tables. More...
 
typedef enum cache_policy cache_policy_t
 columns in the "cache_policy" table More...
 
typedef enum config_opt config_opt_t
 columns in the "config_options" table More...
 
typedef enum meta_use_idx meta_use_idx_t
 Following are some value defines describes the options that configures the InnoDB Memcached. More...
 
typedef struct meta_index meta_index_t
 Describes the index's name and ID of the index on the "key" column. More...
 
typedef enum meta_cache_opt meta_cache_opt_t
 Cache options, tells if we will used Memcached default engine or InnoDB Memcached engine to handle the request. More...
 
typedef enum option_id option_id_t
 
typedef struct option_value option_value_t
 
typedef struct option option_t
 structure to define some default "config_option" option settings More...
 
typedef struct meta_cfg_info meta_cfg_info_t
 In memory structure contains most necessary metadata info to configure an InnoDB Memcached engine. More...
 

Enumerations

enum  container {
  CONTAINER_NAME, CONTAINER_DB, CONTAINER_TABLE, CONTAINER_KEY,
  CONTAINER_VALUE, CONTAINER_FLAG, CONTAINER_CAS, CONTAINER_EXP,
  CONTAINER_NUM_COLS
}
 Following are enums defining column IDs indexing into each of three system tables. More...
 
enum  cache_policy {
  CACHE_POLICY_NAME, CACHE_POLICY_GET, CACHE_POLICY_SET, CACHE_POLICY_DEL,
  CACHE_POLICY_FLUSH, CACHE_POLICY_NUM_COLS
}
 columns in the "cache_policy" table More...
 
enum  config_opt { CONFIG_OPT_KEY, CONFIG_OPT_VALUE, CONFIG_OPT_NUM_COLS }
 columns in the "config_options" table More...
 
enum  meta_use_idx { META_USE_NO_INDEX = 1, META_USE_CLUSTER, META_USE_SECONDARY }
 Following are some value defines describes the options that configures the InnoDB Memcached. More...
 
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
}
 Cache options, tells if we will used Memcached default engine or InnoDB Memcached engine to handle the request. More...
 
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_report_data_truncation, OPT_plugin_dir, OPT_default_auth, OPT_bind_address,
  OPT_ssl_crl, OPT_ssl_crlpath, OPT_enable_cleartext_plugin, OPT_tls_version,
  OPT_ssl_mode, OPT_optional_resultset_metadata, OPT_ssl_fips_mode, OPT_tls_ciphersuites,
  OPT_keep_this_one_last
}
 

Functions

meta_cfg_info_tinnodb_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. More...
 
bool innodb_verify (meta_cfg_info_t *info, void *thd)
 
This function verifies the table configuration information, and fills in columns used for memcached functionalities (cas, exp etc.) More...
 
void innodb_config_free (meta_cfg_info_t *item)
 

This function frees meta info structure More...
 
meta_cfg_info_tinnodb_config_meta_hash_init (hash_table_t *meta_hash, void *thd)
 

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

Detailed Description


Created 03/15/2011 Jimmy Yang

Macro Definition Documentation

◆ COLUMN_SEPARATOR

#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

◆ GET_OPTION

#define GET_OPTION (   meta_info,
  option,
  val,
  val_len 
)
Value:
do { \
val_len = meta_info->options[option].value_len; \
if (val_len == 0) { \
} else { \
val = meta_info->options[option].value; \
} \
} while (0)
int value_len
Definition: innodb_config.h:176
char value[MAX_DELIMITER_LEN+1]
Definition: innodb_config.h:174
option_t config_option_names[]
Configure options enum IDs, their "names" and their default value.
Definition: innodb_config.cc:47
option_value_t default_value
default value
Definition: innodb_config.h:185
structure to define some default "config_option" option settings
Definition: innodb_config.h:180
if(!(yy_init))
Definition: lexyy.cc:1144

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

◆ MAX_DATABASE_NAME_LEN

#define MAX_DATABASE_NAME_LEN   MAX_TABLE_NAME_LEN

◆ MAX_DELIMITER_LEN

#define MAX_DELIMITER_LEN   32

Maximum delimiter length.

◆ MAX_FULL_NAME_LEN

#define MAX_FULL_NAME_LEN   (MAX_TABLE_NAME_LEN + MAX_DATABASE_NAME_LEN + 14)

◆ MAX_TABLE_NAME_LEN

#define MAX_TABLE_NAME_LEN   192

Max table name length as defined in univ.i.

◆ MCI_CFG_CACHE_POLICIES

#define MCI_CFG_CACHE_POLICIES   "cache_policies"

◆ MCI_CFG_CONFIG_OPTIONS

#define MCI_CFG_CONFIG_OPTIONS   "config_options"

◆ MCI_CFG_CONTAINER_TABLE

#define MCI_CFG_CONTAINER_TABLE   "containers"

◆ MCI_CFG_DB_NAME

#define MCI_CFG_DB_NAME   "innodb_memcache"

◆ TABLE_MAP_SEPARATOR

#define TABLE_MAP_SEPARATOR   "table_map_delimiter"

Typedef Documentation

◆ cache_policy_t

columns in the "cache_policy" table

◆ config_opt_t

typedef enum config_opt config_opt_t

columns in the "config_options" table

◆ container_t

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

◆ hash_node_t

typedef void* hash_node_t

◆ meta_cache_opt_t

Cache options, tells if we will used Memcached default engine or InnoDB Memcached engine to handle the request.

◆ meta_cfg_info_t

In memory structure contains most necessary metadata info to configure an InnoDB Memcached engine.

◆ meta_column_t

typedef struct meta_column meta_column_t

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

◆ meta_index_t

typedef struct meta_index meta_index_t

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

◆ meta_use_idx_t

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

◆ option_id_t

typedef enum option_id option_id_t

◆ option_t

typedef struct option option_t

structure to define some default "config_option" option settings

◆ option_value_t

typedef struct option_value option_value_t

Enumeration Type Documentation

◆ cache_policy

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

◆ config_opt

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

◆ container

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

◆ meta_cache_opt

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.

◆ meta_use_idx

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

◆ option_id

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

OPT_port 
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_report_data_truncation 
OPT_plugin_dir 
OPT_default_auth 
OPT_bind_address 
OPT_ssl_crl 
OPT_ssl_crlpath 
OPT_enable_cleartext_plugin 
OPT_tls_version 
OPT_ssl_mode 
OPT_optional_resultset_metadata 
OPT_ssl_fips_mode 
OPT_tls_ciphersuites 
OPT_keep_this_one_last 

Function Documentation

◆ innodb_config()

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



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.

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

◆ innodb_config_free()

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 structure

Parameters
itemin: meta info structure

◆ innodb_config_meta_hash_init()

meta_cfg_info_t* innodb_config_meta_hash_init ( hash_table_t meta_hash,
void *  thd 
)



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: MySQL THD



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
thdin/out: MySQL THD

◆ innodb_verify()

bool innodb_verify ( meta_cfg_info_t info,
void *  thd 
)


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


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

Parameters
[in]infometa info structure
[in,out]thdMySQL THD
Returns
true if everything works out fine
Parameters
infoin: meta info structure
thdin/out: MySQL THD