File unload_object.c
FileList > cubrid > src > executables > unload_object.c
Go to the source code of this file
#include <inttypes.h>
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
#include <assert.h>
#include <sys/stat.h>
#include <thread>
#include "authenticate.h"
#include "utility.h"
#include "load_object.h"
#include "unload_object_file.h"
#include "log_lsa.hpp"
#include "file_hash.h"
#include "db.h"
#include "memory_hash.h"
#include "memory_alloc.h"
#include "locator_cl.h"
#include "schema_manager.h"
#include "locator.h"
#include "transform_cl.h"
#include "object_accessor.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "set_object.h"
#include "message_catalog.h"
#include "server_interface.h"
#include "porting.h"
#include "unloaddb.h"
#include "system_parameter.h"
#include "schema_system_catalog_constants.h"
#include "execute_schema.h"
#include "network_interface_cl.h"
#include "transaction_cl.h"
#include "dbtype.h"
#include "error_context.hpp"
Classes
Public Types
Public Attributes
Public Static Attributes
Public Functions
Public Static Functions
| Type |
Name |
| int |
all_classes_processed (void)
|
| bool |
check_include_object_domain (DB_DOMAIN * dom_list, DB_TYPE * db_type)
|
| bool |
check_referenced_domain (DB_DOMAIN * dom_list, bool set_cls_ref, int * num_cls_refp)
|
| void |
close_object_file ()
|
| int |
create_filename (const char * output_dirname, const char * output_prefix, const char * suffix, char * output_filename_p, const size_t filename_size)
|
| void |
extractobjects_cleanup ()
|
| void |
extractobjects_term_handler (int sig)
|
| void |
gauge_alarm_handler (int sig)
|
| int |
get_estimated_objs (HFID * hfid, int64_t * est_objects)
|
| int |
get_estimated_objs (HFID * hfid, int64_t * est_objects, bool enhanced)
|
| bool |
init_thread_param (const char * output_dirname, int nthreads)
|
| DB_OBJECT * |
is_class (OID * obj_oid, OID * class_oid)
|
| bool |
mark_referenced_domain (SM_CLASS * class_ptr, int * num_set)
|
| bool |
open_object_file (extract_context & ctxt, const char * output_dirname, const char * class_name)
|
| void |
print_monitoring_info (const char * class_name, int nthreads)
|
| int |
process_class (extract_context & ctxt, int cl_no, int nthreads)
|
| int |
process_object (DESC_OBJ * desc_obj, OID * obj_oid, int referenced_class, TEXT_OUTPUT * obj_out)
|
| int |
process_set (DB_SET * set, TEXT_OUTPUT * obj_out)
|
| int |
process_value (DB_VALUE * value, TEXT_OUTPUT * obj_out)
|
| void |
quit_thread_param ()
|
| int |
set_referenced_subclasses (DB_OBJECT * class_)
|
| THREAD_RET_T THREAD_CALLING_CONVENTION |
unload_extractor_thread (void * param)
|
| int |
unload_printer (LC_COPYAREA * fetch_area, DESC_OBJ * desc_obj, TEXT_OUTPUT * obj_out)
|
| THREAD_RET_T THREAD_CALLING_CONVENTION |
unload_writer_thread (void * param)
|
| void |
update_hash (OID * object_oid, OID * class_oid, int * data)
|
Macros
| Type |
Name |
| define |
ALIGN_SPACE_FMT " %-25s \| "
|
| define |
CREAT_OBJECT_FILE_PERM 0644
|
| define |
GAUGE_INTERVAL 1
|
| define |
HEADER_FORMAT "-------------------------------+--------------------------------\n"" %-25s \| %23s \[**n""**](broker__monitor_8c.md#function-timeout)-------------------------------+--------------------------------\[**n"**](broker__monitor_8c.md#function-timeout)
|
| define |
INVALID_THREAD_ID (([**pthread\_t**](broker__monitor_8c.md#function-timeout)) (-1))
|
| define |
IS_CLASS_PROCESSED (cl_no) ([**class\_processed**](unload__object_8c.md#variable-class_processed)[[**cl\_no**](broker__monitor_8c.md#function-timeout) / 8] & 1 << [**cl\_no**](broker__monitor_8c.md#function-timeout) % 8)
|
| define |
IS_CLASS_REFERENCED (cl_no) ([**class\_referenced**](unload__object_8c.md#variable-class_referenced)[[**cl\_no**](broker__monitor_8c.md#function-timeout) / 8] & 1 << [**cl\_no**](broker__monitor_8c.md#function-timeout) % 8)
|
| define |
IS_CLASS_REQUESTED (cl_no) ([**class\_requested**](unload__object_8c.md#variable-class_requested)[[**cl\_no**](broker__monitor_8c.md#function-timeout) / 8] & 1 << [**cl\_no**](broker__monitor_8c.md#function-timeout) % 8)
|
| define |
MARK_CLASS_PROCESSED (cl_no) ([**class\_processed**](unload__object_8c.md#variable-class_processed)[[**cl\_no**](broker__monitor_8c.md#function-timeout) / 8] \|= 1 << [**cl\_no**](broker__monitor_8c.md#function-timeout) % 8)
|
| define |
MARK_CLASS_REFERENCED (cl_no) ([**class\_referenced**](unload__object_8c.md#variable-class_referenced)[[**cl\_no**](broker__monitor_8c.md#function-timeout) / 8] \|= 1 << [**cl\_no**](broker__monitor_8c.md#function-timeout) % 8)
|
| define |
MARK_CLASS_REQUESTED (cl_no) ([**class\_requested**](unload__object_8c.md#variable-class_requested)[[**cl\_no**](broker__monitor_8c.md#function-timeout) / 8] \|= 1 << [**cl\_no**](broker__monitor_8c.md#function-timeout) % 8)
|
| define |
MSG_FORMAT " %-25s \| %10ld (%3d%% / %5d%%)"
|
| define |
OBJECT_SUFFIX "\_objects"
|
| define |
USE_ACTUAL (0)
|
| define |
USE_APPROXIMATION (1)
|
| define |
__STDC_FORMAT_MACROS
|
Public Types Documentation
typedef LC_COPYAREA_NODE
typedef struct _lc_copyarea_node LC_COPYAREA_NODE;
typedef UNLD_CLASS_PARAM
typedef struct _unloaddb_class_info UNLD_CLASS_PARAM;
Public Attributes Documentation
variable g_uci
variable g_update_hash_cs_lock
pthread_mutex_t g_update_hash_cs_lock;
variable wi_write_file
S_WAITING_INFO wi_write_file;
Public Static Attributes Documentation
variable approximate_class_objects
int64_t approximate_class_objects;
variable cl_table
variable class_objects_atomic
std::atomic<int64_t> class_objects_atomic;
variable class_processed
variable class_referenced
variable class_requested
volatile bool extractor_thread_proc_terminate;
variable failed_objects_atomic
std::atomic<int64_t> failed_objects_atomic;
variable gauge_class_name
variable max_fetched_copyarea_list
int max_fetched_copyarea_list;
variable null_oid
variable obj_table
variable output_number
variable prohibited_classes
const char* prohibited_classes[];
variable total_approximate_class_objects
int64_t total_approximate_class_objects;
variable total_objects_atomic
std::atomic<int64_t> total_objects_atomic;
variable unloadlog_file
variable wi_unload_class
S_WAITING_INFO wi_unload_class;
variable wi_w_blk_getQ
S_WAITING_INFO wi_w_blk_getQ;
variable writer_thread_proc_terminate
volatile bool writer_thread_proc_terminate;
Public Functions Documentation
int extract_objects (
extract_context & ctxt,
const char * output_dirname,
int nthreads,
int sampling_records,
bool enhanced_estimates
)
function get_requested_classes
int get_requested_classes (
const char * input_filename,
DB_OBJECT * class_list
)
function is_req_class
int is_req_class (
DB_OBJECT * class_
)
int print_object_header_for_class (
extract_context & ctxt,
SM_CLASS * class_ptr,
OID * class_oid,
TEXT_OUTPUT * obj_out
)
function unload_fetcher
int unload_fetcher (
LC_FETCH_VERSION_TYPE fetch_type
)
Public Static Functions Documentation
function all_classes_processed
static int all_classes_processed (
void
)
function check_include_object_domain
static bool check_include_object_domain (
DB_DOMAIN * dom_list,
DB_TYPE * db_type
)
function check_referenced_domain
static bool check_referenced_domain (
DB_DOMAIN * dom_list,
bool set_cls_ref,
int * num_cls_refp
)
function close_object_file
static void close_object_file ()
function create_filename
static int create_filename (
const char * output_dirname,
const char * output_prefix,
const char * suffix,
char * output_filename_p,
const size_t filename_size
)
static void extractobjects_cleanup ()
function extractobjects_term_handler
static void extractobjects_term_handler (
int sig
)
function gauge_alarm_handler
static void gauge_alarm_handler (
int sig
)
function get_estimated_objs
static int get_estimated_objs (
HFID * hfid,
int64_t * est_objects
)
function get_estimated_objs
static int get_estimated_objs (
HFID * hfid,
int64_t * est_objects,
bool enhanced
)
function init_thread_param
static bool init_thread_param (
const char * output_dirname,
int nthreads
)
function is_class
static DB_OBJECT * is_class (
OID * obj_oid,
OID * class_oid
)
function mark_referenced_domain
static bool mark_referenced_domain (
SM_CLASS * class_ptr,
int * num_set
)
function open_object_file
static bool open_object_file (
extract_context & ctxt,
const char * output_dirname,
const char * class_name
)
function print_monitoring_info
static void print_monitoring_info (
const char * class_name,
int nthreads
)
function process_class
static int process_class (
extract_context & ctxt,
int cl_no,
int nthreads
)
function process_object
static int process_object (
DESC_OBJ * desc_obj,
OID * obj_oid,
int referenced_class,
TEXT_OUTPUT * obj_out
)
function process_set
static int process_set (
DB_SET * set,
TEXT_OUTPUT * obj_out
)
function process_value
static int process_value (
DB_VALUE * value,
TEXT_OUTPUT * obj_out
)
function quit_thread_param
static void quit_thread_param ()
function set_referenced_subclasses
static int set_referenced_subclasses (
DB_OBJECT * class_
)
static THREAD_RET_T THREAD_CALLING_CONVENTION unload_extractor_thread (
void * param
)
function unload_printer
static int unload_printer (
LC_COPYAREA * fetch_area,
DESC_OBJ * desc_obj,
TEXT_OUTPUT * obj_out
)
function unload_writer_thread
static THREAD_RET_T THREAD_CALLING_CONVENTION unload_writer_thread (
void * param
)
function update_hash
static void update_hash (
OID * object_oid,
OID * class_oid,
int * data
)
Macro Definition Documentation
define ALIGN_SPACE_FMT
#define ALIGN_SPACE_FMT `" %-25s | "`
define CREAT_OBJECT_FILE_PERM
#define CREAT_OBJECT_FILE_PERM `0644`
define GAUGE_INTERVAL
#define GAUGE_INTERVAL `1`
#define HEADER_FORMAT `"-------------------------------+--------------------------------\n"" %-25s | %23s \ n"" -------------------------------+--------------------------------\ n"`
define INVALID_THREAD_ID
#define INVALID_THREAD_ID `(( pthread_t ) (-1))`
define IS_CLASS_PROCESSED
#define IS_CLASS_PROCESSED (
cl_no
) `( class_processed [ cl_no / 8] & 1 << cl_no % 8)`
define IS_CLASS_REFERENCED
#define IS_CLASS_REFERENCED (
cl_no
) `( class_referenced [ cl_no / 8] & 1 << cl_no % 8)`
define IS_CLASS_REQUESTED
#define IS_CLASS_REQUESTED (
cl_no
) `( class_requested [ cl_no / 8] & 1 << cl_no % 8)`
define MARK_CLASS_PROCESSED
#define MARK_CLASS_PROCESSED (
cl_no
) `( class_processed [ cl_no / 8] |= 1 << cl_no % 8)`
define MARK_CLASS_REFERENCED
#define MARK_CLASS_REFERENCED (
cl_no
) `( class_referenced [ cl_no / 8] |= 1 << cl_no % 8)`
define MARK_CLASS_REQUESTED
#define MARK_CLASS_REQUESTED (
cl_no
) `( class_requested [ cl_no / 8] |= 1 << cl_no % 8)`
#define MSG_FORMAT `" %-25s | %10ld (%3d%% / %5d%%)"`
define OBJECT_SUFFIX
#define OBJECT_SUFFIX `"_objects"`
define USE_ACTUAL
define USE_APPROXIMATION
#define USE_APPROXIMATION `(1)`
#define __STDC_FORMAT_MACROS
The documentation for this class was generated from the following file cubrid/src/executables/unload_object.c