CUBRID Engine
latest
|
#include "config.h"
#include "broker_config.h"
#include "broker_shm.h"
#include "shard_proxy_common.h"
Go to the source code of this file.
void shard_shm_dump_appl_server | ( | FILE * | fp, |
int | shmid | ||
) |
Definition at line 651 of file shard_shm.c.
References NULL, SHARD_ERR, shard_shm_dump_appl_server_internal(), SHM_MODE_MONITOR, SHM_PROXY, uw_shm_detach(), and uw_shm_open().
Referenced by broker_config_dump().
void shard_shm_dump_appl_server_internal | ( | FILE * | fp, |
T_SHM_PROXY * | shm_as_p | ||
) |
Definition at line 641 of file shard_shm.c.
References assert, and shard_shm_dump_proxy().
Referenced by shard_shm_dump_appl_server().
T_PROXY_INFO* shard_shm_find_proxy_info | ( | T_SHM_PROXY * | proxy_p, |
int | proxy_id | ||
) |
Definition at line 419 of file shard_shm.c.
References assert, NULL, proxy_id, t_shm_proxy::proxy_info, and proxy_info_p.
Referenced by admin_reset_cmd(), br_inactivate(), broker_find_available_proxy(), cas_monitor_worker(), check_shard_conn(), client_monitor(), hang_check_thr_f(), metadata_monitor(), proxy_activate(), proxy_activate_internal(), proxy_check_worker(), proxy_monitor_thr_f(), proxy_shm_initialize(), psize_check_thr_f(), shard_broker_process(), shard_shm_check_max_file_open_limit(), shard_shm_dump_proxy(), shard_shm_initialize_shm_proxy(), shard_shm_set_param_as_in_proxy(), shard_shm_set_param_proxy(), and shard_shm_set_param_proxy_internal().
T_SHARD_INFO* shard_shm_find_shard_info | ( | T_PROXY_INFO * | proxy_info_p, |
int | shard_id | ||
) |
Definition at line 433 of file shard_shm.c.
References assert, NULL, and t_proxy_info::shard_info.
Referenced by admin_reset_cmd(), cas_monitor_worker(), check_shard_conn(), metadata_monitor(), proxy_activate_internal(), proxy_available_cas_wait_timer(), proxy_client_add_waiter_by_shard(), proxy_client_check_waiter_and_wakeup(), proxy_convert_error_code(), proxy_shard_io_initialize(), shard_broker_process(), shard_shm_check_max_file_open_limit(), shard_shm_dump_proxy_info(), shard_shm_get_as_info(), shard_shm_set_param_as_in_shard(), and shard_stmt_initialize().
T_APPL_SERVER_INFO* shard_shm_get_as_info | ( | T_PROXY_INFO * | proxy_info_p, |
T_SHM_APPL_SERVER * | shm_as_p, | ||
int | shard_id, | ||
int | as_id | ||
) |
Definition at line 671 of file shard_shm.c.
References t_shm_appl_server::as_info, t_shard_info::as_info_index_base, assert, NULL, and shard_shm_find_shard_info().
Referenced by proxy_find_idle_cas_by_conn_info(), proxy_handler_is_cas_in_tran(), proxy_set_conn_info(), shard_shm_set_as_client_info(), and shard_shm_set_as_client_info_with_db_param().
T_CLIENT_INFO* shard_shm_get_client_info | ( | T_PROXY_INFO * | proxy_info_p, |
int | idx | ||
) |
Definition at line 448 of file shard_shm.c.
References assert, t_proxy_info::client_info, CLIENT_INFO_SIZE_LIMIT, and NULL.
Referenced by client_monitor(), fn_proxy_client_get_db_parameter(), fn_proxy_client_set_db_parameter(), proxy_cas_alloc_by_ctx(), proxy_context_free_client(), proxy_context_send_error(), proxy_handler_process_cas_response(), proxy_handler_process_client_request(), proxy_handler_process_client_wakeup_by_shard(), proxy_process_client_register(), proxy_send_response_to_client_with_new_event(), proxy_socket_io_new_client(), and proxy_socket_io_write_to_client().
T_SHM_SHARD_KEY_STAT* shard_shm_get_key_stat | ( | T_PROXY_INFO * | proxy_info_p, |
int | idx | ||
) |
Definition at line 478 of file shard_shm.c.
References assert, t_proxy_info::key_stat, and NULL.
Referenced by metadata_monitor(), and proxy_update_shard_stats().
T_SHM_SHARD_CONN_STAT* shard_shm_get_shard_stat | ( | T_PROXY_INFO * | proxy_info_p, |
int | idx | ||
) |
Definition at line 463 of file shard_shm.c.
References assert, NULL, and t_proxy_info::shard_stat.
Referenced by metadata_monitor(), proxy_update_shard_stats(), and proxy_update_shard_stats_without_hint().
void shard_shm_init_client_info | ( | T_CLIENT_INFO * | client_info_p | ) |
Definition at line 756 of file shard_shm.c.
References assert, CAS_USE_DEFAULT_DB_PARAM, t_client_info::client_id, t_client_info::client_ip, t_client_info::connect_time, t_client_info::driver_info, t_client_info::func_code, t_client_info::isolation_level, t_client_info::lock_timeout, t_client_info::req_time, t_client_info::res_time, and SRV_CON_CLIENT_INFO_SIZE.
Referenced by proxy_context_free_client(), proxy_socket_io_write_to_client(), and shard_shm_initialize_shm_proxy().
void shard_shm_init_client_info_request | ( | T_CLIENT_INFO * | client_info_p | ) |
Definition at line 773 of file shard_shm.c.
References assert, t_client_info::func_code, t_client_info::req_time, and t_client_info::res_time.
Referenced by proxy_context_send_error(), and proxy_handler_process_client_request().
T_SHM_PROXY* shard_shm_initialize_shm_proxy | ( | T_BROKER_INFO * | br_info | ) |
Definition at line 261 of file shard_shm.c.
References t_broker_info::appl_server, t_proxy_info::appl_server, t_broker_info::appl_server_max_num, t_broker_info::appl_server_min_num, t_broker_info::appl_server_num, t_broker_info::appl_server_shm_id, t_proxy_info::appl_server_shm_id, t_shard_info::as_info_index_base, t_proxy_info::client_info, t_proxy_info::cur_client, i, t_broker_info::ignore_shard_hint, t_proxy_info::ignore_shard_hint, t_proxy_info::key_stat, t_shard_info::max_appl_server, t_broker_info::max_client, t_proxy_info::max_client, t_shm_proxy::max_client, t_proxy_info::max_context, t_shm_proxy::max_context, t_proxy_info::max_prepared_stmt_count, t_proxy_info::max_shard, t_shard_info::min_appl_server, NULL, t_shard_info::num_appl_server, t_broker_info::num_proxy, t_shm_proxy::num_proxy, t_shm_shard_conn::num_shard_conn, t_proxy_info::num_shard_conn, t_shm_shard_key::num_shard_key, t_proxy_info::num_shard_key, t_proxy_info::pid, t_proxy_info::proxy_access_log_reset, t_proxy_info::proxy_id, proxy_info_p, t_proxy_info::proxy_log_reset, t_broker_info::proxy_max_prepared_stmt_count, t_broker_info::proxy_shm_id, PROXY_STATUS_START, t_broker_info::proxy_timeout, t_proxy_info::service_flag, SERVICE_ON, t_shm_shard_conn::shard_conn, t_shard_conn::shard_id, t_shard_info::shard_id, t_proxy_info::shard_info, t_shm_shard_key::shard_key, shard_metadata_get_conn(), shard_metadata_get_key(), shard_metadata_initialize(), shard_shm_find_proxy_info(), shard_shm_get_max_context(), shard_shm_init_client_info(), shard_shm_init_key_stat(), shard_shm_init_shard_stat(), shard_shm_set_shm_proxy(), t_proxy_info::shard_stat, shm_conn_p, shm_key_p, SHM_PROXY, shm_proxy_p, t_shm_proxy::shm_shard_conn, t_shm_proxy::shm_shard_key, t_proxy_info::status, uw_shm_create(), uw_shm_destroy(), and t_proxy_info::wait_timeout.
Referenced by admin_on_cmd(), and admin_start_cmd().
bool shard_shm_set_as_client_info | ( | T_PROXY_INFO * | proxy_info_p, |
T_SHM_APPL_SERVER * | shm_as_p, | ||
int | shard_id, | ||
int | as_id, | ||
unsigned int | ip_addr, | ||
char * | driver_info, | ||
char * | driver_version | ||
) |
Definition at line 689 of file shard_shm.c.
References t_appl_server_info::cas_clt_ip, CAS_MAKE_PROTO_VER, t_appl_server_info::clt_version, t_appl_server_info::driver_info, t_appl_server_info::driver_version, NULL, shard_shm_get_as_info(), SRV_CON_CLIENT_INFO_SIZE, and SRV_CON_VER_STR_MAX_SIZE.
Referenced by proxy_handler_process_client_wakeup_by_shard().
bool shard_shm_set_as_client_info_with_db_param | ( | T_PROXY_INFO * | proxy_info_p, |
T_SHM_APPL_SERVER * | shm_as_p, | ||
int | shard_id, | ||
int | as_id, | ||
T_CLIENT_INFO * | client_info_p | ||
) |
Definition at line 724 of file shard_shm.c.
References assert, t_appl_server_info::cas_clt_ip, CAS_MAKE_PROTO_VER, t_client_info::client_ip, t_appl_server_info::clt_version, t_appl_server_info::driver_info, t_client_info::driver_info, t_appl_server_info::driver_version, t_client_info::driver_version, t_appl_server_info::isolation_level, t_client_info::isolation_level, t_appl_server_info::lock_timeout, t_client_info::lock_timeout, NULL, shard_shm_get_as_info(), SRV_CON_CLIENT_INFO_SIZE, and SRV_CON_VER_STR_MAX_SIZE.
Referenced by proxy_cas_alloc_by_ctx().
void shard_shm_set_client_info_request | ( | T_CLIENT_INFO * | client_info_p, |
int | func_code | ||
) |
Definition at line 783 of file shard_shm.c.
References assert, t_client_info::func_code, NULL, t_client_info::req_time, and t_client_info::res_time.
Referenced by proxy_handler_process_client_request().
void shard_shm_set_client_info_response | ( | T_CLIENT_INFO * | client_info_p | ) |
Definition at line 793 of file shard_shm.c.
References assert, NULL, and t_client_info::res_time.
Referenced by proxy_handler_process_cas_response().