CUBRID Engine
latest
|
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "system_catalog.h"
#include "error_manager.h"
#include "file_manager.h"
#include "log_append.hpp"
#include "slotted_page.h"
#include "extendible_hash.h"
#include "boot_sr.h"
#include "btree_load.h"
#include "heap_file.h"
#include "xserver_interface.h"
#include "statistics_sr.h"
#include "partition_sr.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "thread_lockfree_hash_map.hpp"
#include "thread_manager.hpp"
Go to the source code of this file.
Classes | |
struct | catalog_max_space |
struct | catalog_key |
struct | catalog_entry |
struct | catalog_class_id_list |
struct | catalog_record |
struct | catalog_page_header |
struct | catalog_repr_item |
struct | catalog_find_optimal_page_context |
struct | catalog_page_dump_context |
Typedefs | |
typedef struct catalog_max_space | CATALOG_MAX_SPACE |
typedef struct catalog_key | CATALOG_KEY |
typedef struct catalog_entry | CATALOG_ENTRY |
typedef struct catalog_class_id_list | CATALOG_CLASS_ID_LIST |
typedef struct catalog_record | CATALOG_RECORD |
typedef struct catalog_page_header | CATALOG_PAGE_HEADER |
typedef struct catalog_repr_item | CATALOG_REPR_ITEM |
using | catalog_hashmap_type = cubthread::lockfree_hashmap< catalog_key, catalog_entry > |
typedef struct catalog_find_optimal_page_context | CATALOG_FIND_OPTIMAL_PAGE_CONTEXT |
typedef struct catalog_page_dump_context | CATALOG_PAGE_DUMP_CONTEXT |
Variables | |
static int | rv |
static LF_ENTRY_DESCRIPTOR | catalog_entry_Descriptor |
CTID | catalog_Id |
static PGLENGTH | catalog_Max_record_size |
static catalog_hashmap_type | catalog_Hashmap |
static CATALOG_MAX_SPACE | catalog_Max_space |
static pthread_mutex_t | catalog_Max_space_lock = PTHREAD_MUTEX_INITIALIZER |
static bool | catalog_is_header_initialized = false |
#define CATALOG_BT_STATS_BTID_OFF 0 |
Definition at line 116 of file system_catalog.c.
Referenced by catalog_put_btree_statistics().
#define CATALOG_BT_STATS_FUNC_INDEX_OFF 28 |
Definition at line 121 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_HEIGHT_OFF 20 |
Definition at line 119 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_KEYS_OFF 24 |
Definition at line 120 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_LEAFS_OFF OR_BTID_ALIGNED_SIZE |
Definition at line 117 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_PAGES_OFF 16 |
Definition at line 118 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_PKEYS_OFF 32 |
Definition at line 122 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_RESERVED_OFF (CATALOG_BT_STATS_PKEYS_OFF + (OR_INT_SIZE * BTREE_STATS_PKEYS_NUM)) /* 64 */ |
Definition at line 123 of file system_catalog.c.
Referenced by catalog_get_btree_statistics(), and catalog_put_btree_statistics().
#define CATALOG_BT_STATS_SIZE (CATALOG_BT_STATS_RESERVED_OFF + (OR_INT_SIZE * BTREE_STATS_RESERVED_NUM)) /* 64 + (4 * R_NUM) = 80 */ |
Definition at line 124 of file system_catalog.c.
Referenced by catalog_fetch_btree_statistics(), catalog_store_btree_statistics(), and catalog_sum_disk_attribute_size().
#define CATALOG_CLS_INFO_HFID_OFF 0 |
Definition at line 129 of file system_catalog.c.
Referenced by catalog_get_class_info_from_record(), and catalog_put_class_info_to_record().
#define CATALOG_CLS_INFO_REP_DIR_OFF 24 |
Definition at line 133 of file system_catalog.c.
Referenced by catalog_get_class_info_from_record(), and catalog_put_class_info_to_record().
#define CATALOG_CLS_INFO_RESERVED 24 |
Definition at line 135 of file system_catalog.c.
Referenced by catalog_add_class_info(), and catalog_update_class_info().
#define CATALOG_CLS_INFO_SIZE 56 |
Definition at line 134 of file system_catalog.c.
Referenced by catalog_add_class_info(), catalog_get_class_info(), and catalog_update_class_info().
#define CATALOG_CLS_INFO_TIME_STAMP_OFF 20 |
Definition at line 132 of file system_catalog.c.
Referenced by catalog_get_class_info_from_record(), and catalog_put_class_info_to_record().
#define CATALOG_CLS_INFO_TOT_OBJS_OFF 16 |
Definition at line 131 of file system_catalog.c.
Referenced by catalog_get_class_info_from_record(), and catalog_put_class_info_to_record().
#define CATALOG_CLS_INFO_TOT_PAGES_OFF 12 |
Definition at line 130 of file system_catalog.c.
Referenced by catalog_get_class_info_from_record(), and catalog_put_class_info_to_record().
#define CATALOG_DISK_ATTR_CLASSOID_OFF 20 |
Definition at line 112 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_ATTR_ID_OFF 0 |
Definition at line 107 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_ATTR_LOCATION_OFF 4 |
Definition at line 108 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_ATTR_N_BTSTATS_OFF 28 |
Definition at line 113 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_ATTR_POSITION_OFF 16 |
Definition at line 111 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_ATTR_SIZE 80 |
Definition at line 114 of file system_catalog.c.
Referenced by catalog_fetch_disk_attribute(), catalog_store_disk_attribute(), and catalog_sum_disk_attribute_size().
#define CATALOG_DISK_ATTR_TYPE_OFF 8 |
Definition at line 109 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_ATTR_VAL_LENGTH_OFF 12 |
Definition at line 110 of file system_catalog.c.
Referenced by catalog_get_disk_attribute(), and catalog_put_disk_attribute().
#define CATALOG_DISK_REPR_FIXED_LENGTH_OFF 8 |
Definition at line 98 of file system_catalog.c.
Referenced by catalog_get_disk_representation(), and catalog_put_disk_representation().
#define CATALOG_DISK_REPR_ID_OFF 0 |
Definition at line 96 of file system_catalog.c.
Referenced by catalog_get_disk_representation(), and catalog_put_disk_representation().
#define CATALOG_DISK_REPR_N_FIXED_OFF 4 |
Definition at line 97 of file system_catalog.c.
Referenced by catalog_get_disk_representation(), and catalog_put_disk_representation().
#define CATALOG_DISK_REPR_N_VARIABLE_OFF 12 |
Definition at line 99 of file system_catalog.c.
Referenced by catalog_get_disk_representation(), and catalog_put_disk_representation().
#define CATALOG_DISK_REPR_RESERVED_1_OFF 16 /* reserved for future use */ |
Definition at line 100 of file system_catalog.c.
Referenced by catalog_get_disk_representation(), and catalog_put_disk_representation().
#define CATALOG_DISK_REPR_SIZE 56 |
Definition at line 101 of file system_catalog.c.
Referenced by catalog_add_representation(), catalog_fetch_disk_representation(), and catalog_store_disk_representation().
#define CATALOG_GET_BT_STATS_BTID | ( | var, | |
ptr | |||
) | OR_GET_BTID((ptr) + CATALOG_BT_STATS_BTID_OFF, (var)) |
Definition at line 126 of file system_catalog.c.
Referenced by catalog_fetch_btree_statistics().
#define CATALOG_GET_PGHEADER_DIR_COUNT | ( | ptr | ) | (int) OR_GET_INT ((ptr) + CATALOG_PGHEADER_DIR_CNT_OFF) |
Definition at line 76 of file system_catalog.c.
Referenced by catalog_adjust_directory_count(), catalog_file_map_find_optimal_page(), and catalog_file_map_page_dump().
#define CATALOG_GET_PGHEADER_OVFL_PGID_PAGEID | ( | ptr | ) | (PAGEID) OR_GET_INT ((ptr) + CATALOG_PGHEADER_OVFL_PGID_PAGEID_OFF) |
Definition at line 70 of file system_catalog.c.
Referenced by catalog_drop_representation_helper(), catalog_file_map_find_optimal_page(), catalog_file_map_overflow_count(), catalog_file_map_page_dump(), and catalog_get_record_from_page().
#define CATALOG_GET_PGHEADER_OVFL_PGID_VOLID | ( | ptr | ) | (VOLID) OR_GET_SHORT ((ptr) + CATALOG_PGHEADER_OVFL_PGID_VOLID_OFF) |
Definition at line 73 of file system_catalog.c.
Referenced by catalog_drop_representation_helper(), catalog_file_map_page_dump(), and catalog_get_record_from_page().
#define CATALOG_GET_PGHEADER_PG_OVFL | ( | ptr | ) | (bool) OR_GET_INT ((ptr) + CATALOG_PGHEADER_PG_OVFL_OFF) |
Definition at line 79 of file system_catalog.c.
Referenced by catalog_file_map_find_optimal_page().
#define CATALOG_GET_REPR_ITEM_COUNT | ( | ptr | ) | (PGSLOTID) OR_GET_BYTE ((ptr) + CATALOG_REPR_ITEM_COUNT_OFF) |
Definition at line 157 of file system_catalog.c.
Referenced by catalog_get_representation_record().
#define CATALOG_GET_REPR_ITEM_PAGEID_PAGEID | ( | ptr | ) | (PAGEID) OR_GET_INT ((ptr) + CATALOG_REPR_ITEM_PAGEID_PAGEID_OFF) |
Definition at line 145 of file system_catalog.c.
Referenced by catalog_check_class_consistency(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_item(), catalog_get_representation_item(), and catalog_put_representation_item().
#define CATALOG_GET_REPR_ITEM_PAGEID_VOLID | ( | ptr | ) | (VOLID) OR_GET_SHORT ((ptr) + CATALOG_REPR_ITEM_PAGEID_VOLID_OFF) |
Definition at line 148 of file system_catalog.c.
Referenced by catalog_check_class_consistency(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_item(), catalog_get_representation_item(), and catalog_put_representation_item().
#define CATALOG_GET_REPR_ITEM_REPRID | ( | ptr | ) | (REPR_ID) OR_GET_SHORT ((ptr) + CATALOG_REPR_ITEM_REPRID_OFF) |
Definition at line 151 of file system_catalog.c.
Referenced by catalog_check_class_consistency(), catalog_drop_all(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_find_representation_item_position(), catalog_get_last_representation_id(), and catalog_get_representation_directory().
#define CATALOG_GET_REPR_ITEM_SLOTID | ( | ptr | ) | (PGSLOTID) OR_GET_SHORT ((ptr) + CATALOG_REPR_ITEM_SLOTID_OFF) |
Definition at line 154 of file system_catalog.c.
Referenced by catalog_check_class_consistency(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_item(), catalog_get_representation_item(), and catalog_put_representation_item().
#define CATALOG_HASH_SIZE 1000 |
Definition at line 59 of file system_catalog.c.
Referenced by catalog_initialize().
#define CATALOG_HEADER_SLOT 0 |
Definition at line 57 of file system_catalog.c.
Referenced by catalog_adjust_directory_count(), catalog_drop_representation_helper(), catalog_file_map_find_optimal_page(), catalog_file_map_overflow_count(), catalog_file_map_page_dump(), catalog_get_record_from_page(), catalog_initialize_new_page(), catalog_put_record_into_page(), and catalog_rv_new_page_redo().
#define CATALOG_KEY_VALUE_ARRAY_SIZE 1000 |
Definition at line 60 of file system_catalog.c.
#define CATALOG_MAX_SLOT_ID_SIZE 12 |
Definition at line 58 of file system_catalog.c.
Referenced by catalog_add_representation(), catalog_file_map_find_optimal_page(), catalog_find_optimal_page(), catalog_initialize(), and catalog_put_record_into_page().
#define CATALOG_PAGE_HEADER_SIZE 16 |
Definition at line 67 of file system_catalog.c.
Referenced by catalog_initialize(), catalog_initialize_new_page(), catalog_put_representation_item(), and catalog_rv_new_page_redo().
#define CATALOG_PGHEADER_DIR_CNT_OFF 8 |
Definition at line 64 of file system_catalog.c.
#define CATALOG_PGHEADER_OVFL_PGID_PAGEID_OFF 0 |
Definition at line 62 of file system_catalog.c.
#define CATALOG_PGHEADER_OVFL_PGID_VOLID_OFF 4 |
Definition at line 63 of file system_catalog.c.
#define CATALOG_PGHEADER_PG_OVFL_OFF 12 |
Definition at line 65 of file system_catalog.c.
#define CATALOG_PUT_PGHEADER_DIR_COUNT | ( | ptr, | |
val | |||
) | OR_PUT_INT ((ptr) + CATALOG_PGHEADER_DIR_CNT_OFF, (val)) |
Definition at line 89 of file system_catalog.c.
Referenced by catalog_adjust_directory_count(), and catalog_put_page_header().
#define CATALOG_PUT_PGHEADER_OVFL_PGID_PAGEID | ( | ptr, | |
val | |||
) | OR_PUT_INT ((ptr) + CATALOG_PGHEADER_OVFL_PGID_PAGEID_OFF, (val)) |
Definition at line 83 of file system_catalog.c.
Referenced by catalog_drop_representation_helper(), catalog_put_page_header(), and catalog_put_record_into_page().
#define CATALOG_PUT_PGHEADER_OVFL_PGID_VOLID | ( | ptr, | |
val | |||
) | OR_PUT_SHORT ((ptr) + CATALOG_PGHEADER_OVFL_PGID_VOLID_OFF, (val)) |
Definition at line 86 of file system_catalog.c.
Referenced by catalog_drop_representation_helper(), catalog_put_page_header(), and catalog_put_record_into_page().
#define CATALOG_PUT_PGHEADER_PG_OVFL | ( | ptr, | |
val | |||
) | OR_PUT_INT ((ptr) + CATALOG_PGHEADER_PG_OVFL_OFF, (int) (val)) |
Definition at line 92 of file system_catalog.c.
Referenced by catalog_put_page_header().
#define CATALOG_REPR_ITEM_COUNT_OFF 12 |
Definition at line 141 of file system_catalog.c.
Referenced by catalog_drop_old_representations(), catalog_drop_representation_item(), catalog_insert_representation_item(), and catalog_put_representation_item().
#define CATALOG_REPR_ITEM_INITIALIZER { { NULL_PAGEID, NULL_VOLID }, NULL_REPRID, NULL_SLOTID } |
Definition at line 257 of file system_catalog.c.
Referenced by catalog_add_class_info(), catalog_add_representation(), catalog_drop_representation_item(), catalog_get_class_info(), catalog_get_rep_dir(), and catalog_update_class_info().
#define CATALOG_REPR_ITEM_PAGEID_PAGEID_OFF 0 |
Definition at line 137 of file system_catalog.c.
Referenced by catalog_get_repr_item_from_record(), and catalog_put_repr_item_to_record().
#define CATALOG_REPR_ITEM_PAGEID_VOLID_OFF 4 |
Definition at line 138 of file system_catalog.c.
Referenced by catalog_get_repr_item_from_record(), and catalog_put_repr_item_to_record().
#define CATALOG_REPR_ITEM_REPRID_OFF 8 |
Definition at line 139 of file system_catalog.c.
Referenced by catalog_get_repr_item_from_record(), and catalog_put_repr_item_to_record().
#define CATALOG_REPR_ITEM_SIZE 16 |
Definition at line 143 of file system_catalog.c.
Referenced by catalog_check_class_consistency(), catalog_drop_all(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_item(), catalog_find_representation_item_position(), catalog_get_last_representation_id(), catalog_get_representation_directory(), catalog_get_representation_record(), catalog_insert_representation_item(), and catalog_put_representation_item().
#define CATALOG_REPR_ITEM_SLOTID_OFF 10 |
Definition at line 140 of file system_catalog.c.
Referenced by catalog_get_repr_item_from_record(), and catalog_put_repr_item_to_record().
#define pthread_mutex_destroy | ( | a | ) |
Definition at line 50 of file system_catalog.c.
#define pthread_mutex_init | ( | a, | |
b | |||
) |
Definition at line 49 of file system_catalog.c.
#define pthread_mutex_lock | ( | a | ) | 0 |
Definition at line 51 of file system_catalog.c.
Referenced by catalog_find_optimal_page(), catalog_initialize_max_space(), and catalog_update_max_space().
#define pthread_mutex_trylock | ( | a | ) | 0 |
Definition at line 52 of file system_catalog.c.
#define pthread_mutex_unlock | ( | a | ) |
Definition at line 53 of file system_catalog.c.
Referenced by catalog_find_optimal_page(), catalog_initialize_max_space(), and catalog_update_max_space().
typedef struct catalog_class_id_list CATALOG_CLASS_ID_LIST |
Definition at line 224 of file system_catalog.c.
typedef struct catalog_entry CATALOG_ENTRY |
Definition at line 184 of file system_catalog.c.
Definition at line 277 of file system_catalog.c.
Definition at line 269 of file system_catalog.c.
typedef struct catalog_key CATALOG_KEY |
Definition at line 169 of file system_catalog.c.
typedef struct catalog_max_space CATALOG_MAX_SPACE |
Definition at line 161 of file system_catalog.c.
typedef struct catalog_page_dump_context CATALOG_PAGE_DUMP_CONTEXT |
Definition at line 295 of file system_catalog.c.
typedef struct catalog_page_header CATALOG_PAGE_HEADER |
Definition at line 241 of file system_catalog.c.
typedef struct catalog_record CATALOG_RECORD |
Definition at line 231 of file system_catalog.c.
typedef struct catalog_repr_item CATALOG_REPR_ITEM |
Definition at line 249 of file system_catalog.c.
int catalog_add_class_info | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
CLS_INFO * | class_info_p, | ||
CATALOG_ACCESS_INFO * | catalog_access_info_p | ||
) |
Definition at line 2985 of file system_catalog.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, CATALOG_ACCESS_INFO_INITIALIZER, CATALOG_CLS_INFO_RESERVED, CATALOG_CLS_INFO_SIZE, catalog_end_access_with_dir_oid(), catalog_find_optimal_page(), catalog_get_dir_oid_from_cache(), catalog_put_class_info_to_record(), catalog_put_representation_item(), CATALOG_REPR_ITEM_INITIALIZER, catalog_start_access_with_dir_oid(), catalog_update_max_space(), cls_info::ci_rep_dir, catalog_access_info::class_oid, recdes::data, DB_PAGESIZE, catalog_access_info::dir_oid, ER_CT_INVALID_CLASSID, ER_ERROR_SEVERITY, ER_FAILED, er_set(), FREE, recdes::length, log_append_undoredo_recdes2(), NO_ERROR, NULL, NULL_REPRID, OID_ISNULL, OID_ISTEMP, OID_SET_NULL, catalog_repr_item::page_id, db_identifier::pageid, pgbuf_set_dirty(), pgbuf_unfix_and_init, REC_HOME, recdes_allocate_data_area(), recdes_free_data_area(), catalog_repr_item::repr_id, RVCT_INSERT, catalog_repr_item::slot_id, db_identifier::slotid, SP_SUCCESS, spage_insert(), spage_max_space_for_new_record(), success(), ctid::vfid, db_identifier::volid, and X_LOCK.
Referenced by catalog_get_representation(), catalog_insert(), stats_update_partitioned_statistics(), and xstats_update_statistics().
int catalog_add_representation | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
REPR_ID | repr_id, | ||
DISK_REPR * | disk_repr_p, | ||
OID * | rep_dir_p, | ||
CATALOG_ACCESS_INFO * | catalog_access_info_p | ||
) |
Definition at line 2771 of file system_catalog.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, disk_attribute::bt_stats, BTREE_STATS_PKEYS_NUM, CATALOG_ACCESS_INFO_INITIALIZER, CATALOG_DISK_REPR_SIZE, catalog_end_access_with_dir_oid(), catalog_find_optimal_page(), catalog_get_dir_oid_from_cache(), CATALOG_MAX_SLOT_ID_SIZE, catalog_put_record_into_page(), catalog_put_representation_item(), CATALOG_REPR_ITEM_INITIALIZER, catalog_start_access_with_dir_oid(), catalog_store_attribute_value(), catalog_store_btree_statistics(), catalog_store_disk_attribute(), catalog_store_disk_representation(), catalog_sum_disk_attribute_size(), catalog_update_max_space(), catalog_access_info::class_oid, recdes::data, DB_PAGESIZE, db_private_alloc, db_private_free_and_init, catalog_access_info::dir_oid, ER_CT_INVALID_CLASSID, ER_CT_INVALID_REPRID, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), disk_representation::fixed, i, recdes::length, disk_attribute::n_btstats, disk_representation::n_fixed, disk_representation::n_variable, NO_ERROR, NULL, NULL_REPRID, NULL_SLOTID, catalog_record::offset, OID_ISNULL, OID_ISTEMP, catalog_repr_item::page_id, catalog_record::page_p, vpid::pageid, db_identifier::pageid, pgbuf_unfix_and_init, btree_stats::pkeys_size, REC_HOME, catalog_record::recdes, catalog_repr_item::repr_id, catalog_repr_item::slot_id, catalog_record::slotid, db_identifier::slotid, spage_max_space_for_new_record(), recdes::type, disk_attribute::val_length, disk_attribute::value, disk_representation::variable, vpid::volid, db_identifier::volid, catalog_record::vpid, and X_LOCK.
Referenced by catalog_insert(), catalog_update(), stats_update_partitioned_statistics(), xcatalog_check_rep_dir(), and xstats_update_statistics().
|
static |
Definition at line 1939 of file system_catalog.c.
References CATALOG_GET_PGHEADER_DIR_COUNT, CATALOG_HEADER_SLOT, CATALOG_PUT_PGHEADER_DIR_COUNT, COPY, recdes::data, ER_FAILED, log_append_redo_recdes2(), log_append_undo_recdes2(), NO_ERROR, PAGE_CATALOG, pgbuf_check_page_ptype(), RVCT_UPDATE, SP_SUCCESS, spage_get_record(), spage_update(), and ctid::vfid.
Referenced by catalog_drop_directory(), catalog_insert_representation_item(), and catalog_put_representation_item().
|
static |
Definition at line 3758 of file system_catalog.c.
References disk_attribute::bt_stats, catalog_fetch_attribute_value(), catalog_fetch_btree_statistics(), catalog_fetch_disk_attribute(), db_private_alloc, ER_FAILED, i, disk_attribute::n_btstats, NO_ERROR, NULL, btree_stats::pkeys, disk_attribute::val_length, and disk_attribute::value.
Referenced by catalog_get_representation().
|
static |
Definition at line 4558 of file system_catalog.c.
References recdes::area_size, ARG_FILE_LINE, assert, catalog_get_class_info_from_record(), catalog_get_rep_dir(), CATALOG_GET_REPR_ITEM_PAGEID_PAGEID, CATALOG_GET_REPR_ITEM_PAGEID_VOLID, CATALOG_GET_REPR_ITEM_REPRID, CATALOG_GET_REPR_ITEM_SLOTID, catalog_get_representation_record(), CATALOG_REPR_ITEM_SIZE, cls_info::ci_rep_dir, CLS_INFO_INITIALIZER, recdes::data, DISK_ERROR, DISK_VALID, ER_CT_MISSING_REPR_DIR, ER_CT_MISSING_REPR_INFO, er_errid(), ER_ERROR_SEVERITY, ER_HEAP_UNKNOWN_OBJECT, ER_PB_BAD_PAGEID, er_set(), file_check_vpid(), i, NO_ERROR, NULL, NULL_REPRID, OID_EQ, OID_ISNULL, OID_SET_NULL, OLD_PAGE, PAGE_CATALOG, catalog_repr_item::page_id, vpid::pageid, db_identifier::pageid, PEEK, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, catalog_repr_item::repr_id, S_SUCCESS, catalog_repr_item::slot_id, db_identifier::slotid, spage_get_record(), ctid::vfid, vpid::volid, and db_identifier::volid.
Referenced by catalog_check_consistency().
DISK_ISVALID catalog_check_consistency | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 4671 of file system_catalog.c.
References ARG_FILE_LINE, assert, boot_find_root_heap(), catalog_check_class_consistency(), DISK_ERROR, DISK_VALID, er_log_debug, heap_next(), heap_scancache_end(), heap_scancache_start(), HFID_IS_NULL, LK_COND_LOCK, LK_GRANTED, lock_object(), lock_unlock_object(), logtb_get_mvcc_snapshot(), NO_ERROR, NULL, NULL_PAGEID, NULL_SLOTID, OID_AS_ARGS, oid_Root_class_oid, or_class_name(), db_identifier::pageid, PEEK, RECDES_INITIALIZER, S_SUCCESS, SCH_S_LOCK, db_identifier::slotid, strlen, hfid::vfid, vfid::volid, and db_identifier::volid.
Referenced by xboot_check_db_consistency().
|
static |
Definition at line 5134 of file system_catalog.c.
References cubthread::lockfree_hashmap< Key, T >::clear().
Referenced by catalog_rv_delete_redo(), catalog_rv_delete_undo(), catalog_rv_insert_redo(), catalog_rv_insert_undo(), catalog_rv_new_page_redo(), catalog_rv_ovf_page_logical_insert_undo(), and catalog_rv_update().
|
static |
Definition at line 2459 of file system_catalog.c.
References assert, btree_stats::btid, BTID_IS_EQUAL, BTREE_STATS_PKEYS_NUM, BTREE_STATS_RESERVED_NUM, btree_stats::height, i, btree_stats::key_type, btree_stats::keys, btree_stats::leafs, btree_stats::pages, btree_stats::pkeys, and btree_stats::pkeys_size.
Referenced by catalog_copy_disk_attributes().
|
static |
Definition at line 2500 of file system_catalog.c.
References disk_attribute::bt_stats, catalog_copy_btree_statistic(), i, disk_attribute::id, and disk_attribute::n_btstats.
Referenced by catalog_update().
CTID* catalog_create | ( | THREAD_ENTRY * | thread_p, |
CTID * | catalog_id_p | ||
) |
Definition at line 2586 of file system_catalog.c.
References ASSERT_ERROR, assert_release, catalog_initialize_max_space(), catalog_initialize_new_page(), catalog_is_header_initialized, catalog_update_max_space(), DB_TYPE_OBJECT, error(), file_alloc_sticky_first_page(), FILE_CATALOG, file_create_with_npages(), ctid::hpgid, log_sysop_abort(), log_sysop_attach_to_outer(), log_sysop_start(), NO_ERROR, NULL, oid_Root_class_oid, PAGE_CATALOG, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_get_vpid(), pgbuf_unfix_and_init, spage_max_space_for_new_record(), spage_number_of_records(), ctid::vfid, vpid::volid, vfid::volid, xehash_create(), and ctid::xhid.
Referenced by boot_create_all_volumes().
int catalog_delete | ( | THREAD_ENTRY * | thread_p, |
OID * | class_oid_p | ||
) |
Definition at line 4530 of file system_catalog.c.
References assert, catalog_drop_all_representation_and_class(), er_errid(), and NO_ERROR.
Referenced by locator_delete_force_internal().
|
static |
Definition at line 1960 of file system_catalog.c.
References cubthread::lockfree_hashmap< Key, T >::erase(), catalog_key::page_id, db_identifier::pageid, catalog_key::repr_id, catalog_key::slot_id, db_identifier::slotid, catalog_key::volid, and db_identifier::volid.
Referenced by catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_item(), and catalog_put_representation_item().
|
static |
Definition at line 3251 of file system_catalog.c.
References ASSERT_ERROR_AND_SET, CATALOG_ACCESS_INFO_INITIALIZER, catalog_drop_disk_representation_from_page(), catalog_drop_representation_item(), catalog_end_access_with_dir_oid(), catalog_get_dir_oid_from_cache(), catalog_start_access_with_dir_oid(), catalog_access_info::class_oid, catalog_access_info::dir_oid, ER_FAILED, NO_ERROR, NULL_PAGEID, NULL_SLOTID, NULL_VOLID, catalog_repr_item::page_id, vpid::pageid, catalog_repr_item::repr_id, catalog_repr_item::slot_id, vpid::volid, VPID_SET_NULL, and X_LOCK.
Referenced by catalog_drop_all(), and catalog_update().
|
static |
Definition at line 3306 of file system_catalog.c.
References ARG_FILE_LINE, assert, catalog_drop(), CATALOG_GET_REPR_ITEM_REPRID, catalog_get_representation_record_after_search(), CATALOG_REPR_ITEM_SIZE, COPY, recdes::data, DB_PAGESIZE, ER_CT_INVALID_CLASSID, er_errid(), ER_ERROR_SEVERITY, er_set(), error(), i, NO_ERROR, NULL, NULL_REPRID, OID_ISTEMP, OID_SET_NULL, db_identifier::pageid, PGBUF_LATCH_READ, pgbuf_unfix_and_init, recdes_allocate_data_area(), recdes_free_data_area(), db_identifier::slotid, and db_identifier::volid.
|
static |
Definition at line 3382 of file system_catalog.c.
References ARG_FILE_LINE, assert, CATALOG_ACCESS_INFO_INITIALIZER, catalog_delete_key(), CATALOG_DIR_REPR_KEY, catalog_drop_directory(), catalog_drop_representation_class_from_page(), catalog_end_access_with_dir_oid(), catalog_get_dir_oid_from_cache(), CATALOG_GET_REPR_ITEM_PAGEID_PAGEID, CATALOG_GET_REPR_ITEM_PAGEID_VOLID, CATALOG_GET_REPR_ITEM_REPRID, CATALOG_GET_REPR_ITEM_SLOTID, catalog_get_representation_record_after_search(), CATALOG_REPR_ITEM_SIZE, catalog_start_access_with_dir_oid(), catalog_update_max_space(), catalog_access_info::class_oid, COPY, recdes::data, DB_PAGESIZE, catalog_access_info::dir_oid, ER_CT_INVALID_CLASSID, ER_ERROR_SEVERITY, ER_FAILED, er_set(), FREE, i, NO_ERROR, NULL, OID_ISTEMP, OID_SET_NULL, vpid::pageid, db_identifier::pageid, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_unfix_and_init, recdes_allocate_data_area(), recdes_free_data_area(), db_identifier::slotid, spage_max_space_for_new_record(), vpid::volid, db_identifier::volid, and X_LOCK.
Referenced by catalog_delete().
|
static |
Definition at line 2334 of file system_catalog.c.
References catalog_adjust_directory_count(), ER_FAILED, log_append_undoredo_recdes2(), NO_ERROR, NULL, RVCT_DELETE, db_identifier::slotid, spage_delete(), and ctid::vfid.
Referenced by catalog_drop_all_representation_and_class(), and catalog_drop_representation_item().
|
static |
Definition at line 1679 of file system_catalog.c.
References catalog_drop_representation_helper(), ER_FAILED, FREE, NO_ERROR, NULL, OLD_PAGE, PAGE_CATALOG, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, and pgbuf_unfix_and_init.
Referenced by catalog_drop(), and catalog_put_representation_item().
int catalog_drop_old_representations | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p | ||
) |
Definition at line 3493 of file system_catalog.c.
References ARG_FILE_LINE, assert, CATALOG_ACCESS_INFO_INITIALIZER, catalog_delete_key(), catalog_drop_representation_class_from_page(), catalog_end_access_with_dir_oid(), catalog_get_dir_oid_from_cache(), catalog_get_repr_item_from_record(), CATALOG_GET_REPR_ITEM_PAGEID_PAGEID, CATALOG_GET_REPR_ITEM_PAGEID_VOLID, CATALOG_GET_REPR_ITEM_REPRID, CATALOG_GET_REPR_ITEM_SLOTID, catalog_get_representation_record_after_search(), catalog_put_repr_item_to_record(), CATALOG_REPR_ITEM_COUNT_OFF, CATALOG_REPR_ITEM_SIZE, catalog_start_access_with_dir_oid(), catalog_update_max_space(), catalog_access_info::class_oid, COPY, recdes::data, DB_PAGESIZE, catalog_access_info::dir_oid, ER_CT_INVALID_CLASSID, ER_ERROR_SEVERITY, ER_FAILED, er_set(), FREE, i, recdes::length, log_append_redo_recdes2(), log_append_undo_recdes2(), NO_ERROR, NULL, NULL_PAGEID, NULL_REPRID, NULL_SLOTID, OID_ISTEMP, OID_SET_NULL, OR_PUT_BYTE, catalog_repr_item::page_id, vpid::pageid, db_identifier::pageid, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_unfix_and_init, recdes_allocate_data_area(), recdes_free_data_area(), catalog_repr_item::repr_id, RVCT_UPDATE, catalog_repr_item::slot_id, db_identifier::slotid, SP_SUCCESS, spage_max_space_for_new_record(), spage_update(), ctid::vfid, vpid::volid, db_identifier::volid, VPID_SET_NULL, and X_LOCK.
Referenced by boot_compact_db(), and process_class().
|
static |
Definition at line 1714 of file system_catalog.c.
References ARG_FILE_LINE, assert, catalog_drop_representation_helper(), DONT_FREE, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_PAGE_LATCH_ABORTED, er_set(), FREE, NO_ERROR, NULL, OLD_PAGE, PAGE_CATALOG, vpid::pageid, pgbuf_check_page_ptype(), PGBUF_CONDITIONAL_LATCH, pgbuf_fix, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, vpid::volid, and VPID_EQ.
Referenced by catalog_drop_all_representation_and_class(), and catalog_drop_old_representations().
|
static |
Definition at line 1579 of file system_catalog.c.
References ASSERT_ERROR, CATALOG_GET_PGHEADER_OVFL_PGID_PAGEID, CATALOG_GET_PGHEADER_OVFL_PGID_VOLID, CATALOG_HEADER_SLOT, CATALOG_PUT_PGHEADER_OVFL_PGID_PAGEID, CATALOG_PUT_PGHEADER_OVFL_PGID_VOLID, catalog_update_max_space(), COPY, recdes::data, DB_PAGESIZE, er_errid(), ER_FAILED, ER_SP_UNKNOWN_SLOTID, FILE_CATALOG, file_dealloc(), log_append_redo_recdes2(), log_append_undo_recdes2(), log_append_undoredo_recdes2(), NO_ERROR, NULL, NULL_PAGEID, NULL_VOLID, OLD_PAGE, PAGE_CATALOG, vpid::pageid, PEEK, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_WRITE, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, REC_HOME, recdes_allocate_data_area(), recdes_free_data_area(), RVCT_DELETE, RVCT_UPDATE, S_SUCCESS, SP_SUCCESS, spage_delete(), spage_get_record(), spage_max_space_for_new_record(), spage_update(), ctid::vfid, and vpid::volid.
Referenced by catalog_drop_disk_representation_from_page(), and catalog_drop_representation_class_from_page().
|
static |
Definition at line 2363 of file system_catalog.c.
References ARG_FILE_LINE, assert, catalog_delete_key(), catalog_drop_directory(), catalog_find_representation_item_position(), catalog_get_repr_item_from_record(), CATALOG_GET_REPR_ITEM_PAGEID_PAGEID, CATALOG_GET_REPR_ITEM_PAGEID_VOLID, CATALOG_GET_REPR_ITEM_SLOTID, catalog_get_representation_record_after_search(), catalog_put_repr_item_to_record(), CATALOG_REPR_ITEM_COUNT_OFF, CATALOG_REPR_ITEM_INITIALIZER, CATALOG_REPR_ITEM_SIZE, catalog_update_max_space(), COPY, recdes::data, DB_PAGESIZE, ER_CT_UNKNOWN_REPRID, ER_ERROR_SEVERITY, ER_FAILED, er_set(), FREE, recdes::length, log_append_redo_recdes2(), log_append_undo_recdes2(), NO_ERROR, NULL, OID_SET_NULL, OR_GET_BYTE, OR_PUT_BYTE, catalog_repr_item::page_id, vpid::pageid, db_identifier::pageid, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_unfix_and_init, recdes_allocate_data_area(), recdes_free_data_area(), catalog_repr_item::repr_id, RVCT_UPDATE, catalog_repr_item::slot_id, db_identifier::slotid, SP_SUCCESS, spage_max_space_for_new_record(), spage_update(), ctid::vfid, vpid::volid, and db_identifier::volid.
Referenced by catalog_drop().
void catalog_dump | ( | THREAD_ENTRY * | thread_p, |
FILE * | fp, | ||
int | dump_flag | ||
) |
Definition at line 4972 of file system_catalog.c.
References assert, ASSERT_ERROR, boot_find_root_heap(), catalog_dump_representation(), catalog_file_map_overflow_count(), catalog_file_map_page_dump(), catalog_free_class_info_and_init, catalog_free_representation_and_init, catalog_get_class_info(), catalog_get_representation(), catalog_get_representation_directory(), cls_info::ci_hfid, cls_info::ci_rep_dir, cls_info::ci_tot_objects, cls_info::ci_tot_pages, file_get_num_user_pages(), file_map_pages(), vfid::fileid, catalog_page_dump_context::fp, free_and_init, heap_classrepr_dump_all(), heap_next(), heap_scancache_end(), heap_scancache_start(), HFID_IS_NULL, hfid::hpgid, logtb_get_mvcc_snapshot(), NO_ERROR, NULL, NULL_PAGEID, NULL_REPRID, NULL_SLOTID, oid_Root_class_oid, or_class_name(), catalog_page_dump_context::page_index, db_identifier::pageid, PEEK, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, RECDES_INITIALIZER, S_SUCCESS, db_identifier::slotid, strlen, ctid::vfid, hfid::vfid, vfid::volid, and db_identifier::volid.
Referenced by diagdb().
|
static |
Definition at line 4754 of file system_catalog.c.
References assert, disk_attribute::bt_stats, btree_stats::btid, BTREE_STATS_PKEYS_NUM, disk_attribute::classoid, DB_TYPE_BIGINT, DB_TYPE_BLOB, DB_TYPE_CLOB, DB_TYPE_DATE, DB_TYPE_DOUBLE, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_JSON, DB_TYPE_MONETARY, DB_TYPE_MULTISET, DB_TYPE_NULL, DB_TYPE_OBJECT, DB_TYPE_POINTER, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_TYPE_STRING, DB_TYPE_SUB, DB_TYPE_TIME, DB_TYPE_VARIABLE, vfid::fileid, btree_stats::height, i, disk_attribute::id, btree_stats::keys, btree_stats::leafs, disk_attribute::location, disk_attribute::n_btstats, db_identifier::pageid, btree_stats::pages, btree_stats::pkeys, btree_stats::pkeys_size, disk_attribute::position, db_identifier::slotid, disk_attribute::type, disk_attribute::val_length, disk_attribute::value, btid::vfid, vfid::volid, and db_identifier::volid.
Referenced by catalog_dump_representation().
|
static |
Definition at line 4876 of file system_catalog.c.
References catalog_dump_disk_attribute(), disk_representation::fixed, disk_representation::fixed_length, i, disk_representation::id, disk_representation::n_fixed, disk_representation::n_variable, NULL, and disk_representation::variable.
Referenced by catalog_dump().
int catalog_end_access_with_dir_oid | ( | THREAD_ENTRY * | thread_p, |
CATALOG_ACCESS_INFO * | catalog_access_info, | ||
int | error | ||
) |
Definition at line 5905 of file system_catalog.c.
References catalog_access_info::access_started, assert, BO_IS_SERVER_RESTARTED, catalog_access_info::class_name, catalog_access_info::class_oid, catalog_access_info::dir_oid, free_and_init, catalog_access_info::is_systemop_started, catalog_access_info::is_update, lock_get_object_lock(), lock_unlock_object_donot_move_to_non2pl(), log_sysop_abort(), log_sysop_attach_to_outer(), log_sysop_commit(), catalog_access_info::need_free_class_name, catalog_access_info::need_unlock, NO_ERROR, NULL, OID_GET_VIRTUAL_CLASS_OF_DIR_OID, oid_Root_class_oid, S_LOCK, SCH_M_LOCK, and X_LOCK.
Referenced by catalog_add_class_info(), catalog_add_representation(), catalog_drop(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_get_cardinality(), catalog_get_class_info(), catalog_get_representation(), catalog_start_access_with_dir_oid(), catalog_update_class_info(), qexec_execute_build_indexes(), stats_update_partitioned_statistics(), xstats_get_statistics_from_server(), and xstats_update_statistics().
|
static |
Definition at line 950 of file system_catalog.c.
|
static |
Definition at line 961 of file system_catalog.c.
References NO_ERROR.
|
static |
Definition at line 973 of file system_catalog.c.
References NO_ERROR.
|
static |
Definition at line 985 of file system_catalog.c.
References NO_ERROR.
|
static |
Definition at line 1437 of file system_catalog.c.
References assert, catalog_get_record_from_page(), catalog_read_unread_portion(), recdes::data, ER_FAILED, recdes::length, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_assign_attribute().
|
static |
Definition at line 1491 of file system_catalog.c.
References assert, btree_stats::btid, btree_get_root_header(), BTREE_STATS_PKEYS_NUM, CATALOG_BT_STATS_SIZE, CATALOG_GET_BT_STATS_BTID, catalog_get_btree_statistics(), catalog_read_unread_portion(), recdes::data, db_private_alloc, DB_TYPE_MIDXKEY, ER_FAILED, btree_stats::height, i, btree_stats::key_type, btree_stats::keys, btree_stats::leafs, NO_ERROR, NULL, catalog_record::offset, OLD_PAGE, or_get_domain(), or_init(), btree_root_header::packed_key_domain, PAGE_BTREE, vpid::pageid, btree_stats::pages, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btree_stats::pkeys, btree_stats::pkeys_size, catalog_record::recdes, btid::root_pageid, tp_domain::setdomain, tp_domain_size(), TP_DOMAIN_TYPE, tp_Null_domain, btid::vfid, vpid::volid, vfid::volid, and VPID_ISNULL.
Referenced by catalog_assign_attribute().
|
static |
Definition at line 1413 of file system_catalog.c.
References CATALOG_DISK_ATTR_SIZE, catalog_get_disk_attribute(), catalog_read_unread_portion(), recdes::data, ER_FAILED, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_assign_attribute().
|
static |
Definition at line 1390 of file system_catalog.c.
References CATALOG_DISK_REPR_SIZE, catalog_get_disk_representation(), catalog_read_unread_portion(), recdes::data, ER_FAILED, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_get_representation().
|
static |
Definition at line 685 of file system_catalog.c.
References assert_release, CATALOG_GET_PGHEADER_DIR_COUNT, CATALOG_GET_PGHEADER_OVFL_PGID_PAGEID, CATALOG_GET_PGHEADER_PG_OVFL, CATALOG_HEADER_SLOT, CATALOG_MAX_SLOT_ID_SIZE, recdes::data, DB_PAGESIZE, ER_FAILED, NO_ERROR, NULL, NULL_PAGEID, PAGE_CATALOG, catalog_find_optimal_page_context::page_optimal, PEEK, pgbuf_check_page_ptype(), pgbuf_get_vpid(), S_SUCCESS, catalog_find_optimal_page_context::size, catalog_find_optimal_page_context::size_optimal_free, spage_get_record(), spage_max_space_for_new_record(), and catalog_find_optimal_page_context::vpid_optimal.
Referenced by catalog_find_optimal_page().
|
static |
Definition at line 4947 of file system_catalog.c.
References assert_release, CATALOG_GET_PGHEADER_OVFL_PGID_PAGEID, CATALOG_HEADER_SLOT, recdes::data, ER_FAILED, NO_ERROR, NULL_PAGEID, PEEK, S_SUCCESS, and spage_get_record().
Referenced by catalog_dump().
|
static |
Definition at line 4913 of file system_catalog.c.
References assert_release, CATALOG_GET_PGHEADER_DIR_COUNT, CATALOG_GET_PGHEADER_OVFL_PGID_PAGEID, CATALOG_GET_PGHEADER_OVFL_PGID_VOLID, CATALOG_HEADER_SLOT, recdes::data, ER_FAILED, catalog_page_dump_context::fp, NO_ERROR, catalog_page_dump_context::page_index, PEEK, PGBUF_PAGE_VPID_AS_ARGS, S_SUCCESS, spage_dump(), and spage_get_record().
Referenced by catalog_dump().
void catalog_finalize | ( | void | ) |
Definition at line 2567 of file system_catalog.c.
References cubthread::lockfree_hashmap< Key, T >::destroy().
Referenced by boot_server_all_finalize().
|
static |
Definition at line 727 of file system_catalog.c.
References assert, ASSERT_ERROR, catalog_file_map_find_optimal_page(), catalog_get_new_page(), CATALOG_MAX_SLOT_ID_SIZE, catalog_Max_space_lock, file_map_pages(), catalog_max_space::max_page_id, catalog_max_space::max_space, NO_ERROR, NULL, NULL_PAGEID, OLD_PAGE, catalog_find_optimal_page_context::page_optimal, vpid::pageid, PGBUF_CONDITIONAL_LATCH, pgbuf_fix, PGBUF_LATCH_WRITE, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, pthread_mutex_lock, pthread_mutex_unlock, catalog_find_optimal_page_context::size, catalog_find_optimal_page_context::size_optimal_free, spage_max_space_for_new_record(), ctid::vfid, VPID_ISNULL, catalog_find_optimal_page_context::vpid_optimal, and VPID_SET_NULL.
Referenced by catalog_add_class_info(), catalog_add_representation(), and catalog_insert_representation_item().
|
static |
Definition at line 1973 of file system_catalog.c.
References assert, CATALOG_GET_REPR_ITEM_REPRID, and CATALOG_REPR_ITEM_SIZE.
Referenced by catalog_drop_representation_item(), catalog_get_representation_item(), and catalog_put_representation_item().
void catalog_free_class_info | ( | CLS_INFO * | class_info_p | ) |
Definition at line 882 of file system_catalog.c.
References db_private_free_and_init, and NULL.
Referenced by catalog_update().
|
static |
Definition at line 927 of file system_catalog.c.
References db_private_free_and_init, catalog_class_id_list::next, NULL, and p.
void catalog_free_representation | ( | DISK_REPR * | repr_p | ) |
Definition at line 829 of file system_catalog.c.
References disk_attribute::bt_stats, db_private_free_and_init, disk_representation::fixed, disk_attribute::n_btstats, disk_representation::n_fixed, disk_representation::n_variable, NULL, btree_stats::pkeys, disk_attribute::value, and disk_representation::variable.
|
static |
Definition at line 437 of file system_catalog.c.
References assert, BTREE_STATS_PKEYS_NUM, BTREE_STATS_RESERVED_NUM, CATALOG_BT_STATS_FUNC_INDEX_OFF, CATALOG_BT_STATS_HEIGHT_OFF, CATALOG_BT_STATS_KEYS_OFF, CATALOG_BT_STATS_LEAFS_OFF, CATALOG_BT_STATS_PAGES_OFF, CATALOG_BT_STATS_PKEYS_OFF, CATALOG_BT_STATS_RESERVED_OFF, btree_stats::has_function, btree_stats::height, i, btree_stats::keys, btree_stats::leafs, OR_GET_INT, OR_INT_SIZE, btree_stats::pages, btree_stats::pkeys, and btree_stats::pkeys_size.
Referenced by catalog_fetch_btree_statistics().
int catalog_get_cardinality | ( | THREAD_ENTRY * | thread_p, |
OID * | class_oid, | ||
DISK_REPR * | rep, | ||
BTID * | btid, | ||
const int | key_pos, | ||
int * | cardinality | ||
) |
Definition at line 5267 of file system_catalog.c.
References ARG_FILE_LINE, assert, assert_release, disk_attribute::bt_stats, btree_stats::btid, BTID_IS_EQUAL, BTREE_STATS_PKEYS_NUM, CATALOG_ACCESS_INFO_INITIALIZER, catalog_end_access_with_dir_oid(), catalog_free_class_info_and_init, catalog_free_representation_and_init, catalog_get_class_info(), catalog_get_dir_oid_from_cache(), catalog_get_last_representation_id(), catalog_get_representation(), catalog_start_access_with_dir_oid(), catalog_access_info::class_oid, cubregex::count(), db_private_free, DB_TYPE_MIDXKEY, catalog_access_info::dir_oid, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_QPROC_FUNCTION_ARG_ERROR, er_set(), ER_UNEXPECTED, ER_WARNING_SEVERITY, error(), disk_representation::fixed, heap_classrepr_free_and_init, heap_classrepr_get(), i, disk_attribute::id, btree_stats::key_type, btree_stats::keys, NO_ERROR, NULL, NULL_REPRID, partition_get_partition_oids(), btree_stats::pkeys_size, S_LOCK, tp_domain::setdomain, stats_find_inherited_index_stats(), tp_domain_size(), TP_DOMAIN_TYPE, and disk_representation::variable.
Referenced by catalog_get_cardinality_by_name(), and qexec_execute_build_indexes().
int catalog_get_cardinality_by_name | ( | THREAD_ENTRY * | thread_p, |
const char * | class_name, | ||
const char * | index_name, | ||
const int | key_pos, | ||
int * | cardinality | ||
) |
Definition at line 5589 of file system_catalog.c.
References ARG_FILE_LINE, assert, BTID_IS_NULL, BTID_SET_NULL, catalog_get_cardinality(), DB_MAX_IDENTIFIER_LENGTH, ER_FAILED, ER_LC_UNKNOWN_CLASSNAME, ER_OBJ_INDEX_NOT_FOUND, er_set(), ER_WARNING_SEVERITY, error(), heap_get_btid_from_index_name(), intl_identifier_lower(), LC_CLASSNAME_DELETED, LC_CLASSNAME_ERROR, LK_GRANTED, LK_UNCOND_LOCK, lock_object(), NO_ERROR, NULL, NULL_LOCK, OID_ISNULL, oid_Root_class_oid, SCH_S_LOCK, and xlocator_find_class_oid().
Referenced by qdata_get_cardinality().
CLS_INFO* catalog_get_class_info | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
CATALOG_ACCESS_INFO * | catalog_access_info_p | ||
) |
Definition at line 4089 of file system_catalog.c.
References ARG_FILE_LINE, assert, CATALOG_ACCESS_INFO_INITIALIZER, CATALOG_CLS_INFO_SIZE, catalog_end_access_with_dir_oid(), catalog_get_class_info_from_record(), catalog_get_dir_oid_from_cache(), catalog_get_representation_item(), CATALOG_REPR_ITEM_INITIALIZER, catalog_start_access_with_dir_oid(), cls_info::ci_rep_dir, catalog_access_info::class_oid, COPY, recdes::data, db_private_alloc, catalog_access_info::dir_oid, er_errid(), ER_FAILED, er_log_debug, ER_SP_UNKNOWN_SLOTID, MAX_ALIGNMENT, NO_ERROR, NULL, NULL_REPRID, OID_ISNULL, OLD_PAGE, PAGE_CATALOG, catalog_repr_item::page_id, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, PTR_ALIGN, REC_HOME, recdes_set_data_area(), catalog_repr_item::repr_id, S_LOCK, S_SUCCESS, catalog_repr_item::slot_id, and spage_get_record().
Referenced by catalog_dump(), catalog_get_cardinality(), catalog_update(), catcls_delete_catalog_classes(), catcls_delete_subset(), catcls_insert_catalog_classes(), catcls_insert_subset(), catcls_update_catalog_classes(), catcls_update_subset(), stats_update_partitioned_statistics(), xcache_check_recompilation_threshold(), xlocator_assign_oid_batch(), xstats_get_statistics_from_server(), and xstats_update_statistics().
|
static |
Definition at line 500 of file system_catalog.c.
References assert, CATALOG_CLS_INFO_HFID_OFF, CATALOG_CLS_INFO_REP_DIR_OFF, CATALOG_CLS_INFO_TIME_STAMP_OFF, CATALOG_CLS_INFO_TOT_OBJS_OFF, CATALOG_CLS_INFO_TOT_PAGES_OFF, cls_info::ci_hfid, cls_info::ci_rep_dir, cls_info::ci_time_stamp, cls_info::ci_tot_objects, cls_info::ci_tot_pages, OID_ISNULL, OR_GET_HFID, OR_GET_INT, and OR_GET_OID.
Referenced by catalog_check_class_consistency(), catalog_get_class_info(), and catalog_get_rep_dir().
int catalog_get_dir_oid_from_cache | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_id_p, | ||
OID * | dir_oid_p | ||
) |
Definition at line 5715 of file system_catalog.c.
References assert, CATALOG_DIR_REPR_KEY, er_errid(), ER_FAILED, error(), cubthread::lockfree_hashmap< Key, T >::find(), cubthread::lockfree_hashmap< Key, T >::find_or_insert(), heap_get_class_record(), heap_scancache_end(), heap_scancache_quick_start_root_hfid(), catalog_entry::key, NO_ERROR, NULL, OID_ISNULL, OID_SET_NULL, or_class_rep_dir(), catalog_key::page_id, vpid::pageid, db_identifier::pageid, PEEK, catalog_key::r_page_id, catalog_key::r_slot_id, REC_HOME, catalog_key::repr_id, S_SUCCESS, catalog_key::slot_id, db_identifier::slotid, cubthread::lockfree_hashmap< Key, T >::unlock(), catalog_key::volid, vpid::volid, and db_identifier::volid.
Referenced by catalog_add_class_info(), catalog_add_representation(), catalog_drop(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_get_cardinality(), catalog_get_class_info(), catalog_get_representation(), catalog_update_class_info(), qexec_execute_build_indexes(), stats_update_partitioned_statistics(), xstats_get_statistics_from_server(), and xstats_update_statistics().
|
static |
Definition at line 423 of file system_catalog.c.
References disk_attribute::bt_stats, CATALOG_DISK_ATTR_CLASSOID_OFF, CATALOG_DISK_ATTR_ID_OFF, CATALOG_DISK_ATTR_LOCATION_OFF, CATALOG_DISK_ATTR_N_BTSTATS_OFF, CATALOG_DISK_ATTR_POSITION_OFF, CATALOG_DISK_ATTR_TYPE_OFF, CATALOG_DISK_ATTR_VAL_LENGTH_OFF, disk_attribute::classoid, disk_attribute::id, disk_attribute::location, disk_attribute::n_btstats, NULL, OR_GET_INT, OR_GET_OID, disk_attribute::position, disk_attribute::type, disk_attribute::val_length, and disk_attribute::value.
Referenced by catalog_fetch_disk_attribute().
|
static |
Definition at line 395 of file system_catalog.c.
References CATALOG_DISK_REPR_FIXED_LENGTH_OFF, CATALOG_DISK_REPR_ID_OFF, CATALOG_DISK_REPR_N_FIXED_OFF, CATALOG_DISK_REPR_N_VARIABLE_OFF, CATALOG_DISK_REPR_RESERVED_1_OFF, disk_representation::fixed, disk_representation::fixed_length, disk_representation::id, disk_representation::n_fixed, disk_representation::n_variable, NULL, OR_GET_INT, and disk_representation::variable.
Referenced by catalog_fetch_disk_representation().
|
static |
Definition at line 898 of file system_catalog.c.
References catalog_class_id_list::class_id, db_private_alloc, ER_OUT_OF_VIRTUAL_MEMORY, catalog_class_id_list::next, NO_ERROR, NULL, p, db_identifier::pageid, db_identifier::slotid, and db_identifier::volid.
int catalog_get_last_representation_id | ( | THREAD_ENTRY * | thread_p, |
OID * | class_oid_p, | ||
REPR_ID * | repr_id_p | ||
) |
Definition at line 4295 of file system_catalog.c.
References assert, CATALOG_GET_REPR_ITEM_REPRID, catalog_get_representation_record_after_search(), CATALOG_REPR_ITEM_SIZE, recdes::data, er_errid(), i, NO_ERROR, NULL, NULL_REPRID, OID_SET_NULL, PEEK, PGBUF_LATCH_READ, and pgbuf_unfix_and_init.
Referenced by catalog_get_cardinality(), catalog_update(), catcls_find_btid_of_class_name(), catcls_get_or_value_from_record(), catcls_put_or_value_into_record(), catcls_reorder_attributes_by_repr(), qexec_execute_build_indexes(), stats_update_partitioned_statistics(), xstats_get_statistics_from_server(), and xstats_update_statistics().
|
static |
Definition at line 648 of file system_catalog.c.
References ASSERT_ERROR, assert_release, catalog_initialize_new_page(), file_alloc(), log_sysop_abort(), log_sysop_commit(), log_sysop_start(), NO_ERROR, NULL, PAGE_CATALOG, pgbuf_check_page_ptype(), and ctid::vfid.
Referenced by catalog_find_optimal_page(), and catalog_put_record_into_page().
|
static |
Definition at line 1316 of file system_catalog.c.
References CATALOG_GET_PGHEADER_OVFL_PGID_PAGEID, CATALOG_GET_PGHEADER_OVFL_PGID_VOLID, CATALOG_HEADER_SLOT, recdes::data, ER_FAILED, recdes::length, NO_ERROR, NULL, NULL_PAGEID, NULL_VOLID, catalog_record::offset, OLD_PAGE, PAGE_CATALOG, catalog_record::page_p, vpid::pageid, PEEK, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, catalog_record::recdes, S_SUCCESS, catalog_record::slotid, spage_get_record(), vpid::volid, and catalog_record::vpid.
Referenced by catalog_fetch_attribute_value(), and catalog_read_unread_portion().
|
static |
Definition at line 1800 of file system_catalog.c.
References assert, catalog_get_class_info_from_record(), catalog_get_representation_item(), CATALOG_REPR_ITEM_INITIALIZER, cls_info::ci_rep_dir, CLS_INFO_INITIALIZER, COPY_OID, recdes::data, er_errid(), heap_get_class_record(), heap_scancache_end(), heap_scancache_quick_start_root_hfid(), NO_ERROR, NULL, NULL_REPRID, OID_ISNULL, OLD_PAGE, or_class_rep_dir(), PAGE_CATALOG, catalog_repr_item::page_id, PEEK, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, REC_HOME, catalog_repr_item::repr_id, S_SUCCESS, catalog_repr_item::slot_id, spage_get_record(), and VPID_ISNULL.
Referenced by catalog_check_class_consistency(), and catalog_get_representation_record_after_search().
|
static |
Definition at line 527 of file system_catalog.c.
References CATALOG_REPR_ITEM_PAGEID_PAGEID_OFF, CATALOG_REPR_ITEM_PAGEID_VOLID_OFF, CATALOG_REPR_ITEM_REPRID_OFF, CATALOG_REPR_ITEM_SLOTID_OFF, OR_GET_INT, OR_GET_SHORT, catalog_repr_item::page_id, vpid::pageid, catalog_repr_item::repr_id, catalog_repr_item::slot_id, and vpid::volid.
Referenced by catalog_drop_old_representations(), and catalog_drop_representation_item().
DISK_REPR* catalog_get_representation | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
REPR_ID | repr_id, | ||
CATALOG_ACCESS_INFO * | catalog_access_info_p | ||
) |
Definition at line 3847 of file system_catalog.c.
References ARG_FILE_LINE, assert, disk_attribute::bt_stats, CATALOG_ACCESS_INFO_INITIALIZER, catalog_add_class_info(), catalog_assign_attribute(), catalog_end_access_with_dir_oid(), catalog_fetch_disk_representation(), catalog_free_representation_and_init, catalog_get_dir_oid_from_cache(), catalog_get_representation_item(), catalog_start_access_with_dir_oid(), cls_info::ci_hfid, cls_info::ci_rep_dir, catalog_access_info::class_oid, CLS_INFO_INITIALIZER, db_private_alloc, catalog_access_info::dir_oid, ER_CT_INVALID_REPRID, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, er_set(), ER_SP_UNKNOWN_SLOTID, error(), disk_representation::fixed, heap_scancache_end(), heap_scancache_quick_start_root_hfid(), i, recdes::length, disk_attribute::n_btstats, disk_representation::n_fixed, disk_representation::n_variable, NO_ERROR, NULL, NULL_CHN, NULL_PAGEID, NULL_REPRID, NULL_SLOTID, NULL_VOLID, catalog_record::offset, OID_ISNULL, or_class_hfid(), or_class_rep_dir(), catalog_repr_item::page_id, catalog_record::page_p, vpid::pageid, PEEK, pgbuf_unfix_and_init, catalog_record::recdes, catalog_repr_item::repr_id, S_LOCK, S_SUCCESS, catalog_repr_item::slot_id, catalog_record::slotid, disk_attribute::value, disk_representation::variable, vpid::volid, and catalog_record::vpid.
Referenced by catalog_dump(), catalog_get_cardinality(), catalog_update(), catcls_find_btid_of_class_name(), catcls_get_or_value_from_record(), catcls_put_or_value_into_record(), catcls_reorder_attributes_by_repr(), qexec_execute_build_indexes(), stats_update_partitioned_statistics(), xstats_get_statistics_from_server(), and xstats_update_statistics().
int catalog_get_representation_directory | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
REPR_ID ** | repr_id_set_p, | ||
int * | repr_count_p | ||
) |
Definition at line 4231 of file system_catalog.c.
References ARG_FILE_LINE, assert, CATALOG_GET_REPR_ITEM_REPRID, catalog_get_representation_record_after_search(), CATALOG_REPR_ITEM_SIZE, recdes::data, er_errid(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), i, NO_ERROR, NULL, NULL_REPRID, OID_SET_NULL, PEEK, PGBUF_LATCH_READ, and pgbuf_unfix_and_init.
Referenced by catalog_dump().
|
static |
Definition at line 2249 of file system_catalog.c.
References ARG_FILE_LINE, assert, catalog_find_representation_item_position(), CATALOG_GET_REPR_ITEM_PAGEID_PAGEID, CATALOG_GET_REPR_ITEM_PAGEID_VOLID, CATALOG_GET_REPR_ITEM_SLOTID, catalog_get_representation_record_after_search(), recdes::data, ER_CT_UNKNOWN_REPRID, ER_ERROR_SEVERITY, ER_FAILED, er_log_debug, er_set(), cubthread::lockfree_hashmap< Key, T >::find(), cubthread::lockfree_hashmap< Key, T >::find_or_insert(), catalog_entry::key, NO_ERROR, NULL, OID_ISNULL, OID_SET_NULL, catalog_key::page_id, catalog_repr_item::page_id, vpid::pageid, db_identifier::pageid, PEEK, PGBUF_LATCH_READ, pgbuf_unfix_and_init, catalog_key::r_page_id, catalog_key::r_slot_id, catalog_key::repr_id, catalog_repr_item::repr_id, catalog_key::slot_id, catalog_repr_item::slot_id, db_identifier::slotid, cubthread::lockfree_hashmap< Key, T >::unlock(), catalog_key::volid, vpid::volid, and db_identifier::volid.
Referenced by catalog_get_class_info(), catalog_get_rep_dir(), catalog_get_representation(), and catalog_update_class_info().
|
static |
Definition at line 1879 of file system_catalog.c.
References ARG_FILE_LINE, assert, CATALOG_GET_REPR_ITEM_COUNT, CATALOG_REPR_ITEM_SIZE, recdes::data, er_errid(), ER_ERROR_SEVERITY, ER_HEAP_UNKNOWN_OBJECT, ER_PB_BAD_PAGEID, er_set(), recdes::length, NULL, OID_ISNULL, OLD_PAGE, PAGE_CATALOG, vpid::pageid, db_identifier::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, S_SUCCESS, db_identifier::slotid, spage_get_record(), vpid::volid, and db_identifier::volid.
Referenced by catalog_check_class_consistency(), catalog_get_representation_record_after_search(), and catalog_put_representation_item().
|
static |
Definition at line 1919 of file system_catalog.c.
References assert, catalog_get_rep_dir(), catalog_get_representation_record(), er_errid(), NO_ERROR, NULL, and OID_ISNULL.
Referenced by catalog_drop_all(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_item(), catalog_get_last_representation_id(), catalog_get_representation_directory(), catalog_get_representation_item(), and xcatalog_check_rep_dir().
void catalog_initialize | ( | CTID * | catalog_id_p | ) |
Definition at line 2537 of file system_catalog.c.
References CATALOG_HASH_SIZE, catalog_initialize_max_space(), catalog_is_header_initialized, catalog_Max_record_size, CATALOG_MAX_SLOT_ID_SIZE, CATALOG_PAGE_HEADER_SIZE, catalog_Ts, cubthread::lockfree_hashmap< Key, T >::destroy(), vfid::fileid, ctid::hpgid, cubthread::lockfree_hashmap< Key, T >::init(), ehid::pageid, spage_max_record_size(), THREAD_TS_CATALOG, ctid::vfid, VFID_COPY, vfid::volid, and ctid::xhid.
Referenced by boot_create_all_volumes(), boot_restart_server(), and xboot_emergency_patch().
|
static |
Definition at line 545 of file system_catalog.c.
References catalog_Max_space_lock, catalog_max_space::max_page_id, catalog_max_space::max_space, NULL_PAGEID, NULL_VOLID, vpid::pageid, pthread_mutex_lock, pthread_mutex_unlock, rv, and vpid::volid.
Referenced by catalog_create(), catalog_initialize(), and catalog_reclaim_space().
|
static |
Definition at line 594 of file system_catalog.c.
References ANCHORED_DONT_REUSE_SLOTS, ARG_FILE_LINE, assert, CATALOG_HEADER_SLOT, CATALOG_PAGE_HEADER_SIZE, catalog_put_page_header(), recdes::data, catalog_page_header::dir_count, DONT_FREE, ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), catalog_page_header::is_overflow_page, log_append_undoredo_data2(), MAX_ALIGNMENT, NO_ERROR, NULL, catalog_page_header::overflow_page_id, PAGE_CATALOG, pgbuf_set_dirty(), pgbuf_set_page_ptype(), PTR_ALIGN, REC_HOME, recdes_set_data_area(), RVCT_NEWPAGE, SAFEGUARD_RVSPACE, SP_SUCCESS, spage_initialize(), spage_insert(), success(), and VPID_SET_NULL.
Referenced by catalog_create(), and catalog_get_new_page().
int catalog_insert | ( | THREAD_ENTRY * | thread_p, |
RECDES * | record_p, | ||
OID * | class_oid_p, | ||
OID * | rep_dir_p | ||
) |
Definition at line 4341 of file system_catalog.c.
References ARG_FILE_LINE, assert, catalog_add_class_info(), catalog_add_representation(), cls_info::ci_rep_dir, COPY_OID, ER_CT_INVALID_REPRID, er_errid(), ER_ERROR_SEVERITY, er_set(), NO_ERROR, NULL, NULL_REPRID, OID_ISNULL, or_rep_id(), orc_class_info_from_record(), orc_diskrep_from_record(), orc_free_class_info(), and orc_free_diskrep().
Referenced by locator_insert_force(), and locator_update_force().
|
static |
Definition at line 1990 of file system_catalog.c.
References assert, catalog_adjust_directory_count(), catalog_find_optimal_page(), CATALOG_REPR_ITEM_COUNT_OFF, CATALOG_REPR_ITEM_SIZE, catalog_update_max_space(), recdes::data, ER_FAILED, FREE, recdes::length, log_append_undoredo_recdes2(), NO_ERROR, NULL, OID_ISNULL, OR_GET_BYTE, vpid::pageid, db_identifier::pageid, pgbuf_set_dirty(), pgbuf_unfix_and_init, RVCT_INSERT, db_identifier::slotid, SP_SUCCESS, spage_insert(), spage_max_space_for_new_record(), ctid::vfid, vpid::volid, and db_identifier::volid.
Referenced by catalog_put_representation_item().
|
static |
Definition at line 1028 of file system_catalog.c.
References catalog_key::page_id, catalog_key::repr_id, catalog_key::slot_id, and catalog_key::volid.
|
static |
Definition at line 998 of file system_catalog.c.
References ER_FAILED, NO_ERROR, NULL, catalog_key::page_id, catalog_key::r_page_id, catalog_key::r_slot_id, catalog_key::repr_id, catalog_key::slot_id, catalog_key::volid, and VPID_COPY.
|
static |
Definition at line 1057 of file system_catalog.c.
References catalog_key::repr_id.
|
static |
Definition at line 474 of file system_catalog.c.
References assert, btree_stats::btid, BTREE_STATS_PKEYS_NUM, BTREE_STATS_RESERVED_NUM, CATALOG_BT_STATS_BTID_OFF, CATALOG_BT_STATS_FUNC_INDEX_OFF, CATALOG_BT_STATS_HEIGHT_OFF, CATALOG_BT_STATS_KEYS_OFF, CATALOG_BT_STATS_LEAFS_OFF, CATALOG_BT_STATS_PAGES_OFF, CATALOG_BT_STATS_PKEYS_OFF, CATALOG_BT_STATS_RESERVED_OFF, btree_stats::has_function, btree_stats::height, i, btree_stats::keys, btree_stats::leafs, OR_INT_SIZE, OR_PUT_BTID, OR_PUT_INT, btree_stats::pages, btree_stats::pkeys, and btree_stats::pkeys_size.
Referenced by catalog_store_btree_statistics().
|
static |
Definition at line 513 of file system_catalog.c.
References assert, CATALOG_CLS_INFO_HFID_OFF, CATALOG_CLS_INFO_REP_DIR_OFF, CATALOG_CLS_INFO_TIME_STAMP_OFF, CATALOG_CLS_INFO_TOT_OBJS_OFF, CATALOG_CLS_INFO_TOT_PAGES_OFF, cls_info::ci_hfid, cls_info::ci_rep_dir, cls_info::ci_time_stamp, cls_info::ci_tot_objects, cls_info::ci_tot_pages, OID_ISNULL, OR_PUT_HFID, OR_PUT_INT, and OR_PUT_OID.
Referenced by catalog_add_class_info(), and catalog_update_class_info().
|
static |
Definition at line 461 of file system_catalog.c.
References CATALOG_DISK_ATTR_CLASSOID_OFF, CATALOG_DISK_ATTR_ID_OFF, CATALOG_DISK_ATTR_LOCATION_OFF, CATALOG_DISK_ATTR_N_BTSTATS_OFF, CATALOG_DISK_ATTR_POSITION_OFF, CATALOG_DISK_ATTR_TYPE_OFF, CATALOG_DISK_ATTR_VAL_LENGTH_OFF, disk_attribute::classoid, disk_attribute::id, disk_attribute::location, disk_attribute::n_btstats, OR_PUT_INT, OR_PUT_OID, disk_attribute::position, disk_attribute::type, and disk_attribute::val_length.
Referenced by catalog_store_disk_attribute().
|
static |
Definition at line 410 of file system_catalog.c.
References CATALOG_DISK_REPR_FIXED_LENGTH_OFF, CATALOG_DISK_REPR_ID_OFF, CATALOG_DISK_REPR_N_FIXED_OFF, CATALOG_DISK_REPR_N_VARIABLE_OFF, CATALOG_DISK_REPR_RESERVED_1_OFF, disk_representation::fixed_length, disk_representation::id, disk_representation::n_fixed, disk_representation::n_variable, and OR_PUT_INT.
Referenced by catalog_store_disk_representation().
|
static |
Definition at line 386 of file system_catalog.c.
References CATALOG_PUT_PGHEADER_DIR_COUNT, CATALOG_PUT_PGHEADER_OVFL_PGID_PAGEID, CATALOG_PUT_PGHEADER_OVFL_PGID_VOLID, CATALOG_PUT_PGHEADER_PG_OVFL, catalog_page_header::dir_count, catalog_page_header::is_overflow_page, catalog_page_header::overflow_page_id, vpid::pageid, and vpid::volid.
Referenced by catalog_initialize_new_page(), and catalog_rv_new_page_redo().
|
static |
Definition at line 1078 of file system_catalog.c.
References recdes::area_size, catalog_get_new_page(), CATALOG_HEADER_SLOT, CATALOG_MAX_SLOT_ID_SIZE, CATALOG_PUT_PGHEADER_OVFL_PGID_PAGEID, CATALOG_PUT_PGHEADER_OVFL_PGID_VOLID, COPY, recdes::data, DB_PAGESIZE, DONT_FREE, ER_FAILED, FREE, recdes::length, log_append_redo_recdes2(), log_append_undo_data2(), log_append_undo_recdes2(), log_append_undoredo_recdes2(), NO_ERROR, NULL, NULL_SLOTID, catalog_record::offset, catalog_record::page_p, vpid::pageid, pgbuf_set_dirty(), pgbuf_unfix_and_init, catalog_record::recdes, RVCT_INSERT, RVCT_NEW_OVFPAGE_LOGICAL_UNDO, RVCT_UPDATE, catalog_record::slotid, SP_SUCCESS, spage_get_record(), spage_insert(), spage_max_space_for_new_record(), spage_update(), ctid::vfid, vpid::volid, and catalog_record::vpid.
Referenced by catalog_add_representation(), catalog_store_attribute_value(), and catalog_write_unwritten_portion().
|
static |
Definition at line 536 of file system_catalog.c.
References CATALOG_REPR_ITEM_PAGEID_PAGEID_OFF, CATALOG_REPR_ITEM_PAGEID_VOLID_OFF, CATALOG_REPR_ITEM_REPRID_OFF, CATALOG_REPR_ITEM_SLOTID_OFF, OR_PUT_INT, OR_PUT_SHORT, catalog_repr_item::page_id, vpid::pageid, catalog_repr_item::repr_id, catalog_repr_item::slot_id, and vpid::volid.
Referenced by catalog_drop_old_representations(), catalog_drop_representation_item(), and catalog_put_representation_item().
|
static |
Definition at line 2059 of file system_catalog.c.
References assert, catalog_adjust_directory_count(), catalog_delete_key(), catalog_drop_disk_representation_from_page(), catalog_find_representation_item_position(), CATALOG_GET_REPR_ITEM_PAGEID_PAGEID, CATALOG_GET_REPR_ITEM_PAGEID_VOLID, CATALOG_GET_REPR_ITEM_SLOTID, catalog_get_representation_record(), catalog_insert_representation_item(), CATALOG_PAGE_HEADER_SIZE, catalog_put_repr_item_to_record(), CATALOG_REPR_ITEM_COUNT_OFF, CATALOG_REPR_ITEM_SIZE, catalog_update_max_space(), COPY, recdes::data, DB_PAGESIZE, ehash_delete(), ER_FAILED, FREE, recdes::length, log_append_redo_recdes2(), log_append_undo_recdes2(), log_append_undoredo_recdes2(), MAX_ALIGNMENT, NO_ERROR, NULL, OID_ISNULL, OR_GET_BYTE, OR_PUT_BYTE, vpid::pageid, db_identifier::pageid, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_unfix_and_init, PTR_ALIGN, REC_HOME, recdes_allocate_data_area(), recdes_free_data_area(), recdes_set_data_area(), catalog_repr_item::repr_id, RVCT_DELETE, RVCT_UPDATE, db_identifier::slotid, SP_DOESNT_FIT, SP_SUCCESS, spage_delete(), spage_max_space_for_new_record(), spage_update(), success(), recdes::type, ctid::vfid, vpid::volid, db_identifier::volid, and ctid::xhid.
Referenced by catalog_add_class_info(), and catalog_add_representation().
|
static |
Definition at line 1366 of file system_catalog.c.
References catalog_get_record_from_page(), ER_FAILED, recdes::length, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_fetch_attribute_value(), catalog_fetch_btree_statistics(), catalog_fetch_disk_attribute(), and catalog_fetch_disk_representation().
int catalog_reclaim_space | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2681 of file system_catalog.c.
References ARG_FILE_LINE, ASSERT_ERROR, assert_release, catalog_initialize_max_space(), ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), FILE_CATALOG, file_dealloc(), file_get_num_user_pages(), file_map_pages(), NO_ERROR, NULL, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, and ctid::vfid.
Referenced by compactdb_start().
int catalog_rv_delete_redo | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5239 of file system_catalog.c.
References catalog_clear_hash_table(), DONT_FREE, NO_ERROR, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, and spage_delete().
int catalog_rv_delete_undo | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5654 of file system_catalog.c.
References catalog_clear_hash_table(), and catalog_rv_insert_redo().
int catalog_rv_insert_redo | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5185 of file system_catalog.c.
References recdes::area_size, ARG_FILE_LINE, assert, catalog_clear_hash_table(), log_rcv::data, DONT_FREE, er_errid(), ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), log_rcv::length, recdes::length, NO_ERROR, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, recdes_set_data_area(), SP_ERROR, SP_SUCCESS, spage_insert_for_recovery(), success(), and recdes::type.
Referenced by catalog_rv_delete_undo().
int catalog_rv_insert_undo | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5220 of file system_catalog.c.
References catalog_clear_hash_table(), DONT_FREE, NO_ERROR, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, and spage_delete_for_recovery().
int catalog_rv_new_page_redo | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5146 of file system_catalog.c.
References ANCHORED_DONT_REUSE_SLOTS, ARG_FILE_LINE, assert, catalog_clear_hash_table(), CATALOG_HEADER_SLOT, CATALOG_PAGE_HEADER_SIZE, catalog_put_page_header(), log_rcv::data, recdes::data, DONT_FREE, er_errid(), ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), MAX_ALIGNMENT, NO_ERROR, NULL, PAGE_CATALOG, pgbuf_set_dirty(), pgbuf_set_page_ptype(), log_rcv::pgptr, PTR_ALIGN, REC_HOME, recdes_set_data_area(), SAFEGUARD_RVSPACE, SP_SUCCESS, spage_initialize(), spage_insert(), and success().
int catalog_rv_ovf_page_logical_insert_undo | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5697 of file system_catalog.c.
References catalog_clear_hash_table(), log_rcv::data, FILE_CATALOG, file_dealloc(), and ctid::vfid.
int catalog_rv_update | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv_p | ||
) |
Definition at line 5668 of file system_catalog.c.
References recdes::area_size, assert, catalog_clear_hash_table(), log_rcv::data, DONT_FREE, er_errid(), log_rcv::length, recdes::length, NO_ERROR, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, recdes_set_data_area(), SP_SUCCESS, spage_update(), and recdes::type.
int catalog_start_access_with_dir_oid | ( | THREAD_ENTRY * | thread_p, |
CATALOG_ACCESS_INFO * | catalog_access_info, | ||
LOCK | lock_mode | ||
) |
Definition at line 5799 of file system_catalog.c.
References catalog_access_info::access_started, ARG_FILE_LINE, assert, BO_IS_SERVER_RESTARTED, catalog_end_access_with_dir_oid(), catalog_access_info::class_name, catalog_access_info::class_oid, catalog_access_info::dir_oid, er_clear(), ER_ERROR_SEVERITY, ER_FAILED, er_set(), ER_UPDATE_STAT_CANNOT_GET_LOCK, error(), heap_get_class_name(), catalog_access_info::is_systemop_started, catalog_access_info::is_update, LK_GRANTED, LK_NOTGRANTED_DUE_ABORTED, LK_NOTGRANTED_DUE_ERROR, LK_NOTGRANTED_DUE_TIMEOUT, LK_UNCOND_LOCK, lock_get_object_lock(), lock_object(), log_sysop_abort(), log_sysop_start(), catalog_access_info::need_free_class_name, catalog_access_info::need_unlock, NO_ERROR, NULL, NULL_LOCK, OID_GET_VIRTUAL_CLASS_OF_DIR_OID, OID_ISNULL, and X_LOCK.
Referenced by catalog_add_class_info(), catalog_add_representation(), catalog_drop(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_get_cardinality(), catalog_get_class_info(), catalog_get_representation(), catalog_update_class_info(), qexec_execute_build_indexes(), stats_update_partitioned_statistics(), xstats_get_statistics_from_server(), and xstats_update_statistics().
|
static |
Definition at line 1240 of file system_catalog.c.
References recdes::area_size, assert, catalog_put_record_into_page(), catalog_write_unwritten_portion(), recdes::data, ER_FAILED, recdes::length, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_add_representation().
|
static |
Definition at line 1295 of file system_catalog.c.
References CATALOG_BT_STATS_SIZE, catalog_put_btree_statistics(), catalog_write_unwritten_portion(), recdes::data, ER_FAILED, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_add_representation().
|
static |
Definition at line 1213 of file system_catalog.c.
References CATALOG_DISK_ATTR_SIZE, catalog_put_disk_attribute(), catalog_write_unwritten_portion(), recdes::data, ER_FAILED, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_add_representation().
|
static |
Definition at line 1187 of file system_catalog.c.
References CATALOG_DISK_REPR_SIZE, catalog_put_disk_representation(), catalog_write_unwritten_portion(), recdes::data, ER_FAILED, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_add_representation().
|
static |
Definition at line 2740 of file system_catalog.c.
References CATALOG_BT_STATS_SIZE, CATALOG_DISK_ATTR_SIZE, cubregex::count(), i, MAX_ALIGNMENT, disk_attribute::n_btstats, and disk_attribute::val_length.
Referenced by catalog_add_representation().
int catalog_update | ( | THREAD_ENTRY * | thread_p, |
RECDES * | record_p, | ||
OID * | class_oid_p | ||
) |
Definition at line 4418 of file system_catalog.c.
References ARG_FILE_LINE, assert, catalog_add_representation(), catalog_copy_disk_attributes(), catalog_drop(), catalog_free_class_info(), catalog_free_representation_and_init, catalog_get_class_info(), catalog_get_last_representation_id(), catalog_get_representation(), catalog_update_class_info(), cls_info::ci_hfid, cls_info::ci_rep_dir, ER_CT_INVALID_REPRID, er_errid(), ER_ERROR_SEVERITY, er_set(), ER_SP_UNKNOWN_SLOTID, err, disk_representation::fixed, HFID_IS_NULL, disk_representation::n_fixed, disk_representation::n_variable, NO_ERROR, NULL, NULL_REPRID, OID_EQ, OID_ISNULL, or_class_hfid(), or_class_rep_dir(), or_rep_id(), orc_diskrep_from_record(), orc_free_diskrep(), and disk_representation::variable.
Referenced by locator_update_force().
CLS_INFO* catalog_update_class_info | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
CLS_INFO * | class_info_p, | ||
CATALOG_ACCESS_INFO * | catalog_access_info_p, | ||
bool | skip_logging | ||
) |
Definition at line 3128 of file system_catalog.c.
References ARG_FILE_LINE, assert, CATALOG_ACCESS_INFO_INITIALIZER, CATALOG_CLS_INFO_RESERVED, CATALOG_CLS_INFO_SIZE, catalog_end_access_with_dir_oid(), catalog_get_dir_oid_from_cache(), catalog_get_representation_item(), catalog_put_class_info_to_record(), CATALOG_REPR_ITEM_INITIALIZER, catalog_start_access_with_dir_oid(), cls_info::ci_rep_dir, catalog_access_info::class_oid, COPY, recdes::data, catalog_access_info::dir_oid, er_errid(), ER_FAILED, er_log_debug, ER_SP_UNKNOWN_SLOTID, FREE, log_append_redo_recdes2(), log_append_undo_recdes2(), log_skip_logging(), MAX_ALIGNMENT, NO_ERROR, NULL, NULL_REPRID, log_data_addr::offset, OID_ISNULL, OLD_PAGE, PAGE_CATALOG, catalog_repr_item::page_id, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, REC_HOME, recdes_set_data_area(), catalog_repr_item::repr_id, RVCT_UPDATE, S_SUCCESS, catalog_repr_item::slot_id, SP_SUCCESS, spage_get_record(), spage_update(), ctid::vfid, log_data_addr::vfid, and X_LOCK.
Referenced by catalog_update(), xcache_check_recompilation_threshold(), and xlocator_assign_oid_batch().
Definition at line 558 of file system_catalog.c.
References catalog_Max_space_lock, catalog_max_space::max_page_id, catalog_max_space::max_space, pthread_mutex_lock, pthread_mutex_unlock, rv, and VPID_EQ.
Referenced by catalog_add_class_info(), catalog_add_representation(), catalog_create(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_helper(), catalog_drop_representation_item(), catalog_insert_representation_item(), and catalog_put_representation_item().
|
static |
Definition at line 1156 of file system_catalog.c.
References recdes::area_size, catalog_put_record_into_page(), ER_FAILED, recdes::length, NO_ERROR, catalog_record::offset, and catalog_record::recdes.
Referenced by catalog_store_attribute_value(), catalog_store_btree_statistics(), catalog_store_disk_attribute(), and catalog_store_disk_representation().
int xcatalog_check_rep_dir | ( | THREAD_ENTRY * | thread_p, |
OID * | class_id_p, | ||
OID * | rep_dir_p | ||
) |
Definition at line 3664 of file system_catalog.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, catalog_add_representation(), catalog_get_representation_record_after_search(), ER_CT_INVALID_CLASSID, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_HEAP_NODATA_NEWADDRESS, er_set(), heap_scancache_end(), heap_scancache_quick_start_root_hfid(), NO_ERROR, NULL, NULL_CHN, NULL_PAGEID, NULL_SLOTID, NULL_VOLID, OID_ISNULL, OID_ISTEMP, OID_SET_NULL, or_class_rep_dir(), orc_diskrep_from_record(), orc_free_diskrep(), db_identifier::pageid, PEEK, PGBUF_LATCH_WRITE, pgbuf_unfix_and_init, S_SUCCESS, db_identifier::slotid, and db_identifier::volid.
Referenced by catalog_check_rep_dir(), and sct_check_rep_dir().
|
static |
Definition at line 203 of file system_catalog.c.
|
static |
Definition at line 271 of file system_catalog.c.
CTID catalog_Id |
Definition at line 260 of file system_catalog.c.
|
static |
Definition at line 275 of file system_catalog.c.
Referenced by catalog_create(), and catalog_initialize().
|
static |
Definition at line 261 of file system_catalog.c.
Referenced by catalog_initialize().
|
static |
Definition at line 273 of file system_catalog.c.
|
static |
Definition at line 274 of file system_catalog.c.
Referenced by catalog_find_optimal_page(), catalog_initialize_max_space(), and catalog_update_max_space().
|
static |
Definition at line 54 of file system_catalog.c.
Referenced by catalog_initialize_max_space(), and catalog_update_max_space().