CUBRID Engine
latest
|
#include <assert.h>
#include "broker_config.h"
#include "broker_shm.h"
#include "shard_proxy_common.h"
#include "cas_protocol.h"
#include "shard_shm.h"
#include "shard_proxy_handler.h"
#include "shard_proxy_io.h"
#include "shard_proxy_queue.h"
#include "shard_parser.h"
#include "shard_proxy_function.h"
Go to the source code of this file.
Macros | |
#define | PROXY_MAX_IGNORE_TIMER_CHECK 10 |
#define | PROXY_TIMER_CHECK_INTERVAL 1 /* sec */ |
#define PROXY_MAX_IGNORE_TIMER_CHECK 10 |
Definition at line 45 of file shard_proxy_handler.c.
Referenced by proxy_timer_process().
#define PROXY_TIMER_CHECK_INTERVAL 1 /* sec */ |
Definition at line 46 of file shard_proxy_handler.c.
Referenced by proxy_timer_process().
T_CONTEXT_STMT* proxy_context_add_stmt | ( | T_PROXY_CONTEXT * | ctx_p, |
T_SHARD_STMT * | stmt_p | ||
) |
Definition at line 1372 of file shard_proxy_handler.c.
References error(), FREE_MEM, t_context_stmt::next, NULL, proxy_context_find_stmt(), PROXY_DEBUG_LOG, proxy_str_context(), shard_stmt_pin(), shard_str_stmt(), t_shard_stmt::stmt_h_id, t_context_stmt::stmt_h_id, and t_proxy_context::stmt_list.
Referenced by fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), fn_proxy_client_schema_info(), and proxy_client_execute_internal().
|
static |
Definition at line 1106 of file shard_proxy_handler.c.
References assert, t_proxy_context::cas_id, t_proxy_context::client_id, t_proxy_context::database_passwd, t_proxy_context::database_user, t_proxy_context::dont_free_statement, t_proxy_context::free_context, t_proxy_context::free_on_client_io_write, t_proxy_context::free_on_end_tran, t_proxy_context::func_code, HT_INVAL, t_proxy_context::is_busy, t_proxy_context::is_cas_in_tran, t_proxy_context::is_client_in_tran, t_proxy_context::is_connected, t_proxy_context::is_in_tran, t_proxy_context::is_prepare_for_execute, NULL, t_proxy_context::prepared_stmt, proxy_context_clear_error(), proxy_context_free_stmt(), proxy_event_free(), PROXY_INVALID_CAS, PROXY_INVALID_CLIENT, PROXY_INVALID_FUNC_CODE, PROXY_INVALID_SHARD, t_proxy_context::shard_id, shard_stmt_check_waiter_and_wakeup(), shard_stmt_free(), SHARD_STMT_INVALID_HANDLE_ID, SHARD_STMT_STATUS_IN_PROGRESS, SHARD_STMT_TYPE_PREPARED, t_shard_stmt::status, t_proxy_context::stmt_h_id, t_proxy_context::stmt_hint_type, t_shard_stmt::stmt_type, t_proxy_context::uid, t_proxy_context::wait_timeout, t_proxy_context::waiting_dummy_prepare, and t_proxy_context::waiting_event.
Referenced by proxy_context_free(), proxy_context_initialize(), and proxy_context_new().
void proxy_context_clear_error | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 306 of file shard_proxy_handler.c.
References assert, CAS_NO_ERROR, t_proxy_context::error_code, t_proxy_context::error_ind, and t_proxy_context::error_msg.
Referenced by proxy_context_clear(), proxy_context_timeout(), proxy_handler_process_client_request(), and proxy_process_client_register().
|
static |
Definition at line 969 of file shard_proxy_handler.c.
References t_proxy_context::cas_id, t_proxy_context::cid, t_proxy_context::client_id, t_proxy_context_global::ent, t_proxy_context::error_code, t_proxy_context::error_ind, t_proxy_context::free_context, FREE_MEM, t_proxy_context::free_on_client_io_write, t_proxy_context::free_on_end_tran, t_proxy_context_global::freeq, t_proxy_context::func_code, i, t_proxy_context::is_busy, t_proxy_context::is_client_in_tran, t_proxy_context::is_in_tran, t_proxy_context::is_prepare_for_execute, t_context_stmt::next, NULL, PROXY_LOG, PROXY_LOG_MODE_SCHEDULE_DETAIL, shard_cqueue_destroy(), t_proxy_context::shard_id, t_proxy_context_global::size, t_context_stmt::stmt_h_id, t_proxy_context::stmt_h_id, t_proxy_context::stmt_hint_type, t_proxy_context::stmt_list, and t_proxy_context::uid.
Referenced by proxy_handler_destroy().
T_PROXY_CONTEXT* proxy_context_find | ( | int | cid, |
unsigned int | uid | ||
) |
Definition at line 1314 of file shard_proxy_handler.c.
References t_proxy_context_global::ent, t_proxy_context::is_busy, NULL, and t_proxy_context::uid.
Referenced by proxy_context_find_by_socket_client_io(), proxy_context_free(), proxy_find_idle_cas_by_conn_info(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_error(), proxy_handler_process_cas_response(), proxy_handler_process_client_conn_error(), proxy_handler_process_client_request(), proxy_handler_process_client_wakeup_by_shard(), proxy_handler_process_client_wakeup_by_statement(), proxy_process_cas_conn_error(), proxy_process_cas_response(), proxy_set_conn_info(), proxy_waiter_timeout(), proxy_wakeup_context_by_shard(), and shard_stmt_new_internal().
T_PROXY_CONTEXT* proxy_context_find_by_socket_client_io | ( | T_SOCKET_IO * | sock_io_p | ) |
Definition at line 1324 of file shard_proxy_handler.c.
References assert, t_socket_io::client_id, t_client_io::ctx_cid, t_client_io::ctx_uid, t_socket_io::fd, t_socket_io::id, NULL, proxy_client_io_find_by_fd(), proxy_client_io_free(), proxy_context_find(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_delete(), and proxy_str_client_io().
Referenced by proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), and proxy_socket_io_write_to_client().
T_CONTEXT_STMT* proxy_context_find_stmt | ( | T_PROXY_CONTEXT * | ctx_p, |
int | stmt_h_id | ||
) |
Definition at line 1354 of file shard_proxy_handler.c.
References t_context_stmt::next, NULL, t_context_stmt::stmt_h_id, and t_proxy_context::stmt_list.
Referenced by fn_proxy_client_prepare(), and proxy_context_add_stmt().
void proxy_context_free | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 1274 of file shard_proxy_handler.c.
References assert, ENTER_FUNC, error(), EXIT_FUNC, t_proxy_context_global::freeq, proxy_context_clear(), proxy_context_find(), proxy_context_free(), proxy_context_free_client(), proxy_context_free_shard(), PROXY_LOG, PROXY_LOG_MODE_ERROR, and shard_cqueue_enqueue().
Referenced by proxy_context_free(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_response(), proxy_handler_process_client_conn_error(), proxy_handler_process_client_request(), proxy_process_cas_conn_error(), proxy_process_cas_response(), proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_socket_io_write_to_client(), and proxy_wakeup_context_by_shard().
|
static |
Definition at line 1226 of file shard_proxy_handler.c.
References assert, t_proxy_context::cid, t_proxy_context::client_id, ENTER_FUNC, EXIT_FUNC, NULL, proxy_client_io_free_by_ctx(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_context(), shard_shm_get_client_info(), shard_shm_init_client_info(), and t_proxy_context::uid.
Referenced by proxy_context_free().
|
static |
Definition at line 1255 of file shard_proxy_handler.c.
References assert, t_proxy_context::cas_id, t_proxy_context::cid, ENTER_FUNC, EXIT_FUNC, t_proxy_context::is_in_tran, proxy_cas_io_free_by_ctx(), t_proxy_context::shard_id, and t_proxy_context::uid.
Referenced by proxy_context_free(), and proxy_handler_process_cas_conn_error().
void proxy_context_free_stmt | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 1410 of file shard_proxy_handler.c.
References assert, FREE_MEM, t_context_stmt::next, NULL, t_shard_stmt::num_pinned, PROXY_DEBUG_LOG, proxy_str_context(), shard_stmt_find_by_stmt_h_id(), shard_stmt_free(), SHARD_STMT_STATUS_INVALID, SHARD_STMT_TYPE_PREPARED, shard_stmt_unpin(), shard_str_stmt(), t_shard_stmt::status, t_context_stmt::stmt_h_id, t_proxy_context::stmt_list, and t_shard_stmt::stmt_type.
Referenced by fn_proxy_client_con_close(), fn_proxy_client_end_tran(), proxy_context_clear(), and proxy_handler_process_cas_response().
|
static |
Definition at line 912 of file shard_proxy_handler.c.
References t_proxy_context::cid, t_proxy_context_global::ent, error(), t_proxy_context_global::freeq, i, t_shm_proxy::max_context, NULL, proxy_context_clear(), PROXY_LOG, PROXY_LOG_MODE_ERROR, shard_cqueue_enqueue(), shard_cqueue_initialize(), and t_proxy_context_global::size.
Referenced by proxy_handler_initialize().
T_PROXY_CONTEXT* proxy_context_new | ( | void | ) |
Definition at line 1198 of file shard_proxy_handler.c.
References assert, t_proxy_context_global::freeq, t_proxy_context::is_busy, t_proxy_context::is_in_tran, proxy_context_clear(), PROXY_LOG, PROXY_LOG_MODE_SHARD_DETAIL, proxy_str_context(), shard_cqueue_dequeue(), t_proxy_context::uid, t_proxy_context::wait_timeout, and t_proxy_info::wait_timeout.
Referenced by proxy_client_io_new().
int proxy_context_send_error | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 318 of file shard_proxy_handler.c.
References assert, CAS_NO_ERROR, t_proxy_context::client_id, ENTER_FUNC, error(), t_proxy_context::error_code, t_proxy_context::error_ind, t_proxy_context::error_msg, EXIT_FUNC, t_proxy_context::free_context, t_proxy_context::is_client_in_tran, NULL, t_proxy_info::num_proxy_error_processed, proxy_event_free(), PROXY_EVENT_FROM_CLIENT, PROXY_EVENT_IO_WRITE, proxy_event_new_with_error(), proxy_get_driver_info_by_ctx(), proxy_io_make_error_msg(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_send_response_to_client(), proxy_str_context(), proxy_str_event(), shard_shm_get_client_info(), and shard_shm_init_client_info_request().
Referenced by proxy_context_timeout(), proxy_handler_process_client_request(), and proxy_process_client_register().
void proxy_context_set_error | ( | T_PROXY_CONTEXT * | ctx_p, |
int | error_ind, | ||
int | error_code | ||
) |
Definition at line 281 of file shard_proxy_handler.c.
References assert, CAS_NO_ERROR, t_proxy_context::error_code, t_proxy_context::error_ind, and t_proxy_context::error_msg.
Referenced by fn_proxy_client_cursor(), fn_proxy_client_fetch(), fn_proxy_client_get_db_parameter(), fn_proxy_client_get_db_version(), fn_proxy_client_not_supported(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), fn_proxy_client_schema_info(), fn_proxy_client_set_db_parameter(), proxy_client_execute_internal(), proxy_context_set_error_with_msg(), and proxy_send_request_to_cas_with_new_event().
void proxy_context_set_error_with_msg | ( | T_PROXY_CONTEXT * | ctx_p, |
int | error_ind, | ||
int | error_code, | ||
const char * | error_msg | ||
) |
Definition at line 297 of file shard_proxy_handler.c.
References t_proxy_context::error_msg, and proxy_context_set_error().
Referenced by proxy_check_authorization(), proxy_client_io_new(), proxy_context_timeout(), and proxy_process_client_register().
void proxy_context_set_in_tran | ( | T_PROXY_CONTEXT * | ctx_p, |
int | shard_id, | ||
int | cas_id | ||
) |
Definition at line 1170 of file shard_proxy_handler.c.
References assert, t_proxy_context::cas_id, t_proxy_context::dont_free_statement, t_proxy_context::is_in_tran, and t_proxy_context::shard_id.
Referenced by fn_proxy_client_close_req_handle(), fn_proxy_client_cursor_close(), fn_proxy_client_fetch(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), proxy_client_execute_internal(), proxy_handler_process_client_wakeup_by_shard(), proxy_send_request_to_cas(), proxy_send_request_to_cas_with_new_event(), and proxy_wakeup_context_by_shard().
void proxy_context_set_out_tran | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 1185 of file shard_proxy_handler.c.
References assert, t_proxy_context::cas_id, t_proxy_context::is_in_tran, PROXY_INVALID_CAS, PROXY_INVALID_SHARD, and t_proxy_context::shard_id.
Referenced by proxy_handler_process_cas_conn_error(), and proxy_handler_process_cas_response().
void proxy_context_timeout | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 1447 of file shard_proxy_handler.c.
References assert, CAS_ER_INTERNAL, CAS_ERROR_INDICATOR, t_proxy_context::cas_id, t_proxy_context::func_code, HT_INVAL, t_proxy_context::is_in_tran, NULL, t_proxy_context::prepared_stmt, proxy_context_clear_error(), proxy_context_send_error(), proxy_context_set_error_with_msg(), proxy_event_free(), PROXY_INVALID_CAS, PROXY_INVALID_FUNC_CODE, PROXY_INVALID_SHARD, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_context(), t_proxy_context::shard_id, shard_stmt_check_waiter_and_wakeup(), shard_stmt_free(), SHARD_STMT_INVALID_HANDLE_ID, SHARD_STMT_STATUS_IN_PROGRESS, t_shard_stmt::status, t_proxy_context::stmt_h_id, t_proxy_context::stmt_hint_type, t_proxy_context::wait_timeout, t_proxy_info::wait_timeout, t_proxy_context::waiting_dummy_prepare, and t_proxy_context::waiting_event.
Referenced by proxy_waiter_timeout().
int proxy_event_alloc_buffer | ( | T_PROXY_EVENT * | event_p, |
unsigned int | size | ||
) |
Definition at line 1808 of file shard_proxy_handler.c.
References assert, t_proxy_event::buffer, t_io_buffer::data, t_io_buffer::length, NULL, and t_io_buffer::offset.
Referenced by proxy_socket_io_read_from_cas_first(), and proxy_socket_io_read_from_client_first().
T_PROXY_EVENT* proxy_event_dup | ( | T_PROXY_EVENT * | event_p | ) |
Definition at line 1699 of file shard_proxy_handler.c.
References t_proxy_event::buffer, t_io_buffer::data, FREE_MEM, t_io_buffer::length, NULL, and t_io_buffer::offset.
Referenced by fn_proxy_client_check_cas(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), and proxy_client_execute_internal().
void proxy_event_free | ( | T_PROXY_EVENT * | event_p | ) |
Definition at line 1908 of file shard_proxy_handler.c.
References assert, t_proxy_event::buffer, FREE_MEM, and proxy_io_buffer_clear().
Referenced by fn_proxy_cas_check_cas(), fn_proxy_cas_end_tran(), fn_proxy_cas_fetch(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_relay_only(), fn_proxy_cas_schema_info(), fn_proxy_client_check_cas(), fn_proxy_client_close_req_handle(), fn_proxy_client_con_close(), fn_proxy_client_cursor(), fn_proxy_client_cursor_close(), fn_proxy_client_end_tran(), fn_proxy_client_fetch(), fn_proxy_client_get_db_parameter(), fn_proxy_client_get_db_version(), fn_proxy_client_not_supported(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), fn_proxy_client_schema_info(), fn_proxy_client_set_db_parameter(), fn_proxy_get_shard_info(), proxy_cas_execute_internal(), proxy_client_execute_internal(), proxy_context_clear(), proxy_context_send_error(), proxy_context_timeout(), proxy_event_new_with_error(), proxy_event_new_with_req(), proxy_event_new_with_rsp_ex(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_error(), proxy_handler_process_cas_response(), proxy_handler_process_client_conn_error(), proxy_handler_process_client_request(), proxy_handler_process_client_wakeup_by_shard(), proxy_handler_process_client_wakeup_by_statement(), proxy_process_cas_conn_error(), proxy_process_cas_read_error(), proxy_process_cas_register(), proxy_process_cas_response(), proxy_process_cas_write_error(), proxy_process_client_conn_error(), proxy_process_client_read_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_process_client_write_error(), proxy_send_prepared_stmt_to_client(), proxy_send_request_to_cas_with_new_event(), proxy_send_response_to_client_with_new_event(), proxy_socket_io_clear(), proxy_socket_io_new_client(), proxy_socket_io_write(), proxy_socket_io_write_internal(), proxy_socket_set_write_event(), and proxy_wakeup_context_by_shard().
bool proxy_event_io_read_complete | ( | T_PROXY_EVENT * | event_p | ) |
Definition at line 1888 of file shard_proxy_handler.c.
References assert, t_proxy_event::buffer, t_io_buffer::length, t_io_buffer::offset, PROXY_EVENT_IO_READ, PROXY_EVENT_IO_WRITE, and t_proxy_event::type.
Referenced by proxy_socket_io_read_from_cas_next(), and proxy_socket_io_read_from_client_next().
T_PROXY_EVENT* proxy_event_new | ( | unsigned int | type, |
int | from_cas | ||
) |
Definition at line 1677 of file shard_proxy_handler.c.
References t_proxy_event::buffer, t_proxy_event::cas_id, t_proxy_event::cid, t_proxy_event::from_cas, PROXY_INVALID_CAS, PROXY_INVALID_CONTEXT, PROXY_INVALID_SHARD, t_proxy_event::shard_id, t_proxy_event::type, and t_proxy_event::uid.
Referenced by proxy_client_execute_internal(), proxy_event_new_with_error(), proxy_event_new_with_req(), proxy_event_new_with_rsp_ex(), proxy_process_cas_conn_error(), proxy_process_client_conn_error(), proxy_send_prepared_stmt_to_client(), proxy_socket_io_read(), proxy_wakeup_context_by_shard(), and proxy_wakeup_context_by_statement().
T_PROXY_EVENT* proxy_event_new_with_error | ( | char * | driver_info, |
unsigned int | type, | ||
int | from, | ||
int(*)(char *driver_info, char **buffer, int error_ind, int error_code, const char *error_msg, char is_in_tran) | err_func, | ||
int | error_ind, | ||
int | error_code, | ||
const char * | error_msg, | ||
char | is_in_tran | ||
) |
Definition at line 1780 of file shard_proxy_handler.c.
References NULL, proxy_event_free(), proxy_event_new(), and proxy_event_set_buffer().
Referenced by fn_proxy_cas_prepare(), and proxy_context_send_error().
T_PROXY_EVENT* proxy_event_new_with_req | ( | char * | driver_info, |
unsigned int | type, | ||
int | from, | ||
T_PROXY_EVENT_FUNC | req_func | ||
) |
Definition at line 1723 of file shard_proxy_handler.c.
References NULL, proxy_event_free(), proxy_event_new(), and proxy_event_set_buffer().
Referenced by proxy_event_new_with_rsp(), and proxy_send_request_to_cas_with_new_event().
T_PROXY_EVENT* proxy_event_new_with_rsp | ( | char * | driver_info, |
unsigned int | type, | ||
int | from, | ||
T_PROXY_EVENT_FUNC | resp_func | ||
) |
Definition at line 1748 of file shard_proxy_handler.c.
References proxy_event_new_with_req().
Referenced by fn_proxy_cas_check_cas(), fn_proxy_client_check_cas(), fn_proxy_client_set_db_parameter(), proxy_process_client_register(), proxy_send_response_to_client_with_new_event(), and proxy_socket_io_new_client().
T_PROXY_EVENT* proxy_event_new_with_rsp_ex | ( | char * | driver_info, |
unsigned int | type, | ||
int | from, | ||
T_PROXY_EVENT_FUNC_EX | resp_func, | ||
void * | argv | ||
) |
Definition at line 1754 of file shard_proxy_handler.c.
References NULL, proxy_event_free(), proxy_event_new(), and proxy_event_set_buffer().
Referenced by fn_proxy_client_get_db_parameter().
int proxy_event_realloc_buffer | ( | T_PROXY_EVENT * | event_p, |
unsigned int | size | ||
) |
Definition at line 1820 of file shard_proxy_handler.c.
References assert, t_proxy_event::buffer, t_io_buffer::data, t_io_buffer::length, and NULL.
Referenced by proxy_socket_io_read_internal().
void proxy_event_set_buffer | ( | T_PROXY_EVENT * | event_p, |
char * | data, | ||
unsigned int | size | ||
) |
Definition at line 1843 of file shard_proxy_handler.c.
References assert, t_proxy_event::buffer, t_io_buffer::data, t_io_buffer::length, NULL, and t_io_buffer::offset.
Referenced by proxy_client_execute_internal(), proxy_event_new_with_error(), proxy_event_new_with_req(), proxy_event_new_with_rsp_ex(), and proxy_send_prepared_stmt_to_client().
void proxy_event_set_context | ( | T_PROXY_EVENT * | event_p, |
int | cid, | ||
unsigned int | uid | ||
) |
Definition at line 1865 of file shard_proxy_handler.c.
References assert, t_proxy_event::cid, and t_proxy_event::uid.
Referenced by proxy_process_cas_conn_error(), proxy_process_cas_response(), proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_wakeup_context_by_shard(), and proxy_wakeup_context_by_statement().
void proxy_event_set_shard | ( | T_PROXY_EVENT * | event_p, |
int | shard_id, | ||
int | cas_id | ||
) |
Definition at line 1877 of file shard_proxy_handler.c.
References assert, t_proxy_event::cas_id, and t_proxy_event::shard_id.
Referenced by proxy_wakeup_context_by_shard().
void proxy_event_set_type_from | ( | T_PROXY_EVENT * | event_p, |
unsigned int | type, | ||
int | from_cas | ||
) |
Definition at line 1854 of file shard_proxy_handler.c.
References assert, t_proxy_event::from_cas, and t_proxy_event::type.
Referenced by proxy_process_cas_response(), and proxy_process_client_request().
void proxy_handler_destroy | ( | void | ) |
Definition at line 1498 of file shard_proxy_handler.c.
References t_proxy_handler::cas_rcv_q, t_proxy_handler::cli_rcv_q, t_proxy_handler::cli_ret_q, proxy_context_destroy(), and shard_queue_destroy().
Referenced by proxy_handler_initialize(), and proxy_term().
int proxy_handler_initialize | ( | void | ) |
Definition at line 1507 of file shard_proxy_handler.c.
References t_proxy_handler::cas_rcv_q, t_proxy_handler::cli_rcv_q, t_proxy_handler::cli_ret_q, error(), proxy_context_initialize(), proxy_handler_destroy(), and shard_queue_initialize().
Referenced by main().
bool proxy_handler_is_cas_in_tran | ( | int | shard_id, |
int | cas_id | ||
) |
Definition at line 256 of file shard_proxy_handler.c.
References as_info, assert, t_appl_server_info::cas_change_mode, CAS_CHANGE_MODE_KEEP, t_appl_server_info::con_status, CON_STATUS_IN_TRAN, NULL, t_appl_server_info::num_holdable_results, and shard_shm_get_as_info().
Referenced by fn_proxy_cas_fetch(), fn_proxy_cas_prepare_and_execute(), proxy_cas_execute_internal(), and proxy_handler_process_cas_response().
void proxy_handler_process | ( | void | ) |
Definition at line 1551 of file shard_proxy_handler.c.
References t_proxy_handler::cas_rcv_q, t_proxy_handler::cli_rcv_q, t_proxy_handler::cli_ret_q, NULL, proxy_Handler, proxy_handler_process_cas_event(), proxy_handler_process_client_event(), and shard_queue_dequeue().
Referenced by main().
|
static |
Definition at line 527 of file shard_proxy_handler.c.
References assert, CAS_FC_CHECK_CAS, CAS_FC_EXECUTE, CAS_FC_PREPARE, CAS_FC_PREPARE_AND_EXECUTE, t_proxy_event::cid, t_proxy_handler::cli_ret_q, ENTER_FUNC, error(), EXIT_FUNC, t_proxy_event::from_cas, t_proxy_context::func_code, t_proxy_context::is_cas_in_tran, t_proxy_context::is_in_tran, NULL, proxy_context_find(), proxy_context_free(), proxy_context_free_shard(), proxy_context_set_out_tran(), PROXY_DEBUG_LOG, proxy_event_free(), PROXY_EVENT_FROM_CAS, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_context(), proxy_str_event(), shard_queue_enqueue(), t_proxy_event::uid, and t_proxy_context::waiting_event.
Referenced by proxy_handler_process_cas_event().
|
static |
Definition at line 480 of file shard_proxy_handler.c.
References assert, t_proxy_event::cid, ENTER_FUNC, EXIT_FUNC, t_proxy_context::free_context, t_proxy_context::func_code, t_proxy_context::is_in_tran, NULL, proxy_context_find(), proxy_event_free(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_event(), t_proxy_event::uid, t_proxy_context::wait_timeout, and t_proxy_info::wait_timeout.
Referenced by proxy_handler_process_cas_response().
|
static |
Definition at line 597 of file shard_proxy_handler.c.
References assert, ENTER_FUNC, EXIT_FUNC, PROXY_EVENT_CAS_CONN_ERROR, PROXY_EVENT_CAS_RESPONSE, proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_response(), and t_proxy_event::type.
Referenced by proxy_handler_process().
|
static |
Definition at line 375 of file shard_proxy_handler.c.
References assert, t_proxy_event::buffer, CAS_FC_MAX, t_proxy_context::cas_id, t_proxy_event::cid, t_proxy_context::cid, t_proxy_context::client_id, t_io_buffer::data, t_proxy_context::dont_free_statement, ENTER_FUNC, error(), EXIT_FUNC, t_proxy_context::free_context, t_proxy_event::from_cas, t_proxy_context::func_code, t_proxy_context::is_cas_in_tran, t_proxy_context::is_in_tran, NO_ERROR, NULL, t_proxy_context::prepared_stmt, proxy_cas_fn_table, proxy_cas_release_by_ctx(), proxy_check_cas_error(), proxy_context_find(), proxy_context_free(), proxy_context_free_stmt(), proxy_context_set_out_tran(), PROXY_DEBUG_LOG, proxy_event_free(), PROXY_EVENT_FROM_CAS, proxy_handler_is_cas_in_tran(), proxy_handler_process_cas_error(), PROXY_INVALID_FUNC_CODE, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_context(), proxy_str_event(), t_proxy_context::shard_id, shard_shm_get_client_info(), shard_shm_set_client_info_response(), SHARD_STMT_INVALID_HANDLE_ID, t_proxy_context::stmt_h_id, t_proxy_event::uid, t_proxy_context::uid, t_proxy_context::wait_timeout, and t_proxy_info::wait_timeout.
Referenced by proxy_handler_process_cas_event().
|
static |
Definition at line 749 of file shard_proxy_handler.c.
References assert, t_proxy_event::cid, ENTER_FUNC, error(), EXIT_FUNC, fn_proxy_client_conn_error(), t_proxy_context::free_context, t_proxy_event::from_cas, NULL, proxy_context_find(), proxy_context_free(), proxy_event_free(), PROXY_EVENT_FROM_CLIENT, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_event(), and t_proxy_event::uid.
Referenced by proxy_handler_process_client_event().
|
static |
Definition at line 878 of file shard_proxy_handler.c.
References assert, ENTER_FUNC, EXIT_FUNC, PROXY_EVENT_CLIENT_CONN_ERROR, PROXY_EVENT_CLIENT_REQUEST, PROXY_EVENT_CLIENT_WAKEUP_BY_SHARD, PROXY_EVENT_CLIENT_WAKEUP_BY_STATEMENT, proxy_handler_process_client_conn_error(), proxy_handler_process_client_request(), proxy_handler_process_client_wakeup_by_shard(), proxy_handler_process_client_wakeup_by_statement(), and t_proxy_event::type.
Referenced by proxy_handler_process().
|
static |
Definition at line 623 of file shard_proxy_handler.c.
References argc, argv, assert, t_proxy_event::buffer, CAS_FC_CURSOR_CLOSE, CAS_FC_CURSOR_CLOSE_FOR_PROTO_V2, CAS_FC_MAX, CAS_FC_PREPARE_AND_EXECUTE, CAS_FC_PREPARE_AND_EXECUTE_FOR_PROTO_V2, CAS_MAKE_PROTO_VER, t_proxy_event::cid, t_proxy_context::client_id, t_io_buffer::data, DOES_CLIENT_MATCH_THE_PROTOCOL, ENTER_FUNC, ER_FAILED, error(), t_proxy_context::error_ind, EXIT_FUNC, t_proxy_context::free_context, FREE_MEM, t_proxy_event::from_cas, get_data_length(), MSG_HEADER_SIZE, net_decode_str(), NO_ERROR, NULL, PROTOCOL_V2, proxy_client_fn_table, proxy_context_clear_error(), proxy_context_find(), proxy_context_free(), proxy_context_send_error(), proxy_event_free(), PROXY_EVENT_FROM_CLIENT, proxy_get_driver_info_by_ctx(), PROXY_LOG, PROXY_LOG_MODE_DEBUG, PROXY_LOG_MODE_ERROR, proxy_str_context(), proxy_str_event(), proxy_unset_force_out_tran(), shard_shm_get_client_info(), shard_shm_init_client_info_request(), shard_shm_set_client_info_request(), and t_proxy_event::uid.
Referenced by proxy_handler_process_client_event(), proxy_handler_process_client_wakeup_by_shard(), and proxy_handler_process_client_wakeup_by_statement().
|
static |
Definition at line 788 of file shard_proxy_handler.c.
References assert, t_proxy_event::cas_id, CAS_MAKE_PROTO_VER, t_proxy_event::cid, t_proxy_context::cid, t_proxy_context::client_id, t_client_info::client_ip, t_client_info::driver_info, ENTER_FUNC, EXIT_FUNC, t_proxy_event::from_cas, NULL, proxy_context_find(), proxy_context_set_in_tran(), proxy_event_free(), PROXY_EVENT_FROM_CLIENT, proxy_handler_process_client_request(), PROXY_LOG, PROXY_LOG_MODE_ERROR, t_proxy_event::shard_id, shard_shm_get_client_info(), shard_shm_set_as_client_info(), t_proxy_event::uid, t_proxy_context::uid, and t_proxy_context::waiting_event.
Referenced by proxy_handler_process_client_event().
|
static |
Definition at line 845 of file shard_proxy_handler.c.
References assert, t_proxy_event::cid, ENTER_FUNC, EXIT_FUNC, t_proxy_event::from_cas, NULL, proxy_context_find(), proxy_event_free(), PROXY_EVENT_FROM_CLIENT, proxy_handler_process_client_request(), t_proxy_event::uid, and t_proxy_context::waiting_event.
Referenced by proxy_handler_process_client_event().
char* proxy_str_context | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 1079 of file shard_proxy_handler.c.
References t_proxy_context::cas_id, t_proxy_context::cid, t_proxy_context::client_id, t_proxy_context::error_code, t_proxy_context::error_ind, t_proxy_context::error_msg, t_proxy_context::free_context, t_proxy_context::free_on_client_io_write, t_proxy_context::free_on_end_tran, t_proxy_context::func_code, t_proxy_context::is_busy, t_proxy_context::is_cas_in_tran, t_proxy_context::is_client_in_tran, t_proxy_context::is_in_tran, t_proxy_context::is_prepare_for_execute, NULL, proxy_str_event(), t_proxy_context::shard_id, t_proxy_context::stmt_h_id, t_proxy_context::stmt_hint_type, t_proxy_context::uid, t_proxy_context::wait_timeout, and t_proxy_context::waiting_event.
Referenced by fn_proxy_cas_check_cas(), fn_proxy_cas_end_tran(), fn_proxy_cas_fetch(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_relay_only(), fn_proxy_cas_schema_info(), fn_proxy_client_check_cas(), fn_proxy_client_close_req_handle(), fn_proxy_client_cursor(), fn_proxy_client_cursor_close(), fn_proxy_client_end_tran(), fn_proxy_client_get_db_parameter(), fn_proxy_client_get_db_version(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), fn_proxy_client_schema_info(), fn_proxy_client_set_db_parameter(), proxy_cas_execute_internal(), proxy_client_execute_internal(), proxy_context_add_stmt(), proxy_context_free_client(), proxy_context_free_stmt(), proxy_context_new(), proxy_context_send_error(), proxy_context_timeout(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_response(), proxy_handler_process_client_request(), proxy_process_cas_conn_error(), proxy_process_cas_response(), proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_send_prepared_stmt_to_client(), proxy_send_request_to_cas_with_new_event(), and proxy_send_response_to_client_with_new_event().
char* proxy_str_event | ( | T_PROXY_EVENT * | event_p | ) |
Definition at line 1919 of file shard_proxy_handler.c.
References t_proxy_event::cas_id, t_proxy_event::cid, t_proxy_event::from_cas, NULL, t_proxy_event::shard_id, t_proxy_event::type, and t_proxy_event::uid.
Referenced by fn_proxy_cas_check_cas(), fn_proxy_cas_end_tran(), fn_proxy_cas_fetch(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_relay_only(), fn_proxy_cas_schema_info(), fn_proxy_client_check_cas(), fn_proxy_client_cursor(), fn_proxy_client_end_tran(), fn_proxy_client_get_db_parameter(), fn_proxy_client_schema_info(), fn_proxy_client_set_db_parameter(), proxy_cas_execute_internal(), proxy_cas_io_write(), proxy_client_io_write(), proxy_context_send_error(), proxy_handler_process_cas_conn_error(), proxy_handler_process_cas_error(), proxy_handler_process_cas_response(), proxy_handler_process_client_conn_error(), proxy_handler_process_client_request(), proxy_process_cas_conn_error(), proxy_process_cas_response(), proxy_process_client_conn_error(), proxy_process_client_register(), proxy_process_client_request(), proxy_send_prepared_stmt_to_client(), proxy_send_request_to_cas(), proxy_send_request_to_cas_with_new_event(), proxy_send_response_to_client(), proxy_send_response_to_client_with_new_event(), proxy_socket_io_new_client(), and proxy_str_context().
void proxy_timer_process | ( | void | ) |
Definition at line 1935 of file shard_proxy_handler.c.
References NULL, proxy_available_cas_wait_timer(), PROXY_MAX_IGNORE_TIMER_CHECK, PROXY_TIMER_CHECK_INTERVAL, and shard_statement_wait_timer().
Referenced by main().
Definition at line 245 of file shard_proxy_handler.c.
References t_wait_context::expire_time.
Referenced by fn_proxy_client_prepare(), and proxy_client_add_waiter_by_shard().
void proxy_waiter_free | ( | T_WAIT_CONTEXT * | waiter | ) |
Definition at line 191 of file shard_proxy_handler.c.
References assert, and FREE_MEM.
Referenced by fn_proxy_client_prepare(), and proxy_waiter_timeout().
T_WAIT_CONTEXT* proxy_waiter_new | ( | int | ctx_cid, |
unsigned int | ctx_uid, | ||
int | timeout | ||
) |
Definition at line 169 of file shard_proxy_handler.c.
References t_wait_context::ctx_cid, t_wait_context::ctx_uid, t_wait_context::expire_time, and NULL.
Referenced by fn_proxy_client_prepare(), and proxy_client_add_waiter_by_shard().
void proxy_waiter_timeout | ( | T_SHARD_QUEUE * | waitq, |
INT64 * | counter, | ||
int | now | ||
) |
Definition at line 199 of file shard_proxy_handler.c.
References assert, t_wait_context::ctx_cid, t_wait_context::ctx_uid, t_wait_context::expire_time, NULL, proxy_context_find(), proxy_context_timeout(), PROXY_DEBUG_LOG, proxy_waiter_free(), shard_queue_dequeue(), and shard_queue_peek_value().
Referenced by proxy_available_cas_wait_timer(), and shard_statement_wait_timer().
int proxy_wakeup_context_by_shard | ( | T_WAIT_CONTEXT * | waiter_p, |
int | shard_id, | ||
int | cas_id | ||
) |
Definition at line 1580 of file shard_proxy_handler.c.
References assert, t_cas_io::cas_id, t_proxy_context::cid, t_proxy_handler::cli_ret_q, t_proxy_context::client_id, t_wait_context::ctx_cid, t_wait_context::ctx_uid, error(), t_proxy_context::func_code, NULL, proxy_cas_alloc_by_ctx(), proxy_context_find(), proxy_context_free(), proxy_context_set_in_tran(), PROXY_DEBUG_LOG, PROXY_EVENT_CLIENT_WAKEUP_BY_SHARD, proxy_event_free(), PROXY_EVENT_FROM_CLIENT, proxy_event_new(), proxy_event_set_context(), proxy_event_set_shard(), PROXY_LOG, PROXY_LOG_MODE_ERROR, t_cas_io::shard_id, shard_queue_enqueue(), SHARD_TEMPORARY_UNAVAILABLE, t_proxy_context::uid, and t_proxy_context::wait_timeout.
Referenced by proxy_client_check_waiter_and_wakeup().
int proxy_wakeup_context_by_statement | ( | T_WAIT_CONTEXT * | waiter_p | ) |
Definition at line 1650 of file shard_proxy_handler.c.
References assert, t_proxy_handler::cli_ret_q, t_wait_context::ctx_cid, t_wait_context::ctx_uid, error(), NULL, PROXY_DEBUG_LOG, PROXY_EVENT_CLIENT_WAKEUP_BY_STATEMENT, PROXY_EVENT_FROM_CLIENT, proxy_event_new(), proxy_event_set_context(), and shard_queue_enqueue().
Referenced by shard_stmt_check_waiter_and_wakeup().
char* shard_str_sqls | ( | char * | sql | ) |
Definition at line 1964 of file shard_proxy_handler.c.
Referenced by fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), and shard_str_stmt().
SP_PARSER_CTX* parser = NULL |
Definition at line 52 of file shard_proxy_handler.c.
Referenced by add_access_spec(), add_after_join_predicate(), add_if_predicate(), add_sort_spec(), build_graph_for_entity(), chksum_start(), db_close_session_local(), db_compile_statement_local(), db_execute_and_keep_statement_local(), db_get_input_markers(), db_get_output_markers(), db_get_start_line(), db_get_statement_type(), db_number_of_input_markers(), db_number_of_output_markers(), db_push_values(), object_printer::describe_class(), do_alter_index_rebuild(), do_check_internal_statements(), do_execute_statement(), emit_query_specs(), emit_query_specs_has_using_index(), gen_outer(), get_local_subqueries(), grok_classes(), init_class_scan_proc(), make_mergelist_proc(), make_namelist_from_projected_segs(), make_pred_from_bitset(), make_sort_limit_proc(), mq_fetch_subqueries(), mq_get_expression(), mq_is_updatable_attribute(), mq_is_updatable_local(), mq_virtual_queries(), cubload::driver::parse(), parser_create_parser(), parser_walk_leaves(), preserve_info(), pt_append_bytes(), pt_init_assignments_helper(), pt_init_one_statement_parser(), pt_internal_error(), pt_negate_expr(), pt_reset_error(), pt_semantic_check_local(), pt_string_to_db_domain(), pt_walk_private(), qo_add_hq_iterations_access_spec(), qo_analyze_path_join(), qo_analyze_term(), qo_check_iscan_for_multi_range_opt(), qo_env_new(), qo_optimize_helper(), qo_plan_compute_iscan_sort_list(), qo_plan_is_orderby_skip_candidate(), qo_scan_fprint(), qo_scan_info(), qo_term_dump(), qo_term_string(), qo_top_plan_new(), and uci_static().
|
static |
Definition at line 121 of file shard_proxy_handler.c.
Referenced by proxy_handler_process_cas_response().
|
static |
Definition at line 74 of file shard_proxy_handler.c.
Referenced by proxy_handler_process_client_request().
T_PROXY_CONTEXT_GLOBAL proxy_Context |
Definition at line 55 of file shard_proxy_handler.c.
T_PROXY_HANDLER proxy_Handler |
Definition at line 54 of file shard_proxy_handler.c.
Referenced by proxy_handler_process().
T_PROXY_INFO* proxy_info_p |
Definition at line 48 of file shard_proxy.c.
T_SHM_APPL_SERVER* shm_as_p |
Definition at line 43 of file shard_proxy.c.
T_SHM_PROXY* shm_proxy_p |
Definition at line 109 of file broker_admin_pub.c.