CUBRID Engine
latest
|
#include "config.h"
#include "cas_protocol.h"
#include "environment_variable.h"
#include "porting.h"
Go to the source code of this file.
Classes | |
struct | t_broker_info |
Typedefs | |
typedef enum t_sql_log_mode_value | T_SQL_LOG_MODE_VALUE |
typedef enum t_slow_log_value | T_SLOW_LOG_VALUE |
typedef enum t_keep_con_value | T_KEEP_CON_VALUE |
typedef enum t_access_mode_value | T_ACCESS_MODE_VALUE |
typedef enum t_connect_order_value | T_CONNECT_ORDER_VALUE |
typedef enum t_proxy_log_mode_value | T_PROXY_LOG_MODE_VALUE |
typedef struct t_broker_info | T_BROKER_INFO |
Enumerations | |
enum | t_sql_log_mode_value { SQL_LOG_MODE_NONE = 0, SQL_LOG_MODE_ERROR = 1, SQL_LOG_MODE_TIMEOUT = 2, SQL_LOG_MODE_NOTICE = 3, SQL_LOG_MODE_ALL = 4, SQL_LOG_MODE_DEFAULT = SQL_LOG_MODE_ERROR } |
enum | t_slow_log_value { SLOW_LOG_MODE_OFF = 0, SLOW_LOG_MODE_ON = 1, SLOW_LOG_MODE_DEFAULT = SLOW_LOG_MODE_ON } |
enum | t_keep_con_value { KEEP_CON_ON = 1, KEEP_CON_AUTO = 2, KEEP_CON_DEFAULT = KEEP_CON_AUTO } |
enum | t_access_mode_value { READ_WRITE_ACCESS_MODE = 0, READ_ONLY_ACCESS_MODE = 1, SLAVE_ONLY_ACCESS_MODE = 2 } |
enum | t_connect_order_value { CONNECT_ORDER_SEQ = 0, CONNECT_ORDER_RANDOM = 1, CONNECT_ORDER_DEFAULT = CONNECT_ORDER_SEQ } |
enum | t_proxy_log_mode_value { PROXY_LOG_MODE_NONE = 0, PROXY_LOG_MODE_ERROR = 1, PROXY_LOG_MODE_TIMEOUT = 2, PROXY_LOG_MODE_NOTICE = 3, PROXY_LOG_MODE_SHARD_DETAIL = 4, PROXY_LOG_MODE_SCHEDULE_DETAIL = 5, PROXY_LOG_MODE_DEBUG = 6, PROXY_LOG_MODE_ALL = 7, PROXY_LOG_MODE_DEFAULT = SQL_LOG_MODE_ERROR } |
Functions | |
int | broker_config_read (const char *conf_file, T_BROKER_INFO *br_info, int *num_broker, int *br_shm_id, char *admin_log_file, char admin_flag, bool *acl_flag, char *acl_file, char *admin_err_msg) |
void | broker_config_dump (FILE *fp, const T_BROKER_INFO *br_info, int num_broker, int br_shm_id) |
int | conf_get_value_table_on_off (const char *value) |
int | conf_get_value_sql_log_mode (const char *value) |
int | conf_get_value_keep_con (const char *value) |
int | conf_get_value_access_mode (const char *value) |
int | conf_get_value_connect_order (const char *value) |
int | conf_get_value_proxy_log_mode (const char *value) |
void | dir_repath (char *path, size_t path_len) |
#define APPL_SERVER_CAS 0 |
Definition at line 34 of file broker_config.h.
Referenced by get_as_type(), init_default_conn_info(), server_monitor_thr_f(), shard_stmt_write_buf_to_sql(), and uc_conf_broker_add().
#define APPL_SERVER_CAS_MYSQL 3 |
Definition at line 37 of file broker_config.h.
Referenced by broker_config_dump(), get_appl_server_name(), get_as_type(), get_as_type_str(), init_default_conn_info(), proxy_check_authorization(), proxy_find_idle_cas_by_conn_info(), proxy_io_make_client_dbinfo_ok(), proxy_set_conn_info(), and shard_stmt_find_by_sql().
#define APPL_SERVER_CAS_MYSQL51 2 |
Definition at line 36 of file broker_config.h.
Referenced by broker_config_dump(), get_appl_server_name(), get_as_type(), get_as_type_str(), and proxy_io_make_client_dbinfo_ok().
#define APPL_SERVER_CAS_MYSQL51_TYPE_NAME "CAS_MYSQL51" |
Definition at line 47 of file broker_config.h.
Referenced by get_as_type(), and get_as_type_str().
#define APPL_SERVER_CAS_MYSQL61_TYPE_NAME "CAS_MYSQL61" |
Definition at line 48 of file broker_config.h.
#define APPL_SERVER_CAS_MYSQL_TYPE_NAME "CAS_MYSQL" |
Definition at line 46 of file broker_config.h.
Referenced by get_as_type(), and get_as_type_str().
#define APPL_SERVER_CAS_ORACLE 1 |
Definition at line 35 of file broker_config.h.
Referenced by as_activate(), get_appl_server_name(), get_as_type(), get_as_type_str(), init_default_conn_info(), proxy_io_make_client_dbinfo_ok(), and run_appl_server().
#define APPL_SERVER_CAS_ORACLE_TYPE_NAME "CAS_ORACLE" |
Definition at line 45 of file broker_config.h.
Referenced by get_as_type(), and get_as_type_str().
#define APPL_SERVER_CAS_TYPE_NAME "CAS" |
Definition at line 44 of file broker_config.h.
Referenced by get_as_type_str().
#define BROKER_INFO_NAME_MAX (BROKER_INFO_PATH_MAX) |
Definition at line 106 of file broker_config.h.
Referenced by admin_conf_change().
#define BROKER_INFO_PATH_MAX (PATH_MAX) |
Definition at line 105 of file broker_config.h.
Referenced by broker_config_read_internal().
#define BROKER_LOG_MSG_SIZE 64 |
Definition at line 88 of file broker_config.h.
#define BROKER_NAME_LEN 64 |
Definition at line 87 of file broker_config.h.
Referenced by access_control_check_right(), access_control_read_config_file(), access_control_set_shm(), admin_getid_cmd(), admin_on_cmd(), admin_start_cmd(), br_inactivate(), brief_monitor(), broker_config_read_internal(), cas_init(), get_shard_db_password(), logddl_set_br_name(), main(), and record_ip_access_time().
#define BROKER_PATH_MAX (PATH_MAX) |
Definition at line 91 of file broker_config.h.
Referenced by access_control_read_config_file(), access_control_repath_file(), admin_conf_change(), admin_start_cmd(), as_activate(), as_db_err_log_set(), as_pid_file_create(), br_activate(), broker_config_read(), broker_config_read_internal(), broker_create_dir(), cas_error_log_backup(), cas_error_log_open(), cas_log_backup(), cas_log_open(), cas_log_query_plan_file(), cas_log_write_and_set_savedpos(), cas_main(), cas_slow_log_open(), cfg_get_dbinfo(), cfg_read_dbinfo(), check_cas_log(), check_proxy_log(), dir_repath(), get_as_slow_log_filename(), get_as_sql_log_filename(), get_cubrid_file(), get_error_msg(), get_master_shm_id(), main(), make_error_log_filename(), make_proxy_log_filename(), make_sql_log_filename(), net_connect_proxy(), proxy_log_backup(), proxy_log_open(), restart_appl_server(), run_appl_server(), set_cubrid_file(), set_cubrid_home(), shard_metadata_read_conn(), shard_metadata_read_key(), sql_log2_init(), uc_add(), uc_as_info(), uc_br_info(), uc_broker_shm_open(), uc_changer_internal(), uc_del_cas_log(), uc_off(), uc_on(), uc_restart(), uc_start(), uc_stop(), uc_unicas_conf(), ut_cd_work_dir(), ut_get_as_pid_name(), ut_get_as_port_name(), ut_get_broker_port_name(), ut_get_proxy_port_name(), ut_kill_as_process(), ut_kill_broker_process(), ut_kill_proxy_process(), and ux_execute_all().
#define CLIENT_INFO_SIZE_LIMIT 10000 |
Definition at line 102 of file broker_config.h.
Referenced by broker_config_read_internal(), and shard_shm_get_client_info().
#define CONF_ERR_LOG_BOTH (CONF_ERR_LOG_LOGFILE | CONF_ERR_LOG_BROWSER) |
Definition at line 77 of file broker_config.h.
#define CONF_ERR_LOG_BROWSER 0x02 |
Definition at line 76 of file broker_config.h.
#define CONF_ERR_LOG_LOGFILE 0x01 |
Definition at line 75 of file broker_config.h.
#define CONF_ERR_LOG_NONE 0x00 |
Definition at line 74 of file broker_config.h.
#define CONF_LOG_FILE_LEN 128 |
Definition at line 52 of file broker_config.h.
Referenced by admin_conf_change(), broker_config_read_internal(), broker_shm_initialize_shm_broker(), and proxy_activate().
#define DEFAULT_ACCESS_LOG_MAX_SIZE "10M" |
Definition at line 82 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_AS_MAX_NUM 40 |
Definition at line 55 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_AS_MIN_NUM 5 |
Definition at line 54 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_LONG_QUERY_TIME "1min" |
Definition at line 80 of file broker_config.h.
Referenced by broker_config_read_internal(), and uc_conf_broker_add().
#define DEFAULT_LONG_TRANSACTION_TIME "1min" |
Definition at line 81 of file broker_config.h.
Referenced by broker_config_read_internal(), and uc_conf_broker_add().
#define DEFAULT_MAX_NUM_DELAYED_HOSTS_LOOKUP -1 |
Definition at line 85 of file broker_config.h.
Referenced by admin_conf_change(), and broker_config_read_internal().
#define DEFAULT_SERVER_HARD_LIMIT "1G" |
Definition at line 69 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_SERVER_MAX_SIZE "0" |
Definition at line 66 of file broker_config.h.
Referenced by broker_config_read_internal(), and uc_conf_broker_add().
#define DEFAULT_SHARD_MAX_CLIENTS 256 |
Definition at line 95 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_SHARD_NUM_PROXY 1 |
Definition at line 94 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_SHARD_PROXY_LOG_MAX_SIZE "100M" |
Definition at line 97 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_SQL_LOG_MAX_SIZE "10M" |
Definition at line 79 of file broker_config.h.
Referenced by broker_config_read_internal(), and uc_conf_broker_add().
#define DEFAULT_SSL_MODE "OFF" |
Definition at line 108 of file broker_config.h.
Referenced by broker_config_read_internal().
#define DEFAULT_TIME_TO_KILL "2min" |
Definition at line 71 of file broker_config.h.
Referenced by broker_config_read_internal(), and uc_conf_broker_add().
#define IS_APPL_SERVER_TYPE_CAS | ( | x | ) |
Definition at line 39 of file broker_config.h.
Referenced by admin_restart_cmd(), appl_info_display(), br_activate(), change_conf_as_type(), conf_copy_broker(), get_status_string(), and uc_as_info().
#define IS_NOT_APPL_SERVER_TYPE_CAS | ( | x | ) | !IS_APPL_SERVER_TYPE_CAS(x) |
Definition at line 42 of file broker_config.h.
Referenced by admin_del_cas_log(), check_cas_log(), and find_drop_as_index().
#define MAX_ACCESS_LOG_MAX_SIZE 2097152 /* 2G */ |
Definition at line 84 of file broker_config.h.
Referenced by admin_conf_change(), and broker_config_read_internal().
#define MAX_BROKER_NUM 50 |
Definition at line 50 of file broker_config.h.
Referenced by admin_stop_cmd(), broker_config_dump(), broker_config_read(), broker_config_read_internal(), main(), uc_add(), uc_as_info(), uc_br_info(), uc_broker_shm_open(), uc_changer_internal(), uc_del_cas_log(), uc_drop(), uc_off(), uc_on(), uc_restart(), uc_start(), uc_stop(), and uc_unicas_conf().
#define MAX_PROXY_LOG_MAX_SIZE 1048576 /* about 1G */ |
Definition at line 98 of file broker_config.h.
Referenced by admin_conf_change(), and broker_config_read_internal().
#define MAX_SQL_LOG_MAX_SIZE 2097152 /* 2G */ |
Definition at line 83 of file broker_config.h.
Referenced by admin_conf_change(), and broker_config_read_internal().
#define SHARD_CONN_STAT_SIZE_LIMIT 256 |
Definition at line 100 of file broker_config.h.
#define SHARD_ERR | ( | f, | |
a... | |||
) |
Definition at line 323 of file broker_config.h.
Referenced by broker_init_shm(), cas_init_shm(), init_proxy_env(), net_connect_proxy(), proxy_shm_initialize(), shard_metadata_dump(), shard_metadata_validate_conn(), shard_metadata_validate_key(), shard_metadata_validate_key_function(), shard_metadata_validate_key_range_internal(), and shard_shm_dump_appl_server().
#define SHARD_INF | ( | f, | |
a... | |||
) |
Definition at line 324 of file broker_config.h.
Referenced by shard_metadata_initialize(), shard_metadata_read_conn(), shard_metadata_read_key(), and shard_metadata_read_user().
#define SHARD_INFO_SIZE_LIMIT 256 |
Definition at line 103 of file broker_config.h.
Referenced by metadata_monitor().
#define SHARD_KEY_STAT_SIZE_LIMIT 2 |
Definition at line 101 of file broker_config.h.
#define SQL_LOG_TIME_MAX -1 |
Definition at line 72 of file broker_config.h.
typedef enum t_access_mode_value T_ACCESS_MODE_VALUE |
Definition at line 143 of file broker_config.h.
typedef struct t_broker_info T_BROKER_INFO |
Definition at line 169 of file broker_config.h.
typedef enum t_connect_order_value T_CONNECT_ORDER_VALUE |
Definition at line 152 of file broker_config.h.
typedef enum t_keep_con_value T_KEEP_CON_VALUE |
Definition at line 135 of file broker_config.h.
typedef enum t_proxy_log_mode_value T_PROXY_LOG_MODE_VALUE |
Definition at line 167 of file broker_config.h.
typedef enum t_slow_log_value T_SLOW_LOG_VALUE |
Definition at line 127 of file broker_config.h.
typedef enum t_sql_log_mode_value T_SQL_LOG_MODE_VALUE |
Definition at line 119 of file broker_config.h.
enum t_access_mode_value |
Enumerator | |
---|---|
READ_WRITE_ACCESS_MODE | |
READ_ONLY_ACCESS_MODE | |
SLAVE_ONLY_ACCESS_MODE |
Definition at line 137 of file broker_config.h.
Enumerator | |
---|---|
CONNECT_ORDER_SEQ | |
CONNECT_ORDER_RANDOM | |
CONNECT_ORDER_DEFAULT |
Definition at line 146 of file broker_config.h.
enum t_keep_con_value |
Enumerator | |
---|---|
KEEP_CON_ON | |
KEEP_CON_AUTO | |
KEEP_CON_DEFAULT |
Definition at line 129 of file broker_config.h.
Definition at line 154 of file broker_config.h.
enum t_slow_log_value |
Enumerator | |
---|---|
SLOW_LOG_MODE_OFF | |
SLOW_LOG_MODE_ON | |
SLOW_LOG_MODE_DEFAULT |
Definition at line 121 of file broker_config.h.
enum t_sql_log_mode_value |
Enumerator | |
---|---|
SQL_LOG_MODE_NONE | |
SQL_LOG_MODE_ERROR | |
SQL_LOG_MODE_TIMEOUT | |
SQL_LOG_MODE_NOTICE | |
SQL_LOG_MODE_ALL | |
SQL_LOG_MODE_DEFAULT |
Definition at line 110 of file broker_config.h.
void broker_config_dump | ( | FILE * | fp, |
const T_BROKER_INFO * | br_info, | ||
int | num_broker, | ||
int | br_shm_id | ||
) |
Definition at line 1290 of file broker_config.c.
References APPL_SERVER_CAS_MYSQL, APPL_SERVER_CAS_MYSQL51, appl_server_shm_id, conf_file_loaded, get_conf_string(), i, MAX_BROKER_NUM, MAX_NUM_OF_CONF_FILE_LOADED, NULL, OFF, ONE_K, proxy_shm_id, query_timeout, shard_metadata_dump(), shard_shm_dump_appl_server(), and stripped_column_name.
Referenced by admin_info_cmd().
int broker_config_read | ( | const char * | conf_file, |
T_BROKER_INFO * | br_info, | ||
int * | num_broker, | ||
int * | br_shm_id, | ||
char * | admin_log_file, | ||
char | admin_flag, | ||
bool * | acl_flag, | ||
char * | acl_file, | ||
char * | admin_err_msg | ||
) |
Definition at line 1228 of file broker_config.c.
References basename_r(), broker_config_read_internal(), BROKER_PATH_MAX, envvar_get(), err, FID_CUBRID_BROKER_CONF, get_cubrid_file(), MAX_BROKER_NUM, NULL, and PRINT_AND_LOG_ERR_MSG.
Referenced by admin_common(), and main().
int conf_get_value_access_mode | ( | const char * | value | ) |
Definition at line 1566 of file broker_config.c.
References get_conf_value().
Referenced by admin_conf_change().
int conf_get_value_connect_order | ( | const char * | value | ) |
Definition at line 1577 of file broker_config.c.
References get_conf_value().
Referenced by admin_conf_change(), and broker_config_read_internal().
int conf_get_value_keep_con | ( | const char * | value | ) |
Definition at line 1555 of file broker_config.c.
References get_conf_value().
Referenced by admin_conf_change(), and broker_config_read_internal().
int conf_get_value_proxy_log_mode | ( | const char * | value | ) |
Definition at line 1588 of file broker_config.c.
References get_conf_value().
Referenced by admin_conf_change(), broker_config_read_internal(), and shard_shm_set_param_proxy_internal().
int conf_get_value_sql_log_mode | ( | const char * | value | ) |
Definition at line 1544 of file broker_config.c.
References get_conf_value().
Referenced by admin_conf_change(), broker_config_read_internal(), and shard_shm_set_param_as_internal().
int conf_get_value_table_on_off | ( | const char * | value | ) |
Definition at line 1533 of file broker_config.c.
References get_conf_value().
Referenced by admin_conf_change(), broker_config_read_internal(), and shard_shm_set_param_as_internal().
void dir_repath | ( | char * | path, |
size_t | path_len | ||
) |
Definition at line 321 of file broker_config.c.
References assert, BROKER_PATH_MAX, get_cubrid_home(), IS_ABS_PATH, strncpy_bufsize, and trim().
Referenced by broker_config_read_internal(), and proxy_activate().