Skip to content

File util_cs.c

FileList > cubrid > src > executables > util_cs.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 <signal.h>
  • #include <errno.h>
  • #include <assert.h>
  • #include <fcntl.h>
  • #include <unistd.h>
  • #include "utility.h"
  • #include "error_manager.h"
  • #include "message_catalog.h"
  • #include "system_parameter.h"
  • #include "environment_variable.h"
  • #include "databases_file.h"
  • #include "boot_cl.h"
  • #include "boot_sr.h"
  • #include "db.h"
  • #include "authenticate.h"
  • #include "server_interface.h"
  • #include "object_representation.h"
  • #include "transaction_cl.h"
  • #include "porting.h"
  • #include "network_interface_cl.h"
  • #include "connection_defs.h"
  • #include "log_writer.h"
  • #include "log_applier.h"
  • #include "log_lsa.hpp"
  • #include "schema_manager.h"
  • #include "locator_cl.h"
  • #include "dynamic_array.h"
  • #include "util_func.h"
  • #include "xasl.h"
  • #include "log_volids.hpp"
  • #include "tde.h"
  • #include "flashback_cl.h"
  • #include "connection_support.hpp"
  • #include "memory_monitor_cl.hpp"
  • #include "heartbeat.h"
  • #include "network_histogram.hpp"

Public Types

Type Name
enum SORT_COLUMN_TYPE
enum TRANDUMP_LEVEL
enum T_SPACEDB_SIZE_UNIT

Public Static Attributes

Type Name
bool is_Sigint_caught = [**false**](broker__monitor_8c.md#function-timeout)
FILE * sigusr1_dump_outfp = [**NULL**](freelistheap_8h.md#define-null)
struct sigaction sigusr1_old_action
bool sigusr1_old_action_saved = [**false**](broker__monitor_8c.md#function-timeout)
int sigusr1_pipe_fds = { -1, -1 }
volatile sig_atomic_t sigusr1_pipe_write_fd = -1
volatile sig_atomic_t sigusr1_running = 0
int sigusr1_saved_stdout_fd = -1
bool sigusr1_started = [**false**](broker__monitor_8c.md#function-timeout)
pthread_t sigusr1_tid
int tranlist_Sort_column = 0
bool tranlist_Sort_desc = [**false**](broker__monitor_8c.md#function-timeout)

Public Functions

Type Name
int acldb (UTIL_FUNCTION_ARG * arg)
int addvoldb (UTIL_FUNCTION_ARG * arg)
int applyinfo (UTIL_FUNCTION_ARG * arg)
int applylogdb (UTIL_FUNCTION_ARG * arg)
int backupdb (UTIL_FUNCTION_ARG * arg)
int changemode (UTIL_FUNCTION_ARG * arg)
int checkdb (UTIL_FUNCTION_ARG * arg)
int cleanfiledb (UTIL_FUNCTION_ARG * arg)
int copylogdb (UTIL_FUNCTION_ARG * arg)
int flashback (UTIL_FUNCTION_ARG * arg)
int killtran (UTIL_FUNCTION_ARG * arg)
int lockdb (UTIL_FUNCTION_ARG * arg)
int memmon (UTIL_FUNCTION_ARG * arg)
int paramdump (UTIL_FUNCTION_ARG * arg)
int plandump (UTIL_FUNCTION_ARG * arg)
int spacedb (UTIL_FUNCTION_ARG * arg)
int statdump (UTIL_FUNCTION_ARG * arg)
int tde (UTIL_FUNCTION_ARG * arg)
int tranlist (UTIL_FUNCTION_ARG * arg)
int vacuumdb (UTIL_FUNCTION_ARG * arg)

Public Static Functions

Type Name
void backupdb_sig_interrupt_handler (int sig_no)
int check_server_ha_mode (void)
void clean_stdin ()
void crash_handler (int sig_no)
bool doesmatch_transaction (const ONE_TRAN_INFO * tran, int * tran_index_list, int index_list_size, const char * username, const char * hostname, const char * progname, const char * sql_id)
void dump_trantb (TRANS_INFO * info, TRANDUMP_LEVEL dump_level, bool full_sqltext)
void intr_handler (int sig_no)
int isvalid_transaction (const ONE_TRAN_INFO * tran)
int kill_transactions (TRANS_INFO * info, int * tran_index_list, int list_size, const char * username, const char * hostname, const char * progname, const char * sql_id, bool verify)
time_t parse_date_string_to_time (char * date_string)
void print_timestamp (FILE * outfp)
int print_tran_entry (const ONE_TRAN_INFO * tran_info, TRANDUMP_LEVEL dump_level, bool full_sqltext)
void sigusr1_close_dump_output (void)
void sigusr1_close_pipe (void)
int sigusr1_create_pipe (void)
void sigusr1_dump (int util_index, FILE * out)
int sigusr1_install_signal_handler (void)
void * sigusr1_monitor_thread (void * arg)
void sigusr1_restore_signal_handler (void)
void sigusr1_save_stdout (void)
void sigusr1_signal_handler (int sig_no)
char * spacedb_get_size_str (char * buf, UINT64 num_pages, T_SPACEDB_SIZE_UNIT size_unit)
void start_sigusr1_monitor (int util_index)
void stop_sigusr1_monitor (void)
int tranlist_cmp_f (const void * p1, const void * p2)
OID * util_get_class_oids_and_index_btid (dynamic_array * darray, const char * index_name, BTID * index_btid)

Macros

Type Name
define MAX_DELVOL_ID_LIST_NUM 64
define MAX_KILLTRAN_INDEX_LIST_NUM 64
define PASSBUF_SIZE 12
define SPACEDB_NUM_VOL_PURPOSE 2
define SPACEDB_TO_SIZE_ARG (no, npage) [**spacedb\_get\_size\_str**](util__cs_8c.md#function-spacedb_get_size_str) ([**size\_str\_**](broker__monitor_8c.md#function-timeout)##[**no**](broker__monitor_8c.md#function-timeout), [**npage**](broker__monitor_8c.md#function-timeout), [**size\_unit\_type**](broker__monitor_8c.md#function-timeout))
define UNIT_STR (un) (((un) == SPACEDB\_SIZE\_UNIT\_MBYTES) ? 'M' : ((un) == SPACEDB\_SIZE\_UNIT\_GBYTES) ? '[**G**](broker__monitor_8c.md#function-timeout)' : 'T')
define VOL_PURPOSE_STRING (VOL_PURPOSE) /* multi line expression */

Public Types Documentation

enum SORT_COLUMN_TYPE

enum SORT_COLUMN_TYPE {
    SORT_COLUMN_TYPE_INT,
    SORT_COLUMN_TYPE_FLOAT,
    SORT_COLUMN_TYPE_STR
};

enum TRANDUMP_LEVEL

enum TRANDUMP_LEVEL {
    TRANDUMP_SUMMARY,
    TRANDUMP_QUERY_INFO,
    TRANDUMP_FULL_INFO
};

enum T_SPACEDB_SIZE_UNIT

enum T_SPACEDB_SIZE_UNIT {
    SPACEDB_SIZE_UNIT_PAGE = 0,
    SPACEDB_SIZE_UNIT_MBYTES,
    SPACEDB_SIZE_UNIT_GBYTES,
    SPACEDB_SIZE_UNIT_TBYTES,
    SPACEDB_SIZE_UNIT_HUMAN_READABLE
};

Public Static Attributes Documentation

variable is_Sigint_caught

bool is_Sigint_caught;

variable sigusr1_dump_outfp

FILE* sigusr1_dump_outfp;

variable sigusr1_old_action

struct sigaction sigusr1_old_action;

variable sigusr1_old_action_saved

bool sigusr1_old_action_saved;

variable sigusr1_pipe_fds

int sigusr1_pipe_fds[2];

variable sigusr1_pipe_write_fd

volatile sig_atomic_t sigusr1_pipe_write_fd;

variable sigusr1_running

volatile sig_atomic_t sigusr1_running;

variable sigusr1_saved_stdout_fd

int sigusr1_saved_stdout_fd;

variable sigusr1_started

bool sigusr1_started;

variable sigusr1_tid

pthread_t sigusr1_tid;

variable tranlist_Sort_column

int tranlist_Sort_column;

variable tranlist_Sort_desc

bool tranlist_Sort_desc;

Public Functions Documentation

function acldb

int acldb (
    UTIL_FUNCTION_ARG * arg
) 

function addvoldb

int addvoldb (
    UTIL_FUNCTION_ARG * arg
) 

function applyinfo

int applyinfo (
    UTIL_FUNCTION_ARG * arg
) 

function applylogdb

int applylogdb (
    UTIL_FUNCTION_ARG * arg
) 

function backupdb

int backupdb (
    UTIL_FUNCTION_ARG * arg
) 

function changemode

int changemode (
    UTIL_FUNCTION_ARG * arg
) 

function checkdb

int checkdb (
    UTIL_FUNCTION_ARG * arg
) 

function cleanfiledb

int cleanfiledb (
    UTIL_FUNCTION_ARG * arg
) 

function copylogdb

int copylogdb (
    UTIL_FUNCTION_ARG * arg
) 

function flashback

int flashback (
    UTIL_FUNCTION_ARG * arg
) 

function killtran

int killtran (
    UTIL_FUNCTION_ARG * arg
) 

function lockdb

int lockdb (
    UTIL_FUNCTION_ARG * arg
) 

function memmon

int memmon (
    UTIL_FUNCTION_ARG * arg
) 

function paramdump

int paramdump (
    UTIL_FUNCTION_ARG * arg
) 

function plandump

int plandump (
    UTIL_FUNCTION_ARG * arg
) 

function spacedb

int spacedb (
    UTIL_FUNCTION_ARG * arg
) 

function statdump

int statdump (
    UTIL_FUNCTION_ARG * arg
) 

function tde

int tde (
    UTIL_FUNCTION_ARG * arg
) 

function tranlist

int tranlist (
    UTIL_FUNCTION_ARG * arg
) 

function vacuumdb

int vacuumdb (
    UTIL_FUNCTION_ARG * arg
) 

Public Static Functions Documentation

function backupdb_sig_interrupt_handler

static void backupdb_sig_interrupt_handler (
    int sig_no
) 

function check_server_ha_mode

static int check_server_ha_mode (
    void
) 

function clean_stdin

static void clean_stdin () 

function crash_handler

static void crash_handler (
    int sig_no
) 

function doesmatch_transaction

static bool doesmatch_transaction (
    const  ONE_TRAN_INFO * tran,
    int * tran_index_list,
    int index_list_size,
    const  char * username,
    const  char * hostname,
    const  char * progname,
    const  char * sql_id
) 

function dump_trantb

static void dump_trantb (
    TRANS_INFO * info,
    TRANDUMP_LEVEL dump_level,
    bool full_sqltext
) 

function intr_handler

static void intr_handler (
    int sig_no
) 

function isvalid_transaction

static int isvalid_transaction (
    const  ONE_TRAN_INFO * tran
) 

function kill_transactions

static int kill_transactions (
    TRANS_INFO * info,
    int * tran_index_list,
    int list_size,
    const  char * username,
    const  char * hostname,
    const  char * progname,
    const  char * sql_id,
    bool verify
) 

function parse_date_string_to_time

static time_t parse_date_string_to_time (
    char * date_string
) 

function print_timestamp

static void print_timestamp (
    FILE * outfp
) 

function print_tran_entry

static int print_tran_entry (
    const  ONE_TRAN_INFO * tran_info,
    TRANDUMP_LEVEL dump_level,
    bool full_sqltext
) 

function sigusr1_close_dump_output

static void sigusr1_close_dump_output (
    void
) 

function sigusr1_close_pipe

static void sigusr1_close_pipe (
    void
) 

function sigusr1_create_pipe

static int sigusr1_create_pipe (
    void
) 

function sigusr1_dump

static void sigusr1_dump (
    int util_index,
    FILE * out
) 

function sigusr1_install_signal_handler

static int sigusr1_install_signal_handler (
    void
) 

function sigusr1_monitor_thread

static void * sigusr1_monitor_thread (
    void * arg
) 

function sigusr1_restore_signal_handler

static void sigusr1_restore_signal_handler (
    void
) 

function sigusr1_save_stdout

static void sigusr1_save_stdout (
    void
) 

function sigusr1_signal_handler

static void sigusr1_signal_handler (
    int sig_no
) 

function spacedb_get_size_str

static char * spacedb_get_size_str (
    char * buf,
    UINT64 num_pages,
    T_SPACEDB_SIZE_UNIT size_unit
) 

function start_sigusr1_monitor

static void start_sigusr1_monitor (
    int util_index
) 

function stop_sigusr1_monitor

static void stop_sigusr1_monitor (
    void
) 

function tranlist_cmp_f

static int tranlist_cmp_f (
    const  void * p1,
    const  void * p2
) 

function util_get_class_oids_and_index_btid

static OID * util_get_class_oids_and_index_btid (
    dynamic_array * darray,
    const  char * index_name,
    BTID * index_btid
) 

Macro Definition Documentation

define MAX_DELVOL_ID_LIST_NUM

#define MAX_DELVOL_ID_LIST_NUM `64`

define MAX_KILLTRAN_INDEX_LIST_NUM

#define MAX_KILLTRAN_INDEX_LIST_NUM `64`

define PASSBUF_SIZE

#define PASSBUF_SIZE `12`

define SPACEDB_NUM_VOL_PURPOSE

#define SPACEDB_NUM_VOL_PURPOSE `2`

define SPACEDB_TO_SIZE_ARG

#define SPACEDB_TO_SIZE_ARG (
    no,
    npage
) `spacedb_get_size_str ( size_str_ ## no , npage , size_unit_type )`

define UNIT_STR

#define UNIT_STR (
    un
) `(((un) == SPACEDB_SIZE_UNIT_MBYTES ) ? 'M' : ((un) == SPACEDB_SIZE_UNIT_GBYTES ) ? ' G ' : 'T')`

define VOL_PURPOSE_STRING

#define VOL_PURPOSE_STRING (
    VOL_PURPOSE
) `/* multi line expression */`


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