Skip to content

File broker_config.c

FileList > broker > broker_config.c

Go to the source code of this file

  • #include "config.h"
  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include <ctype.h>
  • #include <unistd.h>
  • #include <sys/types.h>
  • #include <sys/stat.h>
  • #include <assert.h>
  • #include "porting.h"
  • #include "cas_common.h"
  • #include "broker_config.h"
  • #include "broker_shm.h"
  • #include "broker_filename.h"
  • #include "broker_util.h"
  • #include "cas_sql_log2.h"
  • #include "shard_shm.h"
  • #include "shard_metadata.h"
  • #include "util_func.h"
  • #include "ini_parser.h"

Classes

Type Name
struct br_conf_info
struct t_conf_table

Public Types

Type Name
typedef struct br_conf_info T_CONF_INFO
typedef struct t_conf_table T_CONF_TABLE
enum broker__config_8c_1a1f9aebf1de3ebbf4283a4dcf73308562

Public Attributes

Type Name
const char * broker_keywords
int broker_keywords_size = [**sizeof**](broker__monitor_8c.md#function-timeout) ([**broker\_keywords**](broker__config_8c.md#variable-broker_keywords)) / [**sizeof**](broker__monitor_8c.md#function-timeout) ([**char**](broker__monitor_8c.md#function-timeout) \*)

Public Static Attributes

Type Name
const char SECTION_NAME = "broker"
T_CONF_INFO br_conf_info
char * conf_file_loaded
char default_conf_file_path
bool is_first_br_conf_read = [**true**](broker__monitor_8c.md#function-timeout)
T_CONF_TABLE tbl_access_mode = /* multi line expression */
T_CONF_TABLE tbl_allow_deny = /* multi line expression */
T_CONF_TABLE tbl_appl_server = /* multi line expression */
const char * tbl_conf_err_msg = /* multi line expression */
T_CONF_TABLE tbl_connect_order = /* multi line expression */
T_CONF_TABLE tbl_keep_connection = /* multi line expression */
T_CONF_TABLE tbl_on_off = /* multi line expression */
T_CONF_TABLE tbl_proxy_log_mode = /* multi line expression */
T_CONF_TABLE tbl_sql_log_mode = /* multi line expression */

Public Functions

Type Name
void broker_config_dump (FILE * fp, const T_BROKER_INFO * br_info, int num_broker, int br_shm_id, char * admin_log_file)
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, bool * acl_default_policy, char * admin_err_msg)
int conf_get_value_access_mode (const char * value)
int conf_get_value_connect_order (const char * value)
int conf_get_value_keep_con (const char * value)
int conf_get_value_proxy_log_mode (const char * value)
int conf_get_value_sql_log_mode (const char * value)
int conf_get_value_table_allow_deny (const char * value)
int conf_get_value_table_on_off (const char * value)
void dir_repath (char * path, size_t path_len)

Public Static Functions

Type Name
int broker_config_read_internal (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, bool * acl_default_policy, char * admin_err_msg)
int check_port_number (T_BROKER_INFO * br_info, int num_brs)
void clear_conf_cache_entry (int cid)
void conf_file_has_been_loaded (const char * conf_path)
const char * get_conf_string (int value, T_CONF_TABLE * conf_table)
int get_conf_value (const char * string, T_CONF_TABLE * conf_table)
bool is_invalid_buf_size (int size)
void read_conf_cache (int cid, bool * acl, bool * acl_default_policy, int * num_br, int * shm_id, char * log_file, T_BROKER_INFO * br_info)
void write_conf_cache (char * file, bool * acl_flag, bool * acl_default_policy, int * num_broker, int * shm_id, char * alog, T_BROKER_INFO * br_info, time_t bf_mtime)

Macros

Type Name
define DEFAULT_ADMIN_LOG_FILE "log/[**broker**](broker__monitor_8c.md#function-timeout)/[**cubrid\_broker.log"**](broker__monitor_8c.md#function-timeout)
define DEFAULT_APPL_SERVER "CAS"
define DEFAULT_CAS_MAX_PREPARED_STMT_COUNT 2000
define DEFAULT_EMPTY_STRING "\0"
define DEFAULT_FILE_UPLOAD_DELIMITER "^^"
define DEFAULT_HANG_TIMEOUT 60
define DEFAULT_JDBC_CACHE_LIFE_TIME 1000
define DEFAULT_JOB_QUEUE_SIZE 1024
define DEFAULT_KEEP_CONNECTION "AUTO"
define DEFAULT_MAX_QUERY_TIMEOUT "0"
define DEFAULT_MONITOR_HANG_INTERVAL 60
define DEFAULT_PROXY_MAX_PREPARED_STMT_COUNT 10000
define DEFAULT_RECONNECT_TIME "600s"
define DEFAULT_SESSION_TIMEOUT "5min"
define DEFAULT_SHARD_KEY_MODULAR 256
define DEFAULT_SHARD_PROXY_CONN_WAIT_TIMEOUT "8h"
define DEFAULT_SHARD_PROXY_LOG_MODE "ERROR"
define DEFAULT_SHARD_PROXY_TIMEOUT "30s"
define DEFAULT_SQL_LOG_MODE "ALL"
define FALSE 0
define INI_GETSTR_CHK (str, ini, sec, key, def, lineno) /* multi line expression */
define IS_FILE_MATCH_CONF_CACHE (cid, file) ([**strcmp**](broker__monitor_8c.md#function-timeout) ([**br\_conf\_info**](structbr__conf__info.md)[cid].conf\_file, file) == 0)
define MAX_NUM_CACHED_BROKER_FILES 4
define MAX_NUM_OF_CONF_FILE_LOADED 5
define PORT_NUM_LIMIT ([**USHRT\_MAX**](broker__monitor_8c.md#function-timeout)) /\* 65535 \*/
define PRINTERROR (...) /* multi line expression */
define TRUE 1

Public Types Documentation

typedef T_CONF_INFO

typedef struct br_conf_info T_CONF_INFO;

typedef T_CONF_TABLE

typedef struct t_conf_table T_CONF_TABLE;

enum broker__config_8c_1a1f9aebf1de3ebbf4283a4dcf73308562

enum broker__config_8c_1a1f9aebf1de3ebbf4283a4dcf73308562 {
    PARAM_NO_ERROR = 0,
    PARAM_INVAL_SEC = 1,
    PARAM_BAD_VALUE = 2,
    PARAM_BAD_RANGE = 3,
    SECTION_NAME_TOO_LONG = 4,
    PARAM_RUN_TIME_ERROR = 5,
    PARAM_BAD_MAX_APPL_SERVER = 6
};

Public Attributes Documentation

variable broker_keywords

const char* broker_keywords[];

variable broker_keywords_size

int broker_keywords_size;

Public Static Attributes Documentation

variable SECTION_NAME

const char SECTION_NAME[];

variable br_conf_info

T_CONF_INFO br_conf_info[4];

variable conf_file_loaded

char* conf_file_loaded[5];

variable default_conf_file_path

char default_conf_file_path[(PATH_MAX)];

variable is_first_br_conf_read

bool is_first_br_conf_read;

variable tbl_access_mode

T_CONF_TABLE tbl_access_mode[];

variable tbl_allow_deny

T_CONF_TABLE tbl_allow_deny[];

variable tbl_appl_server

T_CONF_TABLE tbl_appl_server[];

variable tbl_conf_err_msg

const char* tbl_conf_err_msg[];

variable tbl_connect_order

T_CONF_TABLE tbl_connect_order[];

variable tbl_keep_connection

T_CONF_TABLE tbl_keep_connection[];

variable tbl_on_off

T_CONF_TABLE tbl_on_off[];

variable tbl_proxy_log_mode

T_CONF_TABLE tbl_proxy_log_mode[];

variable tbl_sql_log_mode

T_CONF_TABLE tbl_sql_log_mode[];

Public Functions Documentation

function broker_config_dump

void broker_config_dump (
    FILE * fp,
    const  T_BROKER_INFO * br_info,
    int num_broker,
    int br_shm_id,
    char * admin_log_file
) 

function broker_config_read

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,
    bool * acl_default_policy,
    char * admin_err_msg
) 

function conf_get_value_access_mode

int conf_get_value_access_mode (
    const  char * value
) 

function conf_get_value_connect_order

int conf_get_value_connect_order (
    const  char * value
) 

function conf_get_value_keep_con

int conf_get_value_keep_con (
    const  char * value
) 

function conf_get_value_proxy_log_mode

int conf_get_value_proxy_log_mode (
    const  char * value
) 

function conf_get_value_sql_log_mode

int conf_get_value_sql_log_mode (
    const  char * value
) 

function conf_get_value_table_allow_deny

int conf_get_value_table_allow_deny (
    const  char * value
) 

function conf_get_value_table_on_off

int conf_get_value_table_on_off (
    const  char * value
) 

function dir_repath

void dir_repath (
    char * path,
    size_t path_len
) 

Public Static Functions Documentation

function broker_config_read_internal

static int broker_config_read_internal (
    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,
    bool * acl_default_policy,
    char * admin_err_msg
) 

function check_port_number

static int check_port_number (
    T_BROKER_INFO * br_info,
    int num_brs
) 

function clear_conf_cache_entry

static void clear_conf_cache_entry (
    int cid
) 

function conf_file_has_been_loaded

static void conf_file_has_been_loaded (
    const  char * conf_path
) 

function get_conf_string

static const  char * get_conf_string (
    int value,
    T_CONF_TABLE * conf_table
) 

function get_conf_value

static int get_conf_value (
    const  char * string,
    T_CONF_TABLE * conf_table
) 

function is_invalid_buf_size

static bool is_invalid_buf_size (
    int size
) 

function read_conf_cache

static void read_conf_cache (
    int cid,
    bool * acl,
    bool * acl_default_policy,
    int * num_br,
    int * shm_id,
    char * log_file,
    T_BROKER_INFO * br_info
) 

function write_conf_cache

static void write_conf_cache (
    char * file,
    bool * acl_flag,
    bool * acl_default_policy,
    int * num_broker,
    int * shm_id,
    char * alog,
    T_BROKER_INFO * br_info,
    time_t bf_mtime
) 

Macro Definition Documentation

define DEFAULT_ADMIN_LOG_FILE

#define DEFAULT_ADMIN_LOG_FILE `"log/ broker / cubrid_broker.log"`

define DEFAULT_APPL_SERVER

#define DEFAULT_APPL_SERVER `"CAS"`

define DEFAULT_CAS_MAX_PREPARED_STMT_COUNT

#define DEFAULT_CAS_MAX_PREPARED_STMT_COUNT `2000`

define DEFAULT_EMPTY_STRING

#define DEFAULT_EMPTY_STRING `"\0"`

define DEFAULT_FILE_UPLOAD_DELIMITER

#define DEFAULT_FILE_UPLOAD_DELIMITER `"^^"`

define DEFAULT_HANG_TIMEOUT

#define DEFAULT_HANG_TIMEOUT `60`

define DEFAULT_JDBC_CACHE_LIFE_TIME

#define DEFAULT_JDBC_CACHE_LIFE_TIME `1000`

define DEFAULT_JOB_QUEUE_SIZE

#define DEFAULT_JOB_QUEUE_SIZE `1024`

define DEFAULT_KEEP_CONNECTION

#define DEFAULT_KEEP_CONNECTION `"AUTO"`

define DEFAULT_MAX_QUERY_TIMEOUT

#define DEFAULT_MAX_QUERY_TIMEOUT `"0"`

define DEFAULT_MONITOR_HANG_INTERVAL

#define DEFAULT_MONITOR_HANG_INTERVAL `60`

define DEFAULT_PROXY_MAX_PREPARED_STMT_COUNT

#define DEFAULT_PROXY_MAX_PREPARED_STMT_COUNT `10000`

define DEFAULT_RECONNECT_TIME

#define DEFAULT_RECONNECT_TIME `"600s"`

define DEFAULT_SESSION_TIMEOUT

#define DEFAULT_SESSION_TIMEOUT `"5min"`

define DEFAULT_SHARD_KEY_MODULAR

#define DEFAULT_SHARD_KEY_MODULAR `256`

define DEFAULT_SHARD_PROXY_CONN_WAIT_TIMEOUT

#define DEFAULT_SHARD_PROXY_CONN_WAIT_TIMEOUT `"8h"`

define DEFAULT_SHARD_PROXY_LOG_MODE

#define DEFAULT_SHARD_PROXY_LOG_MODE `"ERROR"`

define DEFAULT_SHARD_PROXY_TIMEOUT

#define DEFAULT_SHARD_PROXY_TIMEOUT `"30s"`

define DEFAULT_SQL_LOG_MODE

#define DEFAULT_SQL_LOG_MODE `"ALL"`

define FALSE

#define FALSE `0`

define INI_GETSTR_CHK

#define INI_GETSTR_CHK (
    str,
    ini,
    sec,
    key,
    def,
    lineno
) `/* multi line expression */`

define IS_FILE_MATCH_CONF_CACHE

#define IS_FILE_MATCH_CONF_CACHE (
    cid,
    file
) `( strcmp ( br_conf_info [cid].conf_file, file) == 0)`

define MAX_NUM_CACHED_BROKER_FILES

#define MAX_NUM_CACHED_BROKER_FILES `4`

define MAX_NUM_OF_CONF_FILE_LOADED

#define MAX_NUM_OF_CONF_FILE_LOADED `5`

define PORT_NUM_LIMIT

#define PORT_NUM_LIMIT `( USHRT_MAX )   /* 65535 */`

define PRINTERROR

#define PRINTERROR (
    ...
) `/* multi line expression */`

define TRUE

#define TRUE `1`


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