CUBRID Engine  latest
broker_config.h File Reference
#include "config.h"
#include "cas_protocol.h"
#include "environment_variable.h"
#include "porting.h"
Include dependency graph for broker_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  t_broker_info
 

Macros

#define APPL_SERVER_CAS   0
 
#define APPL_SERVER_CAS_ORACLE   1
 
#define APPL_SERVER_CAS_MYSQL51   2
 
#define APPL_SERVER_CAS_MYSQL   3
 
#define IS_APPL_SERVER_TYPE_CAS(x)
 
#define IS_NOT_APPL_SERVER_TYPE_CAS(x)   !IS_APPL_SERVER_TYPE_CAS(x)
 
#define APPL_SERVER_CAS_TYPE_NAME   "CAS"
 
#define APPL_SERVER_CAS_ORACLE_TYPE_NAME   "CAS_ORACLE"
 
#define APPL_SERVER_CAS_MYSQL_TYPE_NAME   "CAS_MYSQL"
 
#define APPL_SERVER_CAS_MYSQL51_TYPE_NAME   "CAS_MYSQL51"
 
#define APPL_SERVER_CAS_MYSQL61_TYPE_NAME   "CAS_MYSQL61"
 
#define MAX_BROKER_NUM   50
 
#define CONF_LOG_FILE_LEN   128
 
#define DEFAULT_AS_MIN_NUM   5
 
#define DEFAULT_AS_MAX_NUM   40
 
#define DEFAULT_SERVER_MAX_SIZE   "0"
 
#define DEFAULT_SERVER_HARD_LIMIT   "1G"
 
#define DEFAULT_TIME_TO_KILL   "2min"
 
#define SQL_LOG_TIME_MAX   -1
 
#define CONF_ERR_LOG_NONE   0x00
 
#define CONF_ERR_LOG_LOGFILE   0x01
 
#define CONF_ERR_LOG_BROWSER   0x02
 
#define CONF_ERR_LOG_BOTH   (CONF_ERR_LOG_LOGFILE | CONF_ERR_LOG_BROWSER)
 
#define DEFAULT_SQL_LOG_MAX_SIZE   "10M"
 
#define DEFAULT_LONG_QUERY_TIME   "1min"
 
#define DEFAULT_LONG_TRANSACTION_TIME   "1min"
 
#define DEFAULT_ACCESS_LOG_MAX_SIZE   "10M"
 
#define MAX_SQL_LOG_MAX_SIZE   2097152 /* 2G */
 
#define MAX_ACCESS_LOG_MAX_SIZE   2097152 /* 2G */
 
#define DEFAULT_MAX_NUM_DELAYED_HOSTS_LOOKUP   -1
 
#define BROKER_NAME_LEN   64
 
#define BROKER_LOG_MSG_SIZE   64
 
#define BROKER_PATH_MAX   (PATH_MAX)
 
#define DEFAULT_SHARD_NUM_PROXY   1
 
#define DEFAULT_SHARD_MAX_CLIENTS   256
 
#define DEFAULT_SHARD_PROXY_LOG_MAX_SIZE   "100M"
 
#define MAX_PROXY_LOG_MAX_SIZE   1048576 /* about 1G */
 
#define SHARD_CONN_STAT_SIZE_LIMIT   256
 
#define SHARD_KEY_STAT_SIZE_LIMIT   2
 
#define CLIENT_INFO_SIZE_LIMIT   10000
 
#define SHARD_INFO_SIZE_LIMIT   256
 
#define BROKER_INFO_PATH_MAX   (PATH_MAX)
 
#define BROKER_INFO_NAME_MAX   (BROKER_INFO_PATH_MAX)
 
#define DEFAULT_SSL_MODE   "OFF"
 
#define SHARD_ERR(f, a...)
 
#define SHARD_INF(f, a...)
 

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)
 

Macro Definition Documentation

#define APPL_SERVER_CAS   0
#define APPL_SERVER_CAS_MYSQL51   2
#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_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 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
#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)
Value:
#define APPL_SERVER_CAS
Definition: broker_config.h:34
#define APPL_SERVER_CAS_MYSQL
Definition: broker_config.h:37
#define APPL_SERVER_CAS_ORACLE
Definition: broker_config.h:35
#define APPL_SERVER_CAS_MYSQL51
Definition: broker_config.h:36

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_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_INF (   f,
  a... 
)
#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 Documentation

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.

Definition at line 152 of file broker_config.h.

Definition at line 135 of file broker_config.h.

Definition at line 167 of file broker_config.h.

Definition at line 127 of file broker_config.h.

Definition at line 119 of file broker_config.h.

Enumeration Type Documentation

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.

Enumerator
KEEP_CON_ON 
KEEP_CON_AUTO 
KEEP_CON_DEFAULT 

Definition at line 129 of file broker_config.h.

Enumerator
PROXY_LOG_MODE_NONE 
PROXY_LOG_MODE_ERROR 
PROXY_LOG_MODE_TIMEOUT 
PROXY_LOG_MODE_NOTICE 
PROXY_LOG_MODE_SHARD_DETAIL 
PROXY_LOG_MODE_SCHEDULE_DETAIL 
PROXY_LOG_MODE_DEBUG 
PROXY_LOG_MODE_ALL 
PROXY_LOG_MODE_DEFAULT 

Definition at line 154 of file broker_config.h.

Enumerator
SLOW_LOG_MODE_OFF 
SLOW_LOG_MODE_ON 
SLOW_LOG_MODE_DEFAULT 

Definition at line 121 of file broker_config.h.

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.

Function Documentation

void broker_config_dump ( FILE *  fp,
const T_BROKER_INFO br_info,
int  num_broker,
int  br_shm_id 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function: