Skip to content

File cas_runner.c

FileList > broker > cas_runner.c

Go to the source code of this file

  • #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"

Classes

Type Name
struct t_bind_info
struct t_node_info

Public Types

Type Name
typedef struct t_bind_info T_BIND_INFO
typedef struct t_node_info T_NODE_INFO

Public Attributes

Type Name
const char * cci_client_name = "JDBC"

Public Static Attributes

Type Name
int autocommit_mode = 0
int batch_mode = 0
char * broker_host = [**NULL**](freelistheap_8h.md#define-null)
int broker_port = 0
char * cas_err_file = [**NULL**](freelistheap_8h.md#define-null)
int cas_error_flag = 0
FILE * cas_error_fp
int cubrid_manager_run = 0
char * dbname = [**NULL**](freelistheap_8h.md#define-null)
char * dbpasswd = [**NULL**](freelistheap_8h.md#define-null)
char * dbuser = [**NULL**](freelistheap_8h.md#define-null)
int dump_query_plan = 0
char * exec_script_file
int fork_delay = 0
int ign_srv_err_list
char * node_name = [**NULL**](freelistheap_8h.md#define-null)
T_NODE_INFO node_table
int num_ign_srv_err = 0
int num_node = 0
int num_replica = 1
int num_thread = 1
int qa_test_flag = 0
int repeat_count = 1
char * result_file = [**NULL**](freelistheap_8h.md#define-null)
double * run_time_exec
int statdump_mode = 0
int think_time = 0

Public Functions

Type Name
int main (int argc, char * argv)

Public Static Functions

Type Name
double calc_avg (double * t, int count)
void calc_min_max (double * t, int count, double * min, double * max)
double calc_stddev (double * t, double avg, int count)
void cas_runner (FILE * fp, FILE * result_fp, double * ret_exec_time, double * ret_prepare_time)
void free_node (T_NODE_INFO * node)
int get_args (int argc, char * argv)
int ignore_error (int code)
int make_node_info (T_NODE_INFO * node, char * node_name, char * info_str)
char * make_sql_stmt (char * src)
void print_result (int cci_res, int req_id, FILE * fp)
int process_bind (char * msg, int * num_bind_p, T_BIND_INFO * bind_info, int bind_len)
int process_close_req (char * linebuf, int * req_h, FILE * result_fp)
int process_endtran (int con_h, int * req_h, FILE * result_fp)
int process_execute (char * msg, int * req_h, int num_bind, T_BIND_INFO * bind_info, FILE * result_fp, double * sum_execute_time)
int read_conf (void)
int set_args_with_node_info (char * node_name)
void * thr_main (void * arg)

Macros

Type Name
define FREE_BIND_INFO (NUM_BIND, BIND_INFO) /* multi line expression */
define MAX_IGN_SRV_ERR 100
define MAX_NODE_INFO 100
define PRINT_CCI_ERROR (ERRCODE, CCI_ERROR, result_fp)
define SERVER_HANDLE_ALLOC_SIZE ([**MAX\_SERVER\_H\_ID**](cas__common_8h.md#define-max_server_h_id) + 1)
define SLEEP_MILISEC (sec, msec) /* multi line expression */
define SLEEP_SEC (X) [**sleep**](broker__monitor_8c.md#function-timeout)([**X**](broker__monitor_8c.md#function-timeout))
define STRDUP (TARGET, SOURCE) /* multi line expression */
define THREAD_FUNC [**void**](broker__monitor_8c.md#function-timeout)\*

Public Types Documentation

typedef T_BIND_INFO

typedef struct t_bind_info T_BIND_INFO;

typedef T_NODE_INFO

typedef struct t_node_info T_NODE_INFO;

Public Attributes Documentation

variable cci_client_name

const char* cci_client_name;

Public Static Attributes Documentation

variable autocommit_mode

int autocommit_mode;

variable batch_mode

int batch_mode;

variable broker_host

char* broker_host;

variable broker_port

int broker_port;

variable cas_err_file

char* cas_err_file;

variable cas_error_flag

int cas_error_flag;

variable cas_error_fp

FILE* cas_error_fp;

variable cubrid_manager_run

int cubrid_manager_run;

variable dbname

char* dbname;

variable dbpasswd

char* dbpasswd;

variable dbuser

char* dbuser;

variable dump_query_plan

int dump_query_plan;

variable exec_script_file

char* exec_script_file;

variable fork_delay

int fork_delay;

variable ign_srv_err_list

int ign_srv_err_list[100];

variable node_name

char* node_name;

variable node_table

T_NODE_INFO node_table[100];

variable num_ign_srv_err

int num_ign_srv_err;

variable num_node

int num_node;

variable num_replica

int num_replica;

variable num_thread

int num_thread;

variable qa_test_flag

int qa_test_flag;

variable repeat_count

int repeat_count;

variable result_file

char* result_file;

variable run_time_exec

double* run_time_exec;

variable statdump_mode

int statdump_mode;

variable think_time

int think_time;

Public Functions Documentation

function main

int main (
    int argc,
    char * argv
) 

Public Static Functions Documentation

function calc_avg

static double calc_avg (
    double * t,
    int count
) 

function calc_min_max

static void calc_min_max (
    double * t,
    int count,
    double * min,
    double * max
) 

function calc_stddev

static double calc_stddev (
    double * t,
    double avg,
    int count
) 

function cas_runner

static void cas_runner (
    FILE * fp,
    FILE * result_fp,
    double * ret_exec_time,
    double * ret_prepare_time
) 

function free_node

static void free_node (
    T_NODE_INFO * node
) 

function get_args

static int get_args (
    int argc,
    char * argv
) 

function ignore_error

static int ignore_error (
    int code
) 

function make_node_info

static int make_node_info (
    T_NODE_INFO * node,
    char * node_name,
    char * info_str
) 

function make_sql_stmt

static char * make_sql_stmt (
    char * src
) 

function print_result

static void print_result (
    int cci_res,
    int req_id,
    FILE * fp
) 

function process_bind

static int process_bind (
    char * msg,
    int * num_bind_p,
    T_BIND_INFO * bind_info,
    int bind_len
) 

function process_close_req

static int process_close_req (
    char * linebuf,
    int * req_h,
    FILE * result_fp
) 

function process_endtran

static int process_endtran (
    int con_h,
    int * req_h,
    FILE * result_fp
) 

function process_execute

static int process_execute (
    char * msg,
    int * req_h,
    int num_bind,
    T_BIND_INFO * bind_info,
    FILE * result_fp,
    double * sum_execute_time
) 

function read_conf

static int read_conf (
    void
) 

function set_args_with_node_info

static int set_args_with_node_info (
    char * node_name
) 

function thr_main

static void * thr_main (
    void * arg
) 

Macro Definition Documentation

define FREE_BIND_INFO

#define FREE_BIND_INFO (
    NUM_BIND,
    BIND_INFO
) `/* multi line expression */`

define MAX_IGN_SRV_ERR

#define MAX_IGN_SRV_ERR `100`

define MAX_NODE_INFO

#define MAX_NODE_INFO `100`

define PRINT_CCI_ERROR

#define PRINT_CCI_ERROR (
    ERRCODE,
    CCI_ERROR,
    result_fp
) 

define SERVER_HANDLE_ALLOC_SIZE

#define SERVER_HANDLE_ALLOC_SIZE `( MAX_SERVER_H_ID + 1)`

define SLEEP_MILISEC

#define SLEEP_MILISEC (
    sec,
    msec
) `/* multi line expression */`

define SLEEP_SEC

#define SLEEP_SEC (
    X
) `sleep ( X )`

define STRDUP

#define STRDUP (
    TARGET,
    SOURCE
) `/* multi line expression */`

define THREAD_FUNC

#define THREAD_FUNC `void *`


The documentation for this class was generated from the following file cubrid/src/broker/cas_runner.c