CUBRID Engine
latest
|
#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 "authenticate.h"
#include "utility.h"
#include "load_object.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 "transform.h"
#include "execute_schema.h"
#include "network_interface_cl.h"
#include "transaction_cl.h"
#include "dbtype.h"
Go to the source code of this file.
Macros | |
#define | MARK_CLASS_REQUESTED(cl_no) (class_requested[cl_no / 8] |= 1 << cl_no % 8) |
#define | MARK_CLASS_REFERENCED(cl_no) (class_referenced[cl_no / 8] |= 1 << cl_no % 8) |
#define | MARK_CLASS_PROCESSED(cl_no) (class_processed[cl_no / 8] |= 1 << cl_no % 8) |
#define | IS_CLASS_REQUESTED(cl_no) (class_requested[cl_no / 8] & 1 << cl_no % 8) |
#define | IS_CLASS_REFERENCED(cl_no) (class_referenced[cl_no / 8] & 1 << cl_no % 8) |
#define | IS_CLASS_PROCESSED(cl_no) (class_processed[cl_no / 8] & 1 << cl_no % 8) |
#define | GAUGE_INTERVAL 1 |
#define | OBJECT_SUFFIX "_objects" |
#define | HEADER_FORMAT "-------------------------------+--------------------------------\n"" %-25s | %23s \n""-------------------------------+--------------------------------\n" |
#define | MSG_FORMAT " %-25s | %10ld (%3d%% / %5d%%)" |
Functions | |
static int | get_estimated_objs (HFID *hfid, int64_t *est_objects) |
static int | set_referenced_subclasses (DB_OBJECT *class_) |
static bool | check_referenced_domain (DB_DOMAIN *dom_list, bool set_cls_ref, int *num_cls_refp) |
static void | extractobjects_cleanup (void) |
static void | extractobjects_term_handler (int sig) |
static bool | mark_referenced_domain (SM_CLASS *class_ptr, int *num_set) |
static void | gauge_alarm_handler (int sig) |
static int | process_class (int cl_no) |
static int | process_object (DESC_OBJ *desc_obj, OID *obj_oid, int referenced_class) |
static int | process_set (DB_SET *set) |
static int | process_value (DB_VALUE *value) |
static void | update_hash (OID *object_oid, OID *class_oid, int *data) |
static DB_OBJECT * | is_class (OID *obj_oid, OID *class_oid) |
static int | all_classes_processed (void) |
int | extract_objects (const char *exec_name, const char *output_dirname, const char *output_prefix) |
int | is_req_class (DB_OBJECT *class_) |
static char * | ltrim (char *s) |
int | get_requested_classes (const char *input_filename, DB_OBJECT *class_list[]) |
Variables | |
static char * | output_filename = NULL |
static int | output_number = 0 |
static FH_TABLE * | obj_table = NULL |
static FH_TABLE * | cl_table = NULL |
static char * | class_requested = NULL |
static char * | class_referenced = NULL |
static char * | class_processed = NULL |
static OID | null_oid |
static const char * | prohibited_classes [] |
static int64_t | class_objects = 0 |
static int64_t | total_objects = 0 |
static int | failed_objects = 0 |
static int64_t | approximate_class_objects = 0 |
static char * | gauge_class_name |
static int64_t | total_approximate_class_objects = 0 |
static FILE * | unloadlog_file = NULL |
#define GAUGE_INTERVAL 1 |
Definition at line 85 of file unload_object.c.
Referenced by gauge_alarm_handler(), and process_class().
#define HEADER_FORMAT "-------------------------------+--------------------------------\n"" %-25s | %23s \n""-------------------------------+--------------------------------\n" |
Definition at line 162 of file unload_object.c.
Referenced by extract_objects().
#define IS_CLASS_PROCESSED | ( | cl_no | ) | (class_processed[cl_no / 8] & 1 << cl_no % 8) |
Definition at line 82 of file unload_object.c.
Referenced by process_class().
#define IS_CLASS_REFERENCED | ( | cl_no | ) | (class_referenced[cl_no / 8] & 1 << cl_no % 8) |
Definition at line 80 of file unload_object.c.
Referenced by extract_objects(), process_class(), and set_referenced_subclasses().
#define IS_CLASS_REQUESTED | ( | cl_no | ) | (class_requested[cl_no / 8] & 1 << cl_no % 8) |
Definition at line 78 of file unload_object.c.
Referenced by extract_objects(), process_class(), process_value(), and set_referenced_subclasses().
#define MARK_CLASS_PROCESSED | ( | cl_no | ) | (class_processed[cl_no / 8] |= 1 << cl_no % 8) |
Definition at line 76 of file unload_object.c.
Referenced by process_class().
#define MARK_CLASS_REFERENCED | ( | cl_no | ) | (class_referenced[cl_no / 8] |= 1 << cl_no % 8) |
Definition at line 74 of file unload_object.c.
Referenced by extract_objects(), and set_referenced_subclasses().
#define MARK_CLASS_REQUESTED | ( | cl_no | ) | (class_requested[cl_no / 8] |= 1 << cl_no % 8) |
Definition at line 72 of file unload_object.c.
Referenced by extract_objects().
#define MSG_FORMAT " %-25s | %10ld (%3d%% / %5d%%)" |
Definition at line 163 of file unload_object.c.
Referenced by gauge_alarm_handler(), and process_class().
#define OBJECT_SUFFIX "_objects" |
Definition at line 160 of file unload_object.c.
Referenced by extract_objects().
|
static |
Definition at line 1820 of file unload_object.c.
References class_processed, class_referenced, and class_requested.
Referenced by extract_objects().
|
static |
Definition at line 290 of file unload_object.c.
References db_domain_class(), db_domain_next(), db_domain_set(), DB_TYPE_MULTISET, DB_TYPE_OBJECT, DB_TYPE_SEQUENCE, DB_TYPE_SET, NO_ERROR, NULL, set_referenced_subclasses(), and TP_DOMAIN_TYPE.
Referenced by extract_objects(), and mark_referenced_domain().
int extract_objects | ( | const char * | exec_name, |
const char * | output_dirname, | ||
const char * | output_prefix | ||
) |
Definition at line 432 of file unload_object.c.
References all_classes_processed(), au_fetch_class(), AU_FETCH_READ, AU_SELECT, text_output::buffer, cached_pages, check_referenced_domain(), class_processed, class_referenced, class_requested, text_output::count, datafile_per_class, db_attribute_name(), DB_FETCH_READ, DB_SIZEOF, sm_attribute::domain, error(), est_size, extractobjects_cleanup(), extractobjects_term_handler(), failed_objects, fh_create(), FH_OID_KEY, fh_put(), fopen_ex(), text_output::fp, free_and_init, get_estimated_objs(), hash_filename, sm_attribute::header, HEADER_FORMAT, HFID_IS_NULL, i, ID_ATTRIBUTE, ignore_err_flag, input_filename, text_output::iosize, IS_CLASS_REFERENCED, IS_CLASS_REQUESTED, is_req_class(), locator_fetch_set(), locator_get_append_lsa(), MARK_CLASS_REFERENCED, MARK_CLASS_REQUESTED, mark_referenced_domain(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_UNLOADDB, sm_component::name_space, sm_component::next, NO_ERROR, NULL, obj_out, OBJECT_SUFFIX, log_lsa::offset, oid_compare_equals(), oid_hash(), OR_PUT_NULL_OID, sm_attribute::order_link, os_set_signal_handler(), output_filename, page_size, log_lsa::pageid, PRINT_IDENTIFIER, process_class(), prohibited_classes, text_output::ptr, required_class_only, sm_ch_heap(), sm_ch_name(), sm_is_system_class(), sm_Root_class_mop, strlen, text_print(), text_print_flush(), total_approximate_class_objects, total_objects, UNLOADDB_MSG_INVALID_CACHED_PAGE_SIZE, UNLOADDB_MSG_INVALID_CACHED_PAGES, UNLOADDB_MSG_INVALID_DIR_NAME, UNLOADDB_MSG_LOG_LSA, UNLOADDB_MSG_OBJECTS_DUMPED, UNLOADDB_MSG_OBJECTS_FAILED, unloadlog_file, verbose_flag, ws_find(), WS_IS_DELETED, and ws_oid().
Referenced by unloaddb().
|
static |
Definition at line 340 of file unload_object.c.
References text_output::buffer, class_processed, class_referenced, class_requested, debug_flag, fh_destroy(), fh_dump(), text_output::fp, free_and_init, NULL, obj_out, and output_filename.
Referenced by extract_objects(), and extractobjects_term_handler().
|
static |
Definition at line 374 of file unload_object.c.
References _exit(), and extractobjects_cleanup().
Referenced by extract_objects().
|
static |
Definition at line 1005 of file unload_object.c.
References approximate_class_objects, class_objects, gauge_class_name, GAUGE_INTERVAL, MSG_FORMAT, total_approximate_class_objects, and total_objects.
Referenced by process_class().
|
static |
Definition at line 189 of file unload_object.c.
References error(), heap_get_class_num_objects_pages(), and NO_ERROR.
Referenced by extract_objects(), and process_class().
Definition at line 1867 of file unload_object.c.
References DB_MAX_IDENTIFIER_LENGTH, error(), free_and_init, i, locator_find_class(), ltrim(), NULL, sm_downcase_name(), SM_MAX_IDENTIFIER_LENGTH, sm_partitioned_class_type(), and strlen.
Referenced by unloaddb().
Definition at line 1786 of file unload_object.c.
References NULL, OID_EQ, sm_Root_class_mop, ws_mop(), and WS_OID.
Referenced by process_value().
int is_req_class | ( | DB_OBJECT * | class_ | ) |
Definition at line 1802 of file unload_object.c.
References req_class_table.
Referenced by extract_objects(), filter_unrequired_classes(), and set_referenced_subclasses().
|
static |
Definition at line 1837 of file unload_object.c.
References assert, begin(), and NULL.
Referenced by get_requested_classes().
Definition at line 388 of file unload_object.c.
References check_referenced_domain(), sm_class::class_attributes, sm_attribute::domain, sm_attribute::header, ID_ATTRIBUTE, sm_component::name_space, sm_component::next, NULL, sm_attribute::order_link, sm_class::ordered_attributes, and sm_class::shared.
Referenced by extract_objects(), and set_referenced_subclasses().
|
static |
Definition at line 1032 of file unload_object.c.
References approximate_class_objects, CHECK_EXIT_ERROR, CHECK_PRINT_ERROR, sm_class::class_attributes, class_objects, DB_TYPE_NULL, DB_VALUE_TYPE, sm_attribute::default_value, desc_disk_to_obj(), desc_free(), DONT_DECACHE, ER_TF_BUFFER_UNDERFLOW, error(), failed_objects, vfid::fileid, gauge_alarm_handler(), gauge_class_name, GAUGE_INTERVAL, get_estimated_objs(), sm_attribute::header, i, ID_ATTRIBUTE, ignore_err_flag, IS_CLASS_PROCESSED, IS_CLASS_REFERENCED, IS_CLASS_REQUESTED, IS_LOCK, LC_FETCH_MVCC_VERSION, LC_MANYOBJS_PTR_IN_COPYAREA, LC_NEXT_ONEOBJ_PTR_IN_COPYAREA, LC_RECDES_TO_GET_ONEOBJ, LC_START_ONEOBJ_PTR_IN_COPYAREA, locator_fetch_all(), locator_flush_all_instances(), locator_free_copy_area(), make_desc_obj(), MARK_CLASS_PROCESSED, MSG_FORMAT, sm_component::name, sm_component::name_space, sm_component::next, NO_ERROR, NULL, NULL_FILEID, lc_copyarea_manyobjs::num_objs, obj_out, lc_copyarea_oneobj::oid, OID_SET_NULL, sm_attribute::order_link, os_set_signal_handler(), PRINT_IDENTIFIER, process_object(), process_value(), sm_class::shared, sm_ch_heap(), sm_ch_name(), text_print(), total_approximate_class_objects, total_objects, unloadlog_file, sm_default_value::value, verbose_flag, hfid::vfid, ws_find(), and ws_oid().
Referenced by extract_objects().
Definition at line 1399 of file unload_object.c.
References CHECK_EXIT_ERROR, CHECK_PRINT_ERROR, desc_obj::class_, desc_obj::classop, datafile_per_class, debug_flag, error(), sm_attribute::header, ID_ATTRIBUTE, ignore_err_flag, sm_component::name_space, NO_ERROR, NULL, obj_out, sm_attribute::order_link, sm_class::ordered_attributes, db_identifier::pageid, process_value(), db_identifier::slotid, sm_attribute::storage_order, text_print(), update_hash(), desc_obj::values, db_identifier::volid, and ws_oid().
Referenced by process_class().
|
static |
Definition at line 1468 of file unload_object.c.
References CHECK_EXIT_ERROR, CHECK_PRINT_ERROR, error(), ignore_err_flag, NO_ERROR, NULL, obj_out, process_value(), set_iterate(), set_iterator_free(), set_iterator_next(), set_iterator_value(), and text_print().
Referenced by process_value().
|
static |
Definition at line 1521 of file unload_object.c.
References assert, CHECK_EXIT_ERROR, CHECK_PRINT_ERROR, datafile_per_class, DB_FETCH_QUERY_READ, db_get_elo(), db_get_object(), db_get_oid(), db_get_set(), DB_TYPE_BLOB, DB_TYPE_CLOB, DB_TYPE_MULTISET, DB_TYPE_OBJECT, DB_TYPE_OID, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_VALUE_TYPE, db_value_type(), debug_flag, desc_value_special_fprint(), ELO_FBO, error(), fh_get(), ignore_err_flag, include_references, input_filename, is_class(), IS_CLASS_REQUESTED, IS_LOCK, LC_DOESNOT_EXIST, LC_ERROR, LC_EXIST, db_elo::locator, locator_does_exist(), locator_fetch_class(), db_elo::meta_data, NO_ERROR, NULL, NULL_CHN, obj_out, OID_EQ, OID_SET_NULL, db_identifier::pageid, process_set(), required_class_only, db_elo::size, db_identifier::slotid, sm_ch_name(), sm_Root_class_mop, text_print(), TM_TRAN_READ_FETCH_VERSION, db_elo::type, update_hash(), db_identifier::volid, ws_find(), and WS_OID.
Referenced by process_class(), process_object(), and process_set().
|
static |
Definition at line 212 of file unload_object.c.
References CHECK_EXIT_ERROR, error(), fh_get(), include_references, input_filename, IS_CLASS_REFERENCED, IS_CLASS_REQUESTED, is_req_class(), MARK_CLASS_REFERENCED, mark_referenced_domain(), db_objlist::next, NO_ERROR, NULL, db_objlist::op, sm_class::users, ws_find(), and ws_oid().
Referenced by check_referenced_domain().
Definition at line 1744 of file unload_object.c.
References error(), fh_get(), fh_put(), NO_ERROR, and NULL.
Referenced by process_object(), and process_value().
|
static |
Definition at line 155 of file unload_object.c.
Referenced by gauge_alarm_handler(), and process_class().
Definition at line 92 of file unload_object.c.
|
static |
Definition at line 151 of file unload_object.c.
Referenced by gauge_alarm_handler(), and process_class().
|
static |
Definition at line 96 of file unload_object.c.
Referenced by all_classes_processed(), extract_objects(), and extractobjects_cleanup().
|
static |
Definition at line 95 of file unload_object.c.
Referenced by all_classes_processed(), extract_objects(), and extractobjects_cleanup().
|
static |
Definition at line 94 of file unload_object.c.
Referenced by all_classes_processed(), extract_objects(), and extractobjects_cleanup().
|
static |
Definition at line 153 of file unload_object.c.
Referenced by extract_objects(), and process_class().
|
static |
Definition at line 156 of file unload_object.c.
Referenced by gauge_alarm_handler(), and process_class().
|
static |
Definition at line 98 of file unload_object.c.
Definition at line 91 of file unload_object.c.
|
static |
Definition at line 87 of file unload_object.c.
Referenced by extract_indexes_to_file(), extract_objects(), extract_triggers_to_file(), and extractobjects_cleanup().
|
static |
Definition at line 89 of file unload_object.c.
|
static |
Definition at line 100 of file unload_object.c.
Referenced by extract_objects().
|
static |
Definition at line 157 of file unload_object.c.
Referenced by extract_objects(), gauge_alarm_handler(), and process_class().
|
static |
Definition at line 152 of file unload_object.c.
Referenced by extract_objects(), gauge_alarm_handler(), and process_class().
|
static |
Definition at line 164 of file unload_object.c.
Referenced by extract_objects(), and process_class().