CUBRID Engine
latest
|
#include <sys/types.h>
#include <math.h>
#include <time.h>
Go to the source code of this file.
Macros | |
#define | UTIL_PID_ENVVAR_NAME "UTIL_PID" |
#define | UTIL_infinity() (HUGE_VAL) |
#define | SLEEP_MILISEC(sec, msec) |
#define | PRINT_AND_LOG_ERR_MSG(...) |
Typedefs | |
typedef void(* | SIG_HANDLER) (void) |
Functions | |
unsigned int | hashpjw (const char *) |
int | util_compare_filepath (const char *file1, const char *file2) |
void | util_arm_signal_handlers (SIG_HANDLER DB_INT32_handler, SIG_HANDLER quit_handler) |
void | util_disarm_signal_handlers (void) |
char ** | util_split_string (const char *str, const char *delim) |
void | util_free_string_array (char **array) |
time_t | util_str_to_time_since_epoch (char *str) |
void | util_shuffle_string_array (char **array, int count) |
int | util_log_write_result (int error) |
int | util_log_write_errid (int message_id,...) |
int | util_log_write_errstr (const char *format,...) |
int | util_log_write_warnstr (const char *format,...) |
int | util_log_write_command (int argc, char *argv[]) |
int | util_bsearch (const void *key, const void *base, int n_elems, unsigned int sizeof_elem, int(*func_compare)(const void *, const void *), bool *out_found) |
void | util_get_second_and_ms_since_epoch (time_t *secs, int *msec) |
#define PRINT_AND_LOG_ERR_MSG | ( | ... | ) |
Definition at line 49 of file util_func.h.
Referenced by addvoldb(), alterdbhost(), applyinfo(), applylogdb(), backupdb(), broker_config_read(), changemode(), check_database_name_local(), check_volume_name(), checkdb(), checksumdb(), compactdb(), copydb(), copylogdb(), createdb(), deletedb(), diagdb(), genlocale(), installdb(), kill_transactions(), killtran(), ldr_validate_object_file(), loaddb_internal(), lockdb(), main(), net_server_start(), optimizedb(), paramdump(), plandump(), renamedb(), restoredb(), restoreslave(), spacedb(), statdump(), synccolldb(), tde(), tranlist(), unloaddb(), util_get_class_oids_and_index_btid(), utility_initialize(), and vacuumdb().
#define SLEEP_MILISEC | ( | sec, | |
msec | |||
) |
Definition at line 40 of file util_func.h.
Referenced by admin_drop_cmd(), admin_reset_cmd(), br_activate(), br_inactivate(), cas_fopen(), cas_monitor_thr_f(), check_shard_as_conn(), chksum_start(), cleanup(), dispatch_thr_f(), fopen_and_lock(), get_char(), hang_check_thr_f(), hb_cluster_job_calc_score(), hb_kill_process(), hb_thread_check_disk_failure(), hb_thread_cluster_worker(), hb_thread_resource_worker(), log_execute(), log_top_query(), logddl_fopen_and_lock(), main(), proxy_activate_internal(), proxy_check_worker(), proxy_monitor_thr_f(), proxy_monitor_worker(), proxy_term(), psize_check_thr_f(), receiver_thr_f(), restart_appl_server(), run_appl_server(), run_proxy_server(), server_monitor_thr_f(), shard_broker_process(), shard_dispatch_thr_f(), shard_shm_set_shard_conn_info(), stop_appl_server(), stop_proxy_server(), ut_is_appl_server_ready(), and ut_kill_process().
#define UTIL_infinity | ( | ) | (HUGE_VAL) |
Definition at line 35 of file util_func.h.
Referenced by qo_env_init().
#define UTIL_PID_ENVVAR_NAME "UTIL_PID" |
Definition at line 34 of file util_func.h.
Referenced by main(), and util_log_header().
typedef void(* SIG_HANDLER) (void) |
Definition at line 60 of file util_func.h.
unsigned int hashpjw | ( | const char * | ) |
Definition at line 83 of file util_func.c.
Referenced by dl_validate_candidates(), pp_generic_case_hash(), and pp_generic_hash().
void util_arm_signal_handlers | ( | SIG_HANDLER | DB_INT32_handler, |
SIG_HANDLER | quit_handler | ||
) |
Definition at line 222 of file util_func.c.
References NULL, os_set_signal_handler(), system_interrupt_handler(), system_quit_handler(), user_interrupt_handler, user_quit_handler, and util_disarm_signal_handlers().
Referenced by ldr_exec_query_from_file(), ldr_sa_load(), and register_signal_handlers().
int util_bsearch | ( | const void * | key, |
const void * | base, | ||
int | n_elems, | ||
unsigned int | sizeof_elem, | ||
int(*)(const void *, const void *) | func_compare, | ||
bool * | out_found | ||
) |
Definition at line 764 of file util_func.c.
Referenced by file_extdata_find_ordered(), and vacuum_add_dropped_file().
Definition at line 111 of file util_func.c.
References p, system_interrupt_handler(), and system_quit_handler().
Referenced by boot_check_permanent_volumes(), boot_mount(), fileio_is_system_volume_label_equal(), fileio_is_volume_label_equal(), and logpb_next_where_path().
void util_disarm_signal_handlers | ( | void | ) |
Definition at line 192 of file util_func.c.
References NULL, os_set_signal_handler(), user_interrupt_handler, and user_quit_handler.
Referenced by util_arm_signal_handlers().
void util_free_string_array | ( | char ** | array | ) |
Definition at line 292 of file util_func.c.
Referenced by boot_restart_client(), server_monitor_thr_f(), util_free_ha_conf(), util_get_num_of_ha_nodes(), util_is_replica_node(), and util_make_ha_conf().
void util_get_second_and_ms_since_epoch | ( | time_t * | secs, |
int * | msec | ||
) |
Definition at line 829 of file util_func.c.
Referenced by db_calculate_current_time(), db_sys_date_and_epoch_time(), db_sys_datetime(), fetch_peek_arith(), logddl_get_time_string(), qexec_execute_query(), ut_time_string(), and util_log_header().
int util_log_write_command | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 540 of file util_func.c.
References i, NULL, p, strlen, UTIL_LOG_MAX_MSG_SIZE, and util_log_write_internal().
Referenced by main().
int util_log_write_errid | ( | int | message_id, |
... | |||
) |
Definition at line 468 of file util_func.c.
References UTIL_LOG_MAX_MSG_SIZE, util_log_write_internal(), and utility_get_generic_message().
Referenced by addvoldb(), alterdbhost(), applyinfo(), applylogdb(), backupdb(), changemode(), checkdb(), checksumdb(), compact_usage(), compactdb_usage(), copydb(), copylogdb(), createdb(), deletedb(), diagdb(), dumplocale(), genlocale(), installdb(), killtran(), ldr_validate_object_file(), lockdb(), main(), optimizedb(), paramdump(), plandump(), process_broker(), process_heartbeat(), process_heartbeat_deregister(), process_heartbeat_reload(), process_heartbeat_replication(), process_heartbeat_start(), process_heartbeat_stop(), process_javasp(), process_javasp_start(), process_javasp_status(), process_javasp_stop(), process_manager(), process_master(), process_server(), process_service(), renamedb(), restoredb(), restoreslave(), spacedb(), statdump(), synccolldb(), tde(), tranlist(), unload_usage(), unloaddb(), us_hb_applylogdb_start(), us_hb_applylogdb_stop(), us_hb_copylogdb_start(), us_hb_copylogdb_stop(), us_hb_server_start(), us_hb_server_stop(), us_hb_status_get_options(), us_hb_stop_get_options(), us_hb_util_get_options(), util_get_class_oids_and_index_btid(), util_get_table_list_from_file(), and vacuumdb().
int util_log_write_errstr | ( | const char * | format, |
... | |||
) |
Definition at line 493 of file util_func.c.
References UTIL_LOG_MAX_MSG_SIZE, and util_log_write_internal().
Referenced by applylogdb(), checkdb(), compactdb(), copylogdb(), createdb(), hb_master_init(), killtran(), ldr_check_file(), ldr_sa_load(), loaddb_internal(), main(), process_javasp_start(), process_master(), tranlist(), unloaddb(), and vacuumdb().
int util_log_write_result | ( | int | error | ) |
Definition at line 448 of file util_func.c.
References NO_ERROR, NULL, and util_log_write_internal().
Referenced by main().
int util_log_write_warnstr | ( | const char * | format, |
... | |||
) |
Definition at line 516 of file util_func.c.
References UTIL_LOG_MAX_MSG_SIZE, and util_log_write_internal().
Referenced by backupdb().
void util_shuffle_string_array | ( | char ** | array, |
int | count | ||
) |
Definition at line 412 of file util_func.c.
Referenced by boot_client_all_finalize().
Definition at line 247 of file util_func.c.
References cubregex::count(), NULL, and strdup().
Referenced by boot_restart_client(), server_monitor_thr_f(), util_split_ha_db(), util_split_ha_node(), and util_split_ha_sync().
time_t util_str_to_time_since_epoch | ( | char * | str | ) |
Definition at line 310 of file util_func.c.
References ER_GENERIC_ERROR, NO_ERROR, NULL, and strdup().
Referenced by applyinfo(), applylogdb(), and la_delay_replica().