CUBRID Engine  latest
system_catalog.h File Reference
#include "config.h"
#include "error_manager.h"
#include "log_manager.h"
#include "memory_alloc.h"
#include "statistics.h"
#include "disk_manager.h"
#include "storage_common.h"
Include dependency graph for system_catalog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ctid
 
struct  disk_representation
 
struct  disk_attribute
 
struct  cls_info
 
struct  catalog_access_info
 

Macros

#define CATALOG_DIR_REPR_KEY   -2
 
#define CATALOG_ACCESS_INFO_INITIALIZER   {NULL, NULL, NULL, false, false, false, false, false}
 
#define CLS_INFO_INITIALIZER   { HFID_INITIALIZER, 0, 0, 0, { NULL_PAGEID, NULL_SLOTID, NULL_VOLID } }
 
#define catalog_free_class_info_and_init(class_info_p)
 
#define catalog_free_representation_and_init(repr_p)
 

Typedefs

typedef struct ctid CTID
 
typedef struct disk_representation DISK_REPR
 
typedef struct disk_attribute DISK_ATTR
 
typedef struct cls_info CLS_INFO
 
typedef struct catalog_access_info CATALOG_ACCESS_INFO
 

Functions

void catalog_free_representation (DISK_REPR *repr_p)
 
void catalog_free_class_info (CLS_INFO *class_info_p)
 
void catalog_initialize (CTID *catid)
 
void catalog_finalize (void)
 
CTIDcatalog_create (THREAD_ENTRY *thread_p, CTID *catid)
 
int catalog_destroy (void)
 
int catalog_reclaim_space (THREAD_ENTRY *thread_p)
 
int catalog_add_representation (THREAD_ENTRY *thread_p, OID *class_id, REPR_ID repr_id, DISK_REPR *Disk_Repr, OID *rep_dir_p, CATALOG_ACCESS_INFO *catalog_access_info_p)
 
int catalog_add_class_info (THREAD_ENTRY *thread_p, OID *class_oid_p, CLS_INFO *class_info_p, CATALOG_ACCESS_INFO *catalog_access_info_p)
 
CLS_INFOcatalog_update_class_info (THREAD_ENTRY *thread_p, OID *class_id, CLS_INFO *cls_info, CATALOG_ACCESS_INFO *catalog_access_info_p, bool skip_logging)
 
int catalog_drop_old_representations (THREAD_ENTRY *thread_p, OID *class_id)
 
DISK_REPRcatalog_get_representation (THREAD_ENTRY *thread_p, OID *class_id, REPR_ID repr_id, CATALOG_ACCESS_INFO *catalog_access_info_p)
 
CLS_INFOcatalog_get_class_info (THREAD_ENTRY *thread_p, OID *class_id, CATALOG_ACCESS_INFO *catalog_access_info_p)
 
int catalog_get_representation_directory (THREAD_ENTRY *thread_p, OID *class_id, REPR_ID **reprid_set, int *repr_cnt)
 
int catalog_get_last_representation_id (THREAD_ENTRY *thread_p, OID *cls_oid, REPR_ID *repr_id)
 
int catalog_insert (THREAD_ENTRY *thread_p, RECDES *record, OID *classoid, OID *rep_dir_p)
 
int catalog_update (THREAD_ENTRY *thread_p, RECDES *record, OID *classoid)
 
int catalog_delete (THREAD_ENTRY *thread_p, OID *classoid)
 
int catalog_get_cardinality (THREAD_ENTRY *thread_p, OID *class_oid, DISK_REPR *rep, BTID *btid, const int key_pos, int *cardinality)
 
int catalog_get_cardinality_by_name (THREAD_ENTRY *thread_p, const char *class_name, const char *index_name, const int key_pos, int *cardinality)
 
DISK_ISVALID catalog_check_consistency (THREAD_ENTRY *thread_p)
 
void catalog_dump (THREAD_ENTRY *thread_p, FILE *fp, int dump_flg)
 
int catalog_rv_new_page_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_rv_insert_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_rv_insert_undo (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_rv_delete_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_rv_delete_undo (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_rv_update (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_rv_ovf_page_logical_insert_undo (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int catalog_get_dir_oid_from_cache (THREAD_ENTRY *thread_p, const OID *class_id_p, OID *dir_oid_p)
 
int catalog_start_access_with_dir_oid (THREAD_ENTRY *thread_p, CATALOG_ACCESS_INFO *catalog_access_info, LOCK lock_mode)
 
int catalog_end_access_with_dir_oid (THREAD_ENTRY *thread_p, CATALOG_ACCESS_INFO *catalog_access_info, int error)
 

Variables

CTID catalog_Id
 

Macro Definition Documentation

#define CATALOG_DIR_REPR_KEY   -2
#define catalog_free_class_info_and_init (   class_info_p)
#define catalog_free_representation_and_init (   repr_p)
#define CLS_INFO_INITIALIZER   { HFID_INITIALIZER, 0, 0, 0, { NULL_PAGEID, NULL_SLOTID, NULL_VOLID } }

Typedef Documentation

Definition at line 106 of file system_catalog.h.

typedef struct cls_info CLS_INFO

Definition at line 96 of file system_catalog.h.

typedef struct ctid CTID

Definition at line 44 of file system_catalog.h.

typedef struct disk_attribute DISK_ATTR

Definition at line 81 of file system_catalog.h.

Definition at line 64 of file system_catalog.h.

Function Documentation

int catalog_add_representation ( THREAD_ENTRY thread_p,
OID class_id,
REPR_ID  repr_id,
DISK_REPR Disk_Repr,
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().

Here is the caller graph for this function:

int catalog_delete ( THREAD_ENTRY thread_p,
OID classoid 
)

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().

Here is the caller graph for this function:

int catalog_destroy ( void  )
int catalog_drop_old_representations ( THREAD_ENTRY thread_p,
OID class_id 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

DISK_REPR* catalog_get_representation ( THREAD_ENTRY thread_p,
OID class_id,
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().

Here is the caller graph for this function:

int catalog_get_representation_directory ( THREAD_ENTRY thread_p,
OID class_id,
REPR_ID **  reprid_set,
int *  repr_cnt 
)
int catalog_rv_delete_redo ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
int catalog_rv_delete_undo ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)

Definition at line 5654 of file system_catalog.c.

References catalog_clear_hash_table(), and catalog_rv_insert_redo().

int catalog_rv_insert_undo ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
int catalog_rv_ovf_page_logical_insert_undo ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)

Variable Documentation

CTID catalog_Id

Definition at line 260 of file system_catalog.c.