CUBRID Engine
latest
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <math.h>
#include <pthread.h>
#include <unistd.h>
#include "cubrid_getopt.h"
#include "cas_common.h"
#include "porting.h"
#include "cas_cci.h"
#include "broker_log_util.h"
Go to the source code of this file.
Classes | |
struct | t_bind_info |
struct | t_node_info |
Macros | |
#define | PRINT_CCI_ERROR(ERRCODE, CCI_ERROR, result_fp) |
#define | FREE_BIND_INFO(NUM_BIND, BIND_INFO) |
#define | MAX_NODE_INFO 100 |
#define | MAX_IGN_SRV_ERR 100 |
#define | THREAD_FUNC void* |
#define | SLEEP_SEC(X) sleep(X) |
#define | SLEEP_MILISEC(sec, msec) |
#define | STRDUP(TARGET, SOURCE) |
#define | SERVER_HANDLE_ALLOC_SIZE (MAX_SERVER_H_ID + 1) |
Typedefs | |
typedef struct t_bind_info | T_BIND_INFO |
typedef struct t_node_info | T_NODE_INFO |
Functions | |
static double | calc_stddev (double *t, double avg, int count) |
static double | calc_avg (double *t, int count) |
static void | calc_min_max (double *t, int count, double *min, double *max) |
static int | get_args (int argc, char *argv[]) |
static int | read_conf (void) |
static void | cas_runner (FILE *fp, FILE *result_fp, double *ret_exec_time, double *ret_prepare_time) |
static THREAD_FUNC | thr_main (void *arg) |
static int | process_execute (char *msg, int *req_h, int num_bind, T_BIND_INFO *bind_info, FILE *result_fp, double *sum_execute_time) |
static int | process_bind (char *msg, int *num_bind_p, T_BIND_INFO *bind_info) |
static int | process_endtran (int con_h, int *req_h, FILE *result_fp) |
static int | process_close_req (char *linebuf, int *req_h, FILE *result_fp) |
static void | print_result (int cci_res, int req_id, FILE *fp) |
static void | free_node (T_NODE_INFO *node) |
static int | make_node_info (T_NODE_INFO *node, char *node_name, char *info_str) |
static int | set_args_with_node_info (char *node_name) |
static int | ignore_error (int code) |
static char * | make_sql_stmt (char *src) |
int | main (int argc, char *argv[]) |
Variables | |
const char * | cci_client_name = "JDBC" |
static char * | broker_host = NULL |
static int | broker_port = 0 |
static char * | dbname = NULL |
static char * | dbuser = NULL |
static char * | dbpasswd = NULL |
static int | num_thread = 1 |
static int | repeat_count = 1 |
static char * | exec_script_file |
static int | batch_mode = 0 |
static char * | result_file = NULL |
static char * | cas_err_file = NULL |
static int | fork_delay = 0 |
static char * | node_name = NULL |
static int | think_time = 0 |
static int | qa_test_flag = 0 |
static int | num_replica = 1 |
static int | dump_query_plan = 0 |
static int | autocommit_mode = 0 |
static int | statdump_mode = 0 |
static double * | run_time_exec |
static FILE * | cas_error_fp |
static int | cas_error_flag = 0 |
static int | cubrid_manager_run = 0 |
static T_NODE_INFO | node_table [MAX_NODE_INFO] |
static int | num_node = 0 |
static int | ign_srv_err_list [MAX_IGN_SRV_ERR] |
static int | num_ign_srv_err = 0 |
#define FREE_BIND_INFO | ( | NUM_BIND, | |
BIND_INFO | |||
) |
Definition at line 82 of file cas_runner.c.
Referenced by cas_runner().
#define MAX_IGN_SRV_ERR 100 |
Definition at line 92 of file cas_runner.c.
Referenced by read_conf().
#define MAX_NODE_INFO 100 |
Definition at line 91 of file cas_runner.c.
Referenced by read_conf().
#define PRINT_CCI_ERROR | ( | ERRCODE, | |
CCI_ERROR, | |||
result_fp | |||
) |
Definition at line 48 of file cas_runner.c.
Referenced by cas_runner(), print_result(), process_close_req(), process_endtran(), and process_execute().
#define SERVER_HANDLE_ALLOC_SIZE (MAX_SERVER_H_ID + 1) |
Definition at line 120 of file cas_runner.c.
Referenced by cas_runner(), process_close_req(), process_endtran(), and process_execute().
#define SLEEP_MILISEC | ( | sec, | |
msec | |||
) |
Definition at line 105 of file cas_runner.c.
#define SLEEP_SEC | ( | X | ) | sleep(X) |
Definition at line 104 of file cas_runner.c.
Referenced by main(), and thr_main().
#define STRDUP | ( | TARGET, | |
SOURCE | |||
) |
Definition at line 114 of file cas_runner.c.
Referenced by get_args(), and read_conf().
#define THREAD_FUNC void* |
Definition at line 103 of file cas_runner.c.
Referenced by get_args().
typedef struct t_bind_info T_BIND_INFO |
Definition at line 122 of file cas_runner.c.
typedef struct t_node_info T_NODE_INFO |
Definition at line 130 of file cas_runner.c.
|
static |
Definition at line 454 of file cas_runner.c.
References cubregex::count(), and i.
Referenced by main().
|
static |
Definition at line 433 of file cas_runner.c.
References cubregex::count(), and i.
Referenced by main().
|
static |
Definition at line 466 of file cas_runner.c.
References cubregex::count(), and i.
Referenced by main().
|
static |
Definition at line 643 of file cas_runner.c.
References autocommit_mode, broker_host, broker_port, cas_error_fp, dbname, dbpasswd, dbuser, error(), FREE_BIND_INFO, FREE_MEM, i, make_sql_stmt(), MAX_BIND_VALUE, NULL, PRINT_CCI_ERROR, process_bind(), process_close_req(), process_endtran(), process_execute(), SERVER_HANDLE_ALLOC_SIZE, statdump_mode, strlen, t_string_free(), t_string_len(), t_string_make(), t_string_str(), ut_diff_time(), and ut_get_line().
Referenced by thr_main().
|
static |
Definition at line 1444 of file cas_runner.c.
References t_node_info::dbname, t_node_info::dbpasswd, t_node_info::dbuser, FREE_MEM, t_node_info::ip, and t_node_info::node_name.
Referenced by lockfree::freelist< T >::alloc_list(), delete_node(), make_node_info(), and pt_check_drop().
|
static |
Definition at line 479 of file cas_runner.c.
References autocommit_mode, batch_mode, broker_host, broker_port, cas_err_file, dbname, dbpasswd, dbuser, dump_query_plan, exec_script_file, fork_delay, getopt(), node_name, NULL, num_replica, num_thread, optarg, optind, qa_test_flag, repeat_count, result_file, statdump_mode, STRDUP, strlen, think_time, and THREAD_FUNC.
Referenced by main().
|
static |
Definition at line 1485 of file cas_runner.c.
References i, ign_srv_err_list, and num_ign_srv_err.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 193 of file cas_runner.c.
References batch_mode, broker_host, broker_port, calc_avg(), calc_min_max(), calc_stddev(), cas_err_file, cas_error_flag, cas_error_fp, cubrid_manager_run, dbname, dbpasswd, dbuser, fork_delay, FREE_MEM, get_args(), i, max, min, node_name, NULL, num_replica, num_thread, qa_test_flag, read_conf(), repeat_count, result_file, run_time_exec, set_args_with_node_info(), SLEEP_SEC, and thr_main().
|
static |
Definition at line 1389 of file cas_runner.c.
References t_node_info::dbname, t_node_info::dbpasswd, t_node_info::dbuser, err, FREE_MEM, free_node(), i, t_node_info::ip, t_node_info::node_name, NULL, p, t_node_info::port, strdup(), and trim().
Referenced by read_conf().
|
static |
Definition at line 1497 of file cas_runner.c.
References cubrid_manager_run, FREE_MEM, i, NULL, num_replica, p, strlen, and trim().
Referenced by cas_runner().
|
static |
Definition at line 1292 of file cas_runner.c.
References cas_error_fp, dump_query_plan, i, NULL, and PRINT_CCI_ERROR.
Referenced by process_execute().
|
static |
Definition at line 1089 of file cas_runner.c.
References t_bind_info::len, MAX_BIND_VALUE, NULL, p, strdup(), t_bind_info::type, and t_bind_info::value.
Referenced by cas_runner().
|
static |
Definition at line 1231 of file cas_runner.c.
References cas_error_fp, NULL, PRINT_CCI_ERROR, and SERVER_HANDLE_ALLOC_SIZE.
Referenced by cas_runner().
|
static |
Definition at line 1256 of file cas_runner.c.
References autocommit_mode, cas_error_fp, i, NULL, PRINT_CCI_ERROR, SERVER_HANDLE_ALLOC_SIZE, and ut_diff_time().
Referenced by cas_runner().
|
static |
Definition at line 1138 of file cas_runner.c.
References batch_mode, cas_error_fp, cubrid_manager_run, dump_query_plan, i, t_bind_info::len, NULL, num_replica, PRINT_CCI_ERROR, print_result(), SERVER_HANDLE_ALLOC_SIZE, t_bind_info::type, ut_diff_time(), and t_bind_info::value.
Referenced by cas_runner().
|
static |
Definition at line 964 of file cas_runner.c.
References broker_host, broker_port, cas_err_file, CAS_RUNNER_CONF, CAS_RUNNER_CONF_ENV, dbname, dbpasswd, dbuser, error(), fork_delay, ign_srv_err_list, make_node_info(), MAX_IGN_SRV_ERR, MAX_NODE_INFO, NULL, num_ign_srv_err, num_node, num_thread, p, repeat_count, result_file, STRDUP, and strdup().
Referenced by main().
|
static |
Definition at line 1454 of file cas_runner.c.
References broker_host, broker_port, t_node_info::dbname, dbname, t_node_info::dbpasswd, dbpasswd, t_node_info::dbuser, dbuser, i, t_node_info::ip, NULL, num_node, and t_node_info::port.
Referenced by main().
|
static |
Definition at line 579 of file cas_runner.c.
References cas_runner(), exec_script_file, i, NULL, p, repeat_count, result_file, run_time_exec, SLEEP_SEC, and think_time.
Referenced by log_top_query(), and main().
|
static |
Definition at line 179 of file cas_runner.c.
Referenced by cas_runner(), get_args(), and process_endtran().
|
static |
Definition at line 170 of file cas_runner.c.
Referenced by get_args(), main(), and process_execute().
|
static |
Definition at line 162 of file cas_runner.c.
Referenced by cas_runner(), get_args(), main(), read_conf(), and set_args_with_node_info().
|
static |
Definition at line 163 of file cas_runner.c.
Referenced by cas_runner(), get_args(), main(), read_conf(), and set_args_with_node_info().
|
static |
Definition at line 172 of file cas_runner.c.
Referenced by get_args(), main(), and read_conf().
|
static |
Definition at line 184 of file cas_runner.c.
Referenced by main().
|
static |
Definition at line 183 of file cas_runner.c.
Referenced by cas_runner(), main(), print_result(), process_close_req(), process_endtran(), and process_execute().
const char* cci_client_name = "JDBC" |
Definition at line 160 of file cas_runner.c.
|
static |
Definition at line 185 of file cas_runner.c.
Referenced by main(), make_sql_stmt(), and process_execute().
|
static |
Definition at line 164 of file cas_runner.c.
Referenced by cas_runner(), get_args(), main(), read_conf(), and set_args_with_node_info().
|
static |
Definition at line 166 of file cas_runner.c.
Referenced by cas_runner(), get_args(), main(), read_conf(), and set_args_with_node_info().
|
static |
Definition at line 165 of file cas_runner.c.
Referenced by cas_runner(), get_args(), main(), read_conf(), and set_args_with_node_info().
|
static |
Definition at line 178 of file cas_runner.c.
Referenced by get_args(), print_result(), and process_execute().
|
static |
Definition at line 169 of file cas_runner.c.
Referenced by get_args(), and thr_main().
|
static |
Definition at line 173 of file cas_runner.c.
Referenced by get_args(), main(), and read_conf().
|
static |
Definition at line 189 of file cas_runner.c.
Referenced by ignore_error(), and read_conf().
|
static |
Definition at line 174 of file cas_runner.c.
Referenced by check_ha_db_and_node_list(), get_args(), hb_reload_config(), main(), process_heartbeat_replication(), process_heartbeat_util(), qo_validate_index_term_notnull(), us_hb_applylogdb_stop(), and util_free_ha_conf().
|
static |
Definition at line 187 of file cas_runner.c.
|
static |
Definition at line 190 of file cas_runner.c.
Referenced by ignore_error(), and read_conf().
|
static |
Definition at line 188 of file cas_runner.c.
Referenced by read_conf(), and set_args_with_node_info().
|
static |
Definition at line 177 of file cas_runner.c.
Referenced by get_args(), main(), make_sql_stmt(), and process_execute().
|
static |
Definition at line 167 of file cas_runner.c.
Referenced by get_args(), log_top_query(), main(), and read_conf().
|
static |
Definition at line 176 of file cas_runner.c.
Referenced by get_args(), and main().
|
static |
Definition at line 168 of file cas_runner.c.
Referenced by get_args(), main(), read_conf(), and thr_main().
|
static |
Definition at line 171 of file cas_runner.c.
Referenced by get_args(), main(), read_conf(), and thr_main().
|
static |
Definition at line 182 of file cas_runner.c.
Referenced by main(), and thr_main().
|
static |
Definition at line 180 of file cas_runner.c.
Referenced by cas_runner(), and get_args().
|
static |
Definition at line 175 of file cas_runner.c.
Referenced by get_args(), and thr_main().