CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include "porting.h"
#include "dbtype.h"
#include "load_object.h"
#include "db.h"
#include "locator_cl.h"
#include "locator_sr.h"
#include "schema_manager.h"
#include "heap_file.h"
#include "system_catalog.h"
#include "object_accessor.h"
#include "set_object.h"
#include "btree.h"
#include "message_catalog.h"
#include "network_interface_cl.h"
#include "server_interface.h"
#include "system_parameter.h"
#include "utility.h"
#include "authenticate.h"
#include "transaction_cl.h"
#include "thread_manager.hpp"
Go to the source code of this file.
Functions | |
static int | compactdb_start (bool verbose_flag, char *input_filename, char **input_class_name, int input_class_length) |
static void | process_class (THREAD_ENTRY *thread_p, DB_OBJECT *class_, bool verbose_flag) |
static void | process_object (THREAD_ENTRY *thread_p, DESC_OBJ *desc_obj, OID *obj_oid, bool verbose_flag) |
static int | process_set (THREAD_ENTRY *thread_p, DB_SET *set) |
static int | process_value (THREAD_ENTRY *thread_p, DB_VALUE *value) |
static DB_OBJECT * | is_class (OID *obj_oid, OID *class_oid) |
static int | disk_update_instance (MOP classop, DESC_OBJ *obj, OID *oid) |
static RECDES * | alloc_recdes (int length) |
static void | free_recdes (RECDES *rec) |
static void | disk_init (void) |
static void | disk_final (void) |
static int | update_indexes (OID *class_oid, OID *obj_oid, RECDES *rec) |
static void | compact_usage (const char *argv0) |
int | get_class_mops (char **class_names, int num_class, MOP **class_list, int *num_class_list) |
int | get_class_mops_from_file (const char *input_filename, MOP **class_list, int *num_class_mops) |
int | compactdb (UTIL_FUNCTION_ARG *arg) |
Variables | |
static int | class_objects = 0 |
static int | total_objects = 0 |
static int | failed_objects = 0 |
static RECDES * | Diskrec = NULL |
|
static |
Definition at line 718 of file compactdb.c.
References recdes::area_size, recdes::data, recdes::length, NULL, and recdes::type.
Referenced by disk_init(), and disk_update_instance().
|
static |
Definition at line 83 of file compactdb.c.
References basename(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_GENERIC_INVALID_ARGUMENT, MSGCAT_UTIL_SET_COMPACTDB, and util_log_write_errid().
Referenced by compactdb().
int compactdb | ( | UTIL_FUNCTION_ARG * | arg | ) |
Definition at line 98 of file compactdb.c.
|
static |
Definition at line 175 of file compactdb.c.
References ARG_FILE_LINE, ASSERT_ERROR, catalog_reclaim_space(), COMPACTDB_MSG_CLASS, COMPACTDB_MSG_FAILED, COMPACTDB_MSG_PASS1, COMPACTDB_MSG_PASS2, COMPACTDB_MSG_PASS3, COMPACTDB_MSG_PROCESSED, db_commit_transaction(), DB_FETCH_QUERY_READ, disk_final(), disk_init(), ER_FAILED, ER_GENERIC_ERROR, ER_NOTIFICATION_SEVERITY, er_set(), failed_objects, vfid::fileid, free_and_init, get_class_mops(), get_class_mops_from_file(), heap_reclaim_addresses(), i, locator_free_list_mops(), locator_get_all_mops(), list_mops::mops, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, NULL_FILEID, list_mops::num, prm_get_integer_value(), PRM_ID_COMPACTDB_PAGE_RECLAIM_ONLY, process_class(), sm_ch_heap(), sm_ch_name(), sm_Root_class_mop, thread_get_thread_entry_info(), total_objects, hfid::vfid, ws_find(), and WS_IS_DELETED.
Referenced by compactdb().
|
static |
Definition at line 758 of file compactdb.c.
References free_recdes(), and NULL.
Referenced by compactdb_start().
|
static |
Definition at line 748 of file compactdb.c.
References alloc_recdes(), and DB_PAGESIZE.
Referenced by compactdb_start().
Definition at line 654 of file compactdb.c.
References alloc_recdes(), assert, desc_obj::class_, COMPACTDB_MSG_CANT_TRANSFORM, COMPACTDB_MSG_CANT_UPDATE, COMPACTDB_MSG_NO_HEAP, DB_PAGESIZE, desc_obj_to_disk(), free_recdes(), heap_create_update_context(), heap_update_logical(), HFID_IS_NULL, recdes::length, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, sm_ch_heap(), update_indexes(), UPDATE_INPLACE_CURRENT_MVCCID, and WS_OID.
Referenced by process_object().
|
static |
Definition at line 738 of file compactdb.c.
References free_and_init.
Referenced by disk_final(), and disk_update_instance().
int get_class_mops | ( | char ** | class_names, |
int | num_class, | ||
MOP ** | class_list, | ||
int * | num_class_list | ||
) |
Definition at line 93 of file compactdb_common.c.
Referenced by compactdb_start().
int get_class_mops_from_file | ( | const char * | input_filename, |
MOP ** | class_list, | ||
int * | num_class_mops | ||
) |
Definition at line 165 of file compactdb_common.c.
Referenced by compactdb_start().
Definition at line 637 of file compactdb.c.
References NULL, OID_EQ, sm_Root_class_mop, ws_mop(), and WS_OID.
Referenced by assign_set_value(), db_instance_equal(), do_reclaim_class_addresses(), do_replace_names_for_insert_values_pre(), fetch_class(), find_attribute(), get_set_value(), grok_classes(), object_description::init(), class_description::init(), lock_unlock_object(), lock_unlock_object_lock_internal(), mq_translate_insert(), obj_copy(), obj_delete(), obj_find_object_by_pkey(), obj_locate_attribute(), obj_lock(), obj_set_att(), obt_def_object(), obt_edit_object(), pt_eval_path_expr(), pt_help_show_create_table(), pt_is_reference_to_reusable_oid(), pt_set_class_chn(), pt_spec_to_xasl_class_oid_list(), sm_delete_class_mop(), sm_fetch_all_objects_internal(), sm_flush_and_decache_objects(), sm_get_attribute_descriptor(), sm_get_class(), sm_get_class_with_statistics(), sm_get_method_descriptor(), sm_get_statistics_force(), sm_update_statistics(), smt_add_super(), smt_copy_class_mop(), smt_edit_class_mop(), vid_encode_object(), and ws_identifier_with_check().
|
static |
Definition at line 364 of file compactdb.c.
References catalog_drop_old_representations(), class_objects, COMPACTDB_MSG_CLASS, COMPACTDB_MSG_INSTANCES, COMPACTDB_MSG_OID, desc_disk_to_obj(), desc_free(), DONT_DECACHE, failed_objects, vfid::fileid, i, 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(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, NULL_FILEID, lc_copyarea_manyobjs::num_objs, lc_copyarea_oneobj::oid, OID_SET_NULL, db_identifier::pageid, process_object(), S_LOCK, db_identifier::slotid, sm_ch_heap(), sm_ch_name(), sm_destroy_representations(), total_objects, hfid::vfid, db_identifier::volid, ws_find(), and ws_oid().
Referenced by compactdb_start().
|
static |
Definition at line 495 of file compactdb.c.
References sm_class::attributes, desc_obj::class_, desc_obj::classop, COMPACTDB_MSG_OID, COMPACTDB_MSG_UPDATING, disk_update_instance(), sm_attribute::header, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, sm_component::next, db_identifier::pageid, process_value(), db_identifier::slotid, desc_obj::updated_flag, desc_obj::values, db_identifier::volid, and ws_oid().
Referenced by process_class().
|
static |
Definition at line 612 of file compactdb.c.
References NULL, process_value(), set_iterate(), set_iterator_free(), set_iterator_next(), and set_iterator_value().
Referenced by process_value().
|
static |
Definition at line 537 of file compactdb.c.
References COMPACTDB_MSG_REFOID, db_get_object(), db_get_oid(), db_get_set(), DB_TYPE_BLOB, DB_TYPE_CLOB, DB_TYPE_MULTISET, DB_TYPE_NULL, DB_TYPE_OBJECT, DB_TYPE_OID, DB_TYPE_POINTER, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_VALUE_TYPE, heap_get_visible_version(), heap_scancache_end(), heap_scancache_quick_start(), logtb_get_mvcc_snapshot(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, heap_scancache::mvcc_snapshot, NULL, NULL_CHN, OID_ISNULL, OID_SET_NULL, db_identifier::pageid, PEEK, process_set(), S_SUCCESS, db_identifier::slotid, db_identifier::volid, and WS_OID.
Referenced by process_object(), and process_set().
Definition at line 772 of file compactdb.c.
References COPY, ER_FAILED, heap_clean_get_context(), heap_get_last_version(), heap_init_get_context(), heap_scancache_end(), heap_scancache_quick_start(), locator_update_index(), NULL, NULL_CHN, S_SUCCESS, SINGLE_ROW_UPDATE, and success().
Referenced by disk_update_instance().
|
static |
Definition at line 55 of file compactdb.c.
Referenced by process_class().
Definition at line 58 of file compactdb.c.
|
static |
Definition at line 57 of file compactdb.c.
Referenced by compactdb_start(), process_class(), and sboot_compact_db().
|
static |
Definition at line 56 of file compactdb.c.
Referenced by compactdb_start(), process_class(), and sboot_compact_db().