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 "schema_manager.h"
#include "object_accessor.h"
#include "set_object.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 "execute_schema.h"
#include "object_primitive.h"
Go to the source code of this file.
Macros | |
#define | COMPACT_MIN_PAGES 1 |
#define | COMPACT_MAX_PAGES 20 |
#define | COMPACT_INSTANCE_MIN_LOCK_TIMEOUT 1 |
#define | COMPACT_INSTANCE_MAX_LOCK_TIMEOUT 10 |
#define | COMPACT_CLASS_MIN_LOCK_TIMEOUT 1 |
#define | COMPACT_CLASS_MAX_LOCK_TIMEOUT 10 |
Functions | |
static int | is_not_system_class (MOBJ class_) |
static int | do_reclaim_addresses (OID *const *class_oids, const int num_class_oids, int *const num_classes_fully_processed, const bool verbose, const int class_lock_timeout) |
static int | do_reclaim_class_addresses (const OID class_oid, char **clas_name, bool *const any_class_can_be_referenced, bool *const correctly_processed, bool *const addresses_reclaimed, int *const error_while_processing) |
static int | class_instances_can_be_referenced (MOP mop, MOP parent_mop, bool *const class_can_be_referenced, bool *const any_class_can_be_referenced, MOP *const all_mops, const int num_mops) |
static int | class_referenced_by_class (MOP referenced_mop, MOP parent_mop, MOP referring_mop, bool *const class_can_be_referenced, bool *const any_class_can_be_referenced) |
static int | class_referenced_by_attributes (MOP referenced_class, MOP parent_mop, SM_ATTRIBUTE *const attributes_list, bool *const class_can_be_referenced, bool *const any_class_can_be_referenced) |
static void | class_referenced_by_domain (MOP referenced_class, TP_DOMAIN *const domain, bool *const class_can_be_referenced, bool *const any_class_can_be_referenced) |
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) |
static void | compactdb_usage (const char *argv0) |
static int | find_oid (OID *oid, OID **oids_list, int num_oids) |
static void | show_statistics (OID *class_oid, bool unlocked_class, bool valid_class, bool processed_class, int total_objects, int failed_objects, int modified_objects, int big_objects, bool delete_old_repr_flag, bool old_repr_deleted) |
static char * | get_name_from_class_oid (OID *class_oid) |
static int | compactdb_start (bool verbose_flag, bool delete_old_repr_flag, char *input_filename, char **input_class_names, int input_class_length, int max_processed_space, int instance_lock_timeout, int class_lock_timeout, DB_TRAN_ISOLATION tran_isolation) |
int | compactdb (UTIL_FUNCTION_ARG *arg) |
#define COMPACT_CLASS_MAX_LOCK_TIMEOUT 10 |
Definition at line 52 of file compactdb_cl.c.
Referenced by compactdb().
#define COMPACT_CLASS_MIN_LOCK_TIMEOUT 1 |
Definition at line 51 of file compactdb_cl.c.
Referenced by compactdb().
#define COMPACT_INSTANCE_MAX_LOCK_TIMEOUT 10 |
Definition at line 49 of file compactdb_cl.c.
Referenced by compactdb().
#define COMPACT_INSTANCE_MIN_LOCK_TIMEOUT 1 |
Definition at line 48 of file compactdb_cl.c.
Referenced by compactdb().
#define COMPACT_MAX_PAGES 20 |
Definition at line 46 of file compactdb_cl.c.
Referenced by compactdb().
#define COMPACT_MIN_PAGES 1 |
Definition at line 45 of file compactdb_cl.c.
Referenced by compactdb().
|
static |
Definition at line 1289 of file compactdb_cl.c.
References assert, class_referenced_by_class(), i, NO_ERROR, and NULL.
Referenced by do_reclaim_class_addresses().
|
static |
Definition at line 1409 of file compactdb_cl.c.
References class_referenced_by_domain(), sm_attribute::domain, sm_attribute::header, sm_component::next, NO_ERROR, and NULL.
Referenced by class_referenced_by_class().
|
static |
Definition at line 1324 of file compactdb_cl.c.
References assert, sm_class::attributes, sm_class::class_attributes, class_referenced_by_attributes(), sm_class::class_type, DB_FETCH_READ, er_errid(), ER_FAILED, sm_class::flags, locator_fetch_class(), NO_ERROR, NULL, sm_class::shared, SM_CLASS_CT, and SM_CLASSFLAG_SYSTEM.
Referenced by class_instances_can_be_referenced().
|
static |
Definition at line 1438 of file compactdb_cl.c.
References assert, db_domain_class(), db_domain_next(), db_domain_set(), db_is_subclass(), DB_TYPE_OBJECT, NULL, pr_is_set_type(), and TP_DOMAIN_TYPE.
Referenced by class_referenced_by_attributes().
int compactdb | ( | UTIL_FUNCTION_ARG * | arg | ) |
Definition at line 784 of file compactdb_cl.c.
References UTIL_FUNCTION_ARG::arg_map, UTIL_FUNCTION_ARG::argv0, AU_DISABLE_PASSWORDS, UTIL_FUNCTION_ARG::command_name, COMPACT_CLASS_LOCK_TIMEOUT_S, COMPACT_CLASS_MAX_LOCK_TIMEOUT, COMPACT_CLASS_MIN_LOCK_TIMEOUT, COMPACT_DELETE_OLD_REPR_S, COMPACT_INPUT_CLASS_FILE_S, COMPACT_INSTANCE_LOCK_TIMEOUT_S, COMPACT_INSTANCE_MAX_LOCK_TIMEOUT, COMPACT_INSTANCE_MIN_LOCK_TIMEOUT, COMPACT_MAX_PAGES, COMPACT_MIN_PAGES, COMPACT_PAGES_COMMITED_ONCE_S, COMPACT_STANDBY_CS_MODE_S, compact_usage(), COMPACT_VERBOSE_S, COMPACTDB_MSG_FAILURE, COMPACTDB_MSG_OUT_OF_RANGE_CLASS_LOCK_TIMEOUT, COMPACTDB_MSG_OUT_OF_RANGE_INSTANCE_LOCK_TIMEOUT, COMPACTDB_MSG_OUT_OF_RANGE_PAGES, compactdb_start(), compactdb_usage(), database_name, DB_CLIENT_TYPE_ADMIN_COMPACTDB_WOS, DB_CLIENT_TYPE_ADMIN_UTILITY, db_error_string(), db_login(), DB_PAGESIZE, db_restart(), db_set_client_type(), db_set_isolation(), db_shutdown(), ER_FAILED, ER_GENERIC_ERROR, error(), i, input_filename, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, OPTION_STRING_TABLE, PRINT_AND_LOG_ERR_MSG, prm_get_name(), PRM_ID_JAVA_STORED_PROCEDURE, sysprm_set_force(), TRAN_DEFAULT_ISOLATION_LEVEL, TRUE, util_log_write_errstr(), utility_get_option_bool_value(), utility_get_option_int_value(), utility_get_option_string_table_size(), utility_get_option_string_value(), and verbose_flag.
|
static |
Definition at line 253 of file compactdb_cl.c.
References boot_compact_classes(), boot_heap_compact(), sm_class::class_type, compact_db_start(), compact_db_stop(), COMPACTDB_INVALID_CLASS, COMPACTDB_LOCKED_CLASS, COMPACTDB_MSG_ALREADY_STARTED, COMPACTDB_MSG_CLASS, COMPACTDB_MSG_HEAP_COMPACT_FAILED, COMPACTDB_MSG_HEAP_COMPACT_SUCCEEDED, COMPACTDB_MSG_ISOLATION_LEVEL_FAILURE, COMPACTDB_MSG_NOTHING_TO_PROCESS, COMPACTDB_MSG_PASS1, COMPACTDB_MSG_PASS2, COMPACTDB_MSG_PASS3, COMPACTDB_MSG_UNKNOWN_CLASS_NAME, COMPACTDB_REPR_DELETED, COMPACTDB_UNPROCESSED_CLASS, COPY_OID, db_abort_transaction(), db_commit_transaction(), DB_FETCH_QUERY_READ, db_set_isolation(), DB_SIZEOF, DECACHE, do_reclaim_addresses(), ER_COMPACTDB_ALREADY_STARTED, ER_FAILED, ER_LK_UNILATERALLY_ABORTED, error(), failed_objects, find_oid(), free_and_init, get_class_mops(), get_class_mops_from_file(), get_name_from_class_oid(), i, locator_flush_all_instances(), locator_free_list_mops(), locator_get_all_mops(), list_mops::mops, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, NULL_REPRID, list_mops::num, OID_ISNULL, OID_SET_NULL, show_statistics(), SM_CLASS_CT, sm_destroy_representations(), sm_Root_class_mop, total_objects, tran_abort_only_client(), tran_reset_wait_times(), ws_find(), and ws_oid().
Referenced by compactdb().
|
static |
Definition at line 81 of file compactdb_cl.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().
|
static |
Definition at line 930 of file compactdb_cl.c.
References assert, COMPACTDB_MSG_CLASS, COMPACTDB_MSG_RECLAIM_ERROR, COMPACTDB_MSG_RECLAIM_SKIPPED, COMPACTDB_MSG_RECLAIMED, COMPACTDB_MSG_UNKNOWN_CLASS_NAME, do_reclaim_class_addresses(), free_and_init, i, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, strlen, and tran_reset_wait_times().
Referenced by compactdb_start().
|
static |
Definition at line 1015 of file compactdb_cl.c.
References assert, class_instances_can_be_referenced(), db_abort_transaction(), db_commit_transaction(), DB_FETCH_CLREAD_INSTREAD, DB_FETCH_QUERY_WRITE, DB_FETCH_WRITE, db_object(), db_set_isolation(), DECACHE, do_get_partition_parent(), er_errid(), ER_FAILED, ER_LK_UNILATERALLY_ABORTED, heap_reclaim_addresses(), HFID_IS_NULL, is_class(), is_not_system_class(), locator_fetch_class(), locator_flush_all_instances(), locator_free_list_mops(), locator_get_all_class_mops(), locator_is_class(), list_mops::mops, NO_ERROR, NULL, list_mops::num, OID_ISNULL, sm_ch_heap(), sm_ch_name(), SM_CLASS_CT, SM_CLASSFLAG_REUSE_OID, SM_CLASSFLAG_SYSTEM, sm_Root_class_mop, strdup(), tran_abort_only_client(), and TRAN_READ_COMMITTED.
Referenced by do_reclaim_addresses().
Definition at line 98 of file compactdb_cl.c.
References i, NULL, and OID_EQ.
Referenced by compactdb_start().
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.
References COMPACTDB_MSG_CLASS, COMPACTDB_MSG_INVALID_CLASS, DB_SIZEOF, ER_FAILED, error(), i, locator_find_class(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NO_ERROR, NULL, sm_downcase_name(), SM_MAX_IDENTIFIER_LENGTH, and strlen.
Referenced by compactdb_start(), and get_class_mops_from_file().
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.
References CAST_BUFLEN, DB_MAX_IDENTIFIER_LENGTH, DB_SIZEOF, ER_FAILED, free_and_init, get_class_mops(), get_num_requested_class(), i, NO_ERROR, NULL, and strlen.
Referenced by compactdb_start().
|
static |
Definition at line 208 of file compactdb_cl.c.
References db_get_class_name(), db_object(), NULL, and strlen.
Referenced by compactdb_start().
|
static |
Definition at line 1009 of file compactdb_cl.c.
References SM_CLASSFLAG_SYSTEM.
Referenced by do_reclaim_class_addresses().
|
static |
Definition at line 137 of file compactdb_cl.c.
References COMPACTDB_MSG_BIG_OBJECTS, COMPACTDB_MSG_CLASS, COMPACTDB_MSG_FAILED_OBJECTS, COMPACTDB_MSG_INVALID_CLASS, COMPACTDB_MSG_LOCKED_CLASS, COMPACTDB_MSG_MODIFIED_OBJECTS, COMPACTDB_MSG_PROCESS_CLASS_ERROR, COMPACTDB_MSG_REPR_CANT_DELETE, COMPACTDB_MSG_REPR_DELETED, COMPACTDB_MSG_TOTAL_OBJECTS, COMPACTDB_MSG_UNKNOWN_CLASS_NAME, db_get_class_name(), db_object(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMPACTDB, NULL, and strlen.
Referenced by compactdb_start().