File file_manager.c¶
FileList > cubrid > src > storage > file_manager.c
Go to the source code of this file
#include "config.h"#include <stdio.h>#include <stdlib.h>#include <stddef.h>#include <string.h>#include <time.h>#include <unordered_map>#include <functional>#include "file_manager.h"#include "btree.h"#include "porting.h"#include "porting_inline.hpp"#include "memory_alloc.h"#include "storage_common.h"#include "error_manager.h"#include "file_io.h"#include "page_buffer.h"#include "disk_manager.h"#include "log_append.hpp"#include "log_manager.h"#include "log_impl.h"#include "log_lsa.hpp"#include "lock_manager.h"#include "system_parameter.h"#include "boot_sr.h"#include "memory_hash.h"#include "environment_variable.h"#include "xserver_interface.h"#include "oid.h"#include "heap_file.h"#include "bit.h"#include "util_func.h"#include "vacuum.h"#include "btree_load.h"#include "critical_section.h"#include "connection_error.h"#include "fault_injection.h"#include "thread_manager.hpp"#include "partition_sr.h"#include "memory_wrapper.hpp"
Namespaces¶
| Type | Name |
|---|---|
| namespace | std STL namespace. |
Classes¶
| Type | Name |
|---|---|
| struct | file_extensible_data |
| struct | file_extensible_data_search_context |
| struct | file_find_nth_context |
| struct | file_header |
| struct | file_map_context |
| struct | file_set_tde_algorithm_args |
| struct | file_tempcache |
| struct | file_tempcache_entry |
| struct | file_tempcache_tran_entry |
| struct | file_track_heap_metadata |
| struct | file_track_item |
| struct | file_track_mark_heap_deleted_context |
| struct | file_tracker_dump_heap_context |
| struct | file_tracker_reuse_heap_context |
| struct | file_vsid_collector |
| struct | hash< VFID > <> |
Public Types¶
Public Static Attributes¶
| Type | Name |
|---|---|
| bool | file_Logging = [**false**](broker__monitor_8c.md#function-timeout) |
| FILE_TEMPCACHE | file_Tempcache |
| VFID | file_Tracker_vfid = [**VFID\_INITIALIZER**](dbtype__def_8h.md#define-vfid_initializer) |
| VPID | file_Tracker_vpid = [**VPID\_INITIALIZER**](dbtype__def_8h.md#define-vpid_initializer) |
Public Functions¶
Public Static Functions¶
Macros¶
| Type | Name |
|---|---|
| define | FILE_ALLOC_TYPE_STRING (alloc_type) ((alloc\_type) == FILE\_ALLOC\_USER\_PAGE ? "alloc user [**page"**](broker__monitor_8c.md#function-timeout) : "alloc table [**page"**](broker__monitor_8c.md#function-timeout)) |
| define | FILE_CACHE_LAST_FIND_NTH (fh, thread_p) /* multi line expression */ |
| define | FILE_EXTDATA_AS_ARGS (extdata) [**VPID\_AS\_ARGS**](dbtype__def_8h.md#define-vpid_as_args) (&([**extdata**](broker__monitor_8c.md#function-timeout))->vpid\_next), ([**extdata**](broker__monitor_8c.md#function-timeout))->max\_size, ([**extdata**](broker__monitor_8c.md#function-timeout))->size\_of\_item, ([**extdata**](broker__monitor_8c.md#function-timeout))->n\_items |
| define | FILE_EXTDATA_HEADER_ALIGNED_SIZE ([**DB\_ALIGN**](memory__alloc_8h.md#define-db_align) ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**FILE\_EXTENSIBLE\_DATA**](file__manager_8c.md#typedef-file_extensible_data)), [**MAX\_ALIGNMENT**](memory__alloc_8h.md#define-max_alignment))) |
| define | FILE_EXTDATA_MSG (name) "\t" name ": { vpid\_next = %d\|%d, max\_size = %d, item\_size = %d, n\_items = %d } \[**n"**](broker__monitor_8c.md#function-timeout) |
| define | FILE_FLAG_ENCRYPTED_AES 0x4 /\* [**Is**](broker__monitor_8c.md#function-timeout) file [**encrypted**](broker__monitor_8c.md#function-timeout) [**using**](broker__monitor_8c.md#function-timeout) [**AES**](broker__monitor_8c.md#function-timeout) \*/ |
| define | FILE_FLAG_ENCRYPTED_ARIA 0x8 /\* [**Is**](broker__monitor_8c.md#function-timeout) file [**encrypted**](broker__monitor_8c.md#function-timeout) [**using**](broker__monitor_8c.md#function-timeout) [**ARIA**](broker__monitor_8c.md#function-timeout) \*/ |
| define | FILE_FLAG_ENCRYPTED_MASK 0x0000000c /\* 0x4 + 0x8 \*/ |
| define | FILE_FLAG_NUMERABLE 0x1 /\* [**Is**](broker__monitor_8c.md#function-timeout) file [**numerable**](broker__monitor_8c.md#function-timeout) \*/ |
| define | FILE_FLAG_TEMPORARY 0x2 /\* [**Is**](broker__monitor_8c.md#function-timeout) file [**temporary**](broker__monitor_8c.md#function-timeout) \*/ |
| define | FILE_GET_HEADER_VPID (vfid, vpid) ([**vpid**](structvpid.md))->volid = ([**vfid**](structvfid.md))->volid; ([**vpid**](structvpid.md))->pageid = ([**vfid**](structvfid.md))->fileid |
| define | FILE_GET_TRACKER_LOCK_MODE (file_type) (((file\_type) == FILE\_BTREE) ? IX\_LOCK : SCH\_S\_LOCK) |
| define | FILE_HEADER_ALIGNED_SIZE (([**INT16**](broker__monitor_8c.md#function-timeout)) ([**DB\_ALIGN**](memory__alloc_8h.md#define-db_align) ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**FILE\_HEADER**](file__manager_8c.md#typedef-file_header)), [**MAX\_ALIGNMENT**](memory__alloc_8h.md#define-max_alignment)))) |
| define | FILE_HEADER_GET_FULL_FTAB (fh, fulltab) /* multi line expression */ |
| define | FILE_HEADER_GET_PART_FTAB (fh, parttab) /* multi line expression */ |
| define | FILE_HEADER_GET_USER_PAGE_FTAB (fh, pagetab) /* multi line expression */ |
| define | FILE_HEAD_ALLOC_AS_ARGS (fhead) /* multi line expression */ |
| define | FILE_HEAD_ALLOC_MSG /* multi line expression */ |
| define | FILE_HEAD_FULL_AS_ARGS (fhead) /* multi line expression */ |
| define | FILE_HEAD_FULL_MSG /* multi line expression */ |
| define | FILE_IS_NUMERABLE (fh) ((([**fh**](broker__monitor_8c.md#function-timeout))->file\_flags & [**FILE\_FLAG\_NUMERABLE**](file__manager_8c.md#define-file_flag_numerable)) != 0) |
| define | FILE_IS_TDE_ENCRYPTED (fh) ((([**fh**](broker__monitor_8c.md#function-timeout))->file\_flags & [**FILE\_FLAG\_ENCRYPTED\_MASK**](file__manager_8c.md#define-file_flag_encrypted_mask)) != 0) |
| define | FILE_IS_TEMPORARY (fh) ((([**fh**](broker__monitor_8c.md#function-timeout))->file\_flags & [**FILE\_FLAG\_TEMPORARY**](file__manager_8c.md#define-file_flag_temporary)) != 0) |
| define | FILE_NUMERABLE_REGULAR_STRING (is_numerable) (([**is\_numerable**](broker__monitor_8c.md#function-timeout)) ? "numerable" : "regular") |
| define | FILE_PARTSECT_AS_ARGS (ps) [**VSID\_AS\_ARGS**](dbtype__def_8h.md#define-vsid_as_args) (&([**ps**](broker__monitor_8c.md#function-timeout))->[**vsid**](structvsid.md)), ([**long**](broker__monitor_8c.md#function-timeout) [**long**](broker__monitor_8c.md#function-timeout) [**unsigned**](broker__monitor_8c.md#function-timeout) [**int**](broker__monitor_8c.md#function-timeout)) ([**ps**](broker__monitor_8c.md#function-timeout))->[**page\_bitmap**](structpage__bitmap.md) |
| define | FILE_PARTSECT_MSG (name) "\t" name ": { vsid = %d\|%d, page bitmap = " BIT64\_HEXA\_PRINT\_FORMAT " } \n" |
| define | FILE_PERM_TEMP_STRING (is_temp) ((is\_temp) ? "temporary" : "permanent") |
| define | FILE_RV_DEALLOC_COMPENSATE [**true**](broker__monitor_8c.md#function-timeout) |
| define | FILE_RV_DEALLOC_RUN_POSTPONE [**false**](broker__monitor_8c.md#function-timeout) |
| define | FILE_TABLESPACE_AS_ARGS (tabspace) /* multi line expression */ |
| define | FILE_TABLESPACE_DEFAULT_MAX_EXPAND ([**DISK\_SECTOR\_NPAGES**](storage__common_8h.md#define-disk_sector_npages) \* [**DB\_PAGESIZE**](storage__common_8h.md#define-db_pagesize) \* 1024); /\* 1[**k**](broker__monitor_8c.md#function-timeout) sectors \*/ |
| define | FILE_TABLESPACE_DEFAULT_MIN_EXPAND ([**DISK\_SECTOR\_NPAGES**](storage__common_8h.md#define-disk_sector_npages) \* [**DB\_PAGESIZE**](storage__common_8h.md#define-db_pagesize)); /\* [**one**](broker__monitor_8c.md#function-timeout) [**sector**](broker__monitor_8c.md#function-timeout) \*/ |
| define | FILE_TABLESPACE_DEFAULT_RATIO_EXPAND (([**float**](broker__monitor_8c.md#function-timeout)) 0.01) /\* 1% [**of**](broker__monitor_8c.md#function-timeout) current size \*/ |
| define | FILE_TABLESPACE_FOR_PERM_NPAGES (tabspace, npages) /* multi line expression */ |
| define | FILE_TABLESPACE_FOR_TEMP_NPAGES (tabspace, npages) /* multi line expression */ |
| define | FILE_TABLESPACE_MSG "\ttablespace = { [**init\_size**](broker__monitor_8c.md#function-timeout) = %[**lld**](broker__monitor_8c.md#function-timeout), expand\_ratio = %f, expand\_min\_size = %d, expand\_max\_size = %d } \[**n"**](broker__monitor_8c.md#function-timeout) |
| define | FILE_TEMPCACHE_AS_ARGS /* multi line expression */ |
| define | FILE_TEMPCACHE_ENTRY_AS_ARGS (ent) ent, [**VFID\_AS\_ARGS**](dbtype__def_8h.md#define-vfid_as_args) (&(ent)->[**vfid**](structvfid.md)), [**file\_type\_to\_string**](file__manager_8c.md#function-file_type_to_string) ((ent)->ftype) |
| define | FILE_TEMPCACHE_ENTRY_MSG "%p, [**VFID**](dbtype__def_8h.md#typedef-vfid) %d\|%d, %[**s"**](broker__monitor_8c.md#function-timeout) |
| define | FILE_TEMPCACHE_MSG /* multi line expression */ |
| define | FILE_TRACK_ITEM_AS_ARGS (item) (item)->volid, (item)->fileid, [**file\_type\_to\_string**](file__manager_8c.md#function-file_type_to_string) (([**FILE\_TYPE**](file__manager_8h.md#enum-file_type)) (item)->type) |
| define | FILE_TRACK_ITEM_MSG "VFID %d\|%d, %[**s"**](broker__monitor_8c.md#function-timeout) |
| define | FILE_TYPE_CAN_BE_NUMERABLE (ftype) /* multi line expression */ |
| define | FILE_TYPE_IS_ALWAYS_TEMP (ftype) /* multi line expression */ |
| define | FILE_TYPE_IS_NEVER_TEMP (ftype) ( (ftype) &&  (ftype)) |
| define | FILE_TYPE_IS_SOMETIMES_TEMP (ftype) /* multi line expression */ |
| define | FILE_USER_PAGE_CLEAR_MARK_DELETED (vpid) (([**VPID**](dbtype__def_8h.md#typedef-vpid) \*) [**vpid**](structvpid.md))->pageid &= ~[**FILE\_USER\_PAGE\_MARK\_DELETE\_FLAG**](file__manager_8c.md#define-file_user_page_mark_delete_flag) |
| define | FILE_USER_PAGE_IS_MARKED_DELETED (vpid) (((([**VPID**](dbtype__def_8h.md#typedef-vpid) \*) [**vpid**](structvpid.md))->pageid & [**FILE\_USER\_PAGE\_MARK\_DELETE\_FLAG**](file__manager_8c.md#define-file_user_page_mark_delete_flag)) != 0) |
| define | FILE_USER_PAGE_MARK_DELETED (vpid) (([**VPID**](dbtype__def_8h.md#typedef-vpid) \*) [**vpid**](structvpid.md))->pageid \|= [**FILE\_USER\_PAGE\_MARK\_DELETE\_FLAG**](file__manager_8c.md#define-file_user_page_mark_delete_flag) |
| define | FILE_USER_PAGE_MARK_DELETE_FLAG (([**PAGEID**](storage__common_8h.md#typedef-pageid)) 0x80000000) |
| define | LOG_BOOL_COUNT 3 |
| define | LOG_BOOL_COUNT 3 |
| define | LOG_DATA_SIZE ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**VFID**](dbtype__def_8h.md#typedef-vfid)) + [**sizeof**](broker__monitor_8c.md#function-timeout) ([**VPID**](dbtype__def_8h.md#typedef-vpid))) |
| define | UNDO_DATA_SIZE ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**VFID**](dbtype__def_8h.md#typedef-vfid)) + [**sizeof**](broker__monitor_8c.md#function-timeout) ([**VPID**](dbtype__def_8h.md#typedef-vpid))) |
| define | file_log (func, msg, ...) /* multi line expression */ |
Public Types Documentation¶
enum FILE_ALLOC_TYPE¶
enum FILE_ALLOC_TYPE {
FILE_ALLOC_USER_PAGE,
FILE_ALLOC_TABLE_PAGE,
FILE_ALLOC_TABLE_PAGE_FULL_SECTOR
};
typedef FILE_EXTDATA_FUNC¶
typedef int(* FILE_EXTDATA_FUNC) (THREAD_ENTRY *thread_p, const FILE_EXTENSIBLE_DATA *extdata, bool *stop, void *args);
typedef FILE_EXTDATA_ITEM_FUNC¶
typedef int(* FILE_EXTDATA_ITEM_FUNC) (THREAD_ENTRY *thread_p, const void *data, int index, bool *stop, void *args);
typedef FILE_EXTENSIBLE_DATA¶
typedef FILE_EXTENSIBLE_DATA_SEARCH_CONTEXT¶
typedef FILE_FIND_NTH_CONTEXT¶
typedef FILE_HEADER¶
typedef FILE_MAP_CONTEXT¶
typedef FILE_SET_TDE_ALGORITHM_ARGS¶
typedef FILE_TEMPCACHE¶
typedef FILE_TEMPCACHE_ENTRY¶
typedef FILE_TEMPCACHE_TRAN_ENTRY¶
typedef FILE_TRACKER_DUMP_HEAP_CONTEXT¶
typedef FILE_TRACKER_REUSE_HEAP_CONTEXT¶
typedef FILE_TRACK_HEAP_METADATA¶
typedef FILE_TRACK_ITEM¶
typedef FILE_TRACK_ITEM_FUNC¶
typedef int(* FILE_TRACK_ITEM_FUNC) (THREAD_ENTRY *thread_p, PAGE_PTR page_of_item, FILE_EXTENSIBLE_DATA *extdata, int index_item, bool *stop, void *args);
typedef FILE_TRACK_MARK_HEAP_DELETED_CONTEXT¶
typedef FILE_TRACK_METADATA¶
typedef FILE_VSID_COLLECTOR¶
union file_track_metadata¶
Public Static Attributes Documentation¶
variable file_Logging¶
variable file_Tempcache¶
variable file_Tracker_vfid¶
variable file_Tracker_vpid¶
Public Functions Documentation¶
function file_alloc¶
int file_alloc (
THREAD_ENTRY * thread_p,
const VFID * vfid,
FILE_INIT_PAGE_FUNC f_init,
void * f_init_args,
VPID * vpid_out,
PAGE_PTR * page_out
)
function file_alloc_multiple¶
int file_alloc_multiple (
THREAD_ENTRY * thread_p,
const VFID * vfid,
FILE_INIT_PAGE_FUNC f_init,
void * f_init_args,
int npages,
VPID * vpids_out
)
function file_alloc_sticky_first_page¶
int file_alloc_sticky_first_page (
THREAD_ENTRY * thread_p,
const VFID * vfid,
FILE_INIT_PAGE_FUNC f_init,
void * f_init_args,
VPID * vpid_out,
PAGE_PTR * page_out
)
function file_apply_tde_algorithm¶
int file_apply_tde_algorithm (
THREAD_ENTRY * thread_p,
const VFID * vfid,
const TDE_ALGORITHM tde_algo
)
function file_check_vpid¶
DISK_ISVALID file_check_vpid (
THREAD_ENTRY * thread_p,
const VFID * vfid,
const VPID * vpid_lookup
)
function file_create¶
int file_create (
THREAD_ENTRY * thread_p,
FILE_TYPE file_type,
FILE_TABLESPACE * tablespace,
FILE_DESCRIPTORS * des,
bool is_temp,
bool is_numerable,
VFID * vfid
)
function file_create_ehash¶
int file_create_ehash (
THREAD_ENTRY * thread_p,
int npages,
bool is_tmp,
FILE_EHASH_DES * des_ehash,
VFID * vfid
)
function file_create_ehash_dir¶
int file_create_ehash_dir (
THREAD_ENTRY * thread_p,
int npages,
bool is_tmp,
FILE_EHASH_DES * des_ehash,
VFID * vfid
)
function file_create_heap¶
int file_create_heap (
THREAD_ENTRY * thread_p,
bool reuse_oid,
const OID * class_oid,
VFID * vfid
)
function file_create_query_area¶
function file_create_temp¶
function file_create_temp_numerable¶
function file_create_with_npages¶
int file_create_with_npages (
THREAD_ENTRY * thread_p,
FILE_TYPE file_type,
int npages,
FILE_DESCRIPTORS * des,
VFID * vfid
)
function file_dealloc¶
int file_dealloc (
THREAD_ENTRY * thread_p,
const VFID * vfid,
const VPID * vpid,
FILE_TYPE file_type_hint
)
function file_delete_invalid_file¶
int file_delete_invalid_file (
THREAD_ENTRY * thread_p,
const std::unordered_map< VFID , FILE_TYPE > & invalid_files,
int * heap,
int * heap_ovf,
int * btree,
int * btree_ovf
)
function file_descriptor_dump¶
function file_descriptor_get¶
function file_descriptor_update¶
function file_destroy¶
function file_dump¶
function file_get_all_data_sectors¶
int file_get_all_data_sectors (
THREAD_ENTRY * thread_p,
const VFID * vfid,
FILE_FTAB_COLLECTOR * collector_out
)
function file_get_num_data_sectors¶
function file_get_num_total_user_pages¶
function file_get_num_user_pages¶
function file_get_sticky_first_page¶
function file_get_tde_algorithm¶
int file_get_tde_algorithm (
THREAD_ENTRY * thread_p,
const VFID * vfid,
PGBUF_LATCH_CONDITION fix_head_cond,
TDE_ALGORITHM * tde_algo
)
function file_get_tran_num_temp_files¶
function file_get_type¶
function file_init_page_type¶
function file_init_temp_page_type¶
function file_is_temp¶
function file_is_valid_heap_file¶
function file_manager_final¶
function file_manager_init¶
function file_map_pages¶
int file_map_pages (
THREAD_ENTRY * thread_p,
const VFID * vfid,
PGBUF_LATCH_MODE latch_mode,
PGBUF_LATCH_CONDITION latch_cond,
FILE_MAP_PAGE_FUNC func,
void * args
)
function file_numerable_find_nth¶
int file_numerable_find_nth (
THREAD_ENTRY * thread_p,
const VFID * vfid,
int nth,
bool auto_alloc,
FILE_INIT_PAGE_FUNC f_init,
void * f_init_args,
VPID * vpid_nth
)
function file_numerable_truncate¶
function file_postpone_destroy¶
function file_rv_dealloc_on_postpone¶
function file_rv_dealloc_on_undo¶
function file_rv_destroy¶
function file_rv_dump_extdata_add¶
function file_rv_dump_extdata_remove¶
function file_rv_dump_extdata_set_next¶
function file_rv_dump_vfid_and_vpid¶
function file_rv_extdata_add¶
function file_rv_extdata_merge¶
function file_rv_extdata_remove¶
function file_rv_extdata_set_next¶
function file_rv_fhead_alloc¶
function file_rv_fhead_convert_ftab_to_user_page¶
function file_rv_fhead_convert_user_to_ftab_page¶
function file_rv_fhead_dealloc¶
function file_rv_fhead_set_last_user_page_ftab¶
function file_rv_fhead_sticky_page¶
function file_rv_header_update_mark_deleted¶
function file_rv_partsect_clear¶
function file_rv_partsect_set¶
function file_rv_perm_expand_redo¶
function file_rv_perm_expand_undo¶
function file_rv_set_tde_algorithm¶
function file_rv_tracker_mark_heap_deleted¶
function file_rv_tracker_mark_heap_deleted_compensate_or_run_postpone¶
int file_rv_tracker_mark_heap_deleted_compensate_or_run_postpone (
THREAD_ENTRY * thread_p,
LOG_RCV * rcv
)
function file_rv_tracker_reuse_heap¶
function file_rv_tracker_unregister_undo¶
function file_rv_user_page_mark_delete¶
function file_rv_user_page_unmark_delete_logical¶
function file_rv_user_page_unmark_delete_physical¶
function file_spacedb¶
function file_temp_preserve¶
function file_temp_retire¶
function file_temp_retire_preserved¶
function file_temp_truncate¶
function file_tempcache_drop_tran_temp_files¶
function file_tracker_check¶
function file_tracker_create¶
function file_tracker_dump¶
function file_tracker_dump_all_btree_capacities¶
function file_tracker_dump_all_capacities¶
function file_tracker_dump_all_heap¶
function file_tracker_dump_all_heap_capacities¶
function file_tracker_interruptable_iterate¶
int file_tracker_interruptable_iterate (
THREAD_ENTRY * thread_p,
FILE_TYPE desired_ftype,
VFID * vfid,
OID * class_oid
)
function file_tracker_load¶
function file_tracker_reclaim_marked_deleted¶
function file_tracker_reuse_heap¶
function file_type_to_string¶
function operator==¶
function parse_target_vfid¶
function xfile_apply_tde_to_class_files¶
function xfile_tracker_clean_invalid_file¶
int xfile_tracker_clean_invalid_file (
THREAD_ENTRY * thread_p,
int * heap,
int * heap_ovf,
int * btree,
int * btree_ovf
)
function xfile_tracker_delete_target_file¶
function xfile_tracker_dump_file_list¶
Public Static Functions Documentation¶
function file_compare_track_items¶
function file_compare_vfids¶
function file_compare_vpids¶
function file_create_temp_internal¶
static int file_create_temp_internal (
THREAD_ENTRY * thread_p,
int npages,
FILE_TYPE ftype,
bool is_numerable,
VFID * vfid_out
)
function file_extdata_add_item_count¶
static int file_extdata_add_item_count (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_extdata_all_item_count¶
static int file_extdata_all_item_count (
THREAD_ENTRY * thread_p,
FILE_EXTENSIBLE_DATA * extdata,
int * count
)
function file_extdata_append¶
function file_extdata_append_array¶
static void file_extdata_append_array (
FILE_EXTENSIBLE_DATA * extdata,
const void * append_data,
INT16 count
)
function file_extdata_apply_funcs¶
static int file_extdata_apply_funcs (
THREAD_ENTRY * thread_p,
FILE_EXTENSIBLE_DATA * extdata_in,
FILE_EXTDATA_FUNC f_extdata,
void * f_extdata_args,
FILE_EXTDATA_ITEM_FUNC f_item,
void * f_item_args,
bool for_write,
FILE_EXTENSIBLE_DATA ** extdata_out,
PAGE_PTR * page_out
)
function file_extdata_at¶
function file_extdata_can_merge¶
static bool file_extdata_can_merge (
const FILE_EXTENSIBLE_DATA * extdata_src,
const FILE_EXTENSIBLE_DATA * extdata_dest
)
function file_extdata_collect_data_sectors_full¶
static int file_extdata_collect_data_sectors_full (
THREAD_ENTRY * thread_p,
const void * item,
int index_unused,
bool * stop,
void * args
)
function file_extdata_collect_data_sectors_part¶
static int file_extdata_collect_data_sectors_part (
THREAD_ENTRY * thread_p,
const void * item,
int index_unused,
bool * stop,
void * args
)
function file_extdata_collect_ftab_pages¶
static int file_extdata_collect_ftab_pages (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_extdata_end¶
function file_extdata_find_and_remove_item¶
static int file_extdata_find_and_remove_item (
THREAD_ENTRY * thread_p,
FILE_EXTENSIBLE_DATA * extdata_first,
PAGE_PTR page_first,
const void * item,
int (*)( const void *, const void *) compare_func,
bool ordered,
void * item_pop,
VPID * vpid_merged
)
function file_extdata_find_not_full¶
static int file_extdata_find_not_full (
THREAD_ENTRY * thread_p,
FILE_EXTENSIBLE_DATA ** extdata,
PAGE_PTR * page_out,
bool * found
)
function file_extdata_find_nth_vpid¶
static int file_extdata_find_nth_vpid (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_extdata_find_nth_vpid_and_skip_marked¶
static int file_extdata_find_nth_vpid_and_skip_marked (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_extdata_find_ordered¶
static void file_extdata_find_ordered (
const FILE_EXTENSIBLE_DATA * extdata,
const void * item_to_find,
int (*)( const void *, const void *) compare_func,
bool * found,
int * position
)
function file_extdata_func_for_search_ordered¶
static int file_extdata_func_for_search_ordered (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_extdata_init¶
function file_extdata_insert_at¶
static void file_extdata_insert_at (
FILE_EXTENSIBLE_DATA * extdata,
int position,
int count,
const void * data
)
function file_extdata_is_empty¶
function file_extdata_is_full¶
function file_extdata_item_count¶
function file_extdata_item_func_for_search¶
static int file_extdata_item_func_for_search (
THREAD_ENTRY * thread_p,
const void * item,
int index,
bool * stop,
void * args
)
function file_extdata_max_size¶
function file_extdata_merge_ordered¶
static void file_extdata_merge_ordered (
const FILE_EXTENSIBLE_DATA * extdata_src,
FILE_EXTENSIBLE_DATA * extdata_dest,
int (*)( const void *, const void *) compare_func
)
function file_extdata_merge_pages¶
static bool file_extdata_merge_pages (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata_src,
const PAGE_PTR page_src,
FILE_EXTENSIBLE_DATA * extdata_dest,
PAGE_PTR page_dest,
int (*)( const void *, const void *) compare_func,
bool ordered
)
function file_extdata_merge_unordered¶
static void file_extdata_merge_unordered (
const FILE_EXTENSIBLE_DATA * extdata_src,
FILE_EXTENSIBLE_DATA * extdata_dest
)
function file_extdata_remaining_capacity¶
function file_extdata_remove_at¶
function file_extdata_search_item¶
static int file_extdata_search_item (
THREAD_ENTRY * thread_p,
FILE_EXTENSIBLE_DATA ** extdata,
const void * item_to_find,
int (*)( const void *, const void *) compare_func,
bool is_ordered,
bool for_write,
bool * found,
int * position,
PAGE_PTR * page_extdata
)
function file_extdata_size¶
function file_extdata_start¶
function file_extdata_update_item¶
static void file_extdata_update_item (
THREAD_ENTRY * thread_p,
PAGE_PTR page_extdata,
const void * item_newval,
int index_item,
FILE_EXTENSIBLE_DATA * extdata
)
function file_file_map_set_tde_algorithm¶
static int file_file_map_set_tde_algorithm (
THREAD_ENTRY * thread_p,
PAGE_PTR * page,
bool * stop,
void * args
)
function file_full_table_extdata_dump¶
static int file_full_table_extdata_dump (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_full_table_item_dump¶
static int file_full_table_item_dump (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_get_tde_algorithm_internal¶
function file_get_tempcache_entry_index¶
function file_header_alloc¶
static void file_header_alloc (
FILE_HEADER * fhead,
FILE_ALLOC_TYPE alloc_type,
bool was_empty,
bool is_full
)
function file_header_copy¶
static int file_header_copy (
THREAD_ENTRY * thread_p,
const VFID * vfid,
FILE_HEADER * fhead_copy
)
function file_header_dealloc¶
static void file_header_dealloc (
FILE_HEADER * fhead,
FILE_ALLOC_TYPE alloc_type,
bool is_empty,
bool was_full
)
function file_header_dump¶
function file_header_dump_descriptor¶
static void file_header_dump_descriptor (
THREAD_ENTRY * thread_p,
const FILE_HEADER * fhead,
FILE * fp
)
function file_header_init¶
function file_header_sanity_check¶
function file_header_update_mark_deleted¶
static void file_header_update_mark_deleted (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
int delta
)
function file_init_page_type_internal¶
static int file_init_page_type_internal (
THREAD_ENTRY * thread_p,
PAGE_PTR page,
PAGE_TYPE ptype,
bool is_temp
)
function file_log_extdata_add¶
static void file_log_extdata_add (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
PAGE_PTR page,
int position,
int count,
const void * data
)
function file_log_extdata_remove¶
static void file_log_extdata_remove (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
PAGE_PTR page,
int position,
int count
)
function file_log_extdata_set_next¶
static void file_log_extdata_set_next (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
PAGE_PTR page,
const VPID * vpid_next
)
function file_log_fhead_alloc¶
static void file_log_fhead_alloc (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
FILE_ALLOC_TYPE alloc_type,
bool was_empty,
bool is_full
)
function file_log_fhead_dealloc¶
static void file_log_fhead_dealloc (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
FILE_ALLOC_TYPE alloc_type,
bool is_empty,
bool was_full
)
function file_numerable_add_page¶
static int file_numerable_add_page (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
const VPID * vpid
)
function file_partial_table_extdata_dump¶
static int file_partial_table_extdata_dump (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_partial_table_item_dump¶
static int file_partial_table_item_dump (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_partsect_alloc¶
static bool file_partsect_alloc (
FILE_PARTIAL_SECTOR * partsect,
VPID * vpid_out,
int * offset_out
)
function file_partsect_clear_bit¶
function file_partsect_is_bit_set¶
function file_partsect_is_empty¶
function file_partsect_is_full¶
function file_partsect_pageid_to_offset¶
function file_partsect_set_bit¶
function file_perm_alloc¶
static int file_perm_alloc (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
FILE_ALLOC_TYPE alloc_type,
VPID * vpid_alloc_out
)
function file_perm_dealloc¶
static int file_perm_dealloc (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
const VPID * vpid_dealloc,
FILE_ALLOC_TYPE alloc_type
)
function file_perm_expand¶
function file_print_name_of_class¶
static void file_print_name_of_class (
THREAD_ENTRY * thread_p,
FILE * fp,
const OID * class_oid_p
)
function file_rv_dealloc_internal¶
static int file_rv_dealloc_internal (
THREAD_ENTRY * thread_p,
LOG_RCV * rcv,
bool compensate_or_run_postpone
)
function file_rv_partsect_update¶
function file_sector_map_dealloc¶
static int file_sector_map_dealloc (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_sector_map_dealloc_temp¶
static int file_sector_map_dealloc_temp (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_sector_map_pages¶
static int file_sector_map_pages (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_set_tde_algorithm¶
static int file_set_tde_algorithm (
THREAD_ENTRY * thread_p,
const VFID * vfid,
TDE_ALGORITHM tde_algo
)
function file_set_tde_algorithm_internal¶
function file_table_add_full_sector¶
static int file_table_add_full_sector (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
const VSID * vsid
)
function file_table_append_full_sector_page¶
static int file_table_append_full_sector_page (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
const VPID * vpid_new
)
function file_table_check¶
static DISK_ISVALID file_table_check (
THREAD_ENTRY * thread_p,
const VFID * vfid,
DISK_VOLMAP_CLONE * disk_map_clone
)
function file_table_check_page_is_in_sectors¶
static int file_table_check_page_is_in_sectors (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
function file_table_collect_all_vsids¶
static int file_table_collect_all_vsids (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
FILE_VSID_COLLECTOR * collector_out
)
function file_table_collect_ftab_pages¶
static int file_table_collect_ftab_pages (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
bool collect_numerable,
FILE_FTAB_COLLECTOR * collector_out
)
function file_table_collect_vsid¶
static int file_table_collect_vsid (
THREAD_ENTRY * thread_p,
const void * item,
int index_unused,
bool * stop,
void * args
)
function file_table_collector_has_page¶
function file_table_dump¶
function file_table_move_partial_sectors_to_header¶
static int file_table_move_partial_sectors_to_header (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
FILE_ALLOC_TYPE alloc_type,
VPID * vpid_alloc_out
)
function file_temp_alloc¶
static int file_temp_alloc (
THREAD_ENTRY * thread_p,
PAGE_PTR page_fhead,
FILE_ALLOC_TYPE alloc_type,
VPID * vpid_alloc_out
)
function file_temp_reset_user_pages¶
function file_temp_retire_internal¶
static int file_temp_retire_internal (
THREAD_ENTRY * thread_p,
const VFID * vfid,
bool was_preserved
)
function file_temp_set_type¶
function file_tempcache_alloc_entry¶
function file_tempcache_cache_or_drop_entries¶
static void file_tempcache_cache_or_drop_entries (
THREAD_ENTRY * thread_p,
FILE_TEMPCACHE_ENTRY ** entries
)
function file_tempcache_check_duplicate¶
static bool file_tempcache_check_duplicate (
THREAD_ENTRY * thread_p,
FILE_TEMPCACHE_ENTRY * entry,
bool is_numerable
)
function file_tempcache_check_lock¶
function file_tempcache_dump¶
function file_tempcache_final¶
function file_tempcache_free_entry_list¶
function file_tempcache_get¶
static int file_tempcache_get (
THREAD_ENTRY * thread_p,
FILE_TYPE ftype,
bool numerable,
FILE_TEMPCACHE_ENTRY ** entry
)
function file_tempcache_init¶
function file_tempcache_lock¶
function file_tempcache_lock_tran_entry¶
function file_tempcache_pop_tran_file¶
static FILE_TEMPCACHE_ENTRY * file_tempcache_pop_tran_file (
THREAD_ENTRY * thread_p,
const VFID * vfid
)
function file_tempcache_push_tran_file¶
function file_tempcache_put¶
function file_tempcache_retire_entry¶
function file_tempcache_unlock¶
function file_tempcache_unlock_tran_entry¶
function file_tracker_apply_to_file¶
static int file_tracker_apply_to_file (
THREAD_ENTRY * thread_p,
const VFID * vfid,
PGBUF_LATCH_MODE mode,
FILE_TRACK_ITEM_FUNC func,
void * args
)
function file_tracker_get_and_protect¶
static int file_tracker_get_and_protect (
THREAD_ENTRY * thread_p,
FILE_TYPE desired_type,
FILE_TRACK_ITEM * item,
OID * class_oid,
bool * stop
)
function file_tracker_init_page¶
function file_tracker_item_check¶
static int file_tracker_item_check (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_collect_invalid_file¶
static int file_tracker_item_collect_invalid_file (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_delete_target_file¶
static int file_tracker_item_delete_target_file (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_dump¶
static int file_tracker_item_dump (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_dump_btree_capacity¶
static int file_tracker_item_dump_btree_capacity (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_dump_capacity¶
static int file_tracker_item_dump_capacity (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_dump_file¶
static int file_tracker_item_dump_file (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_dump_heap¶
static int file_tracker_item_dump_heap (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_dump_heap_capacity¶
static int file_tracker_item_dump_heap_capacity (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_mark_heap_deleted¶
static int file_tracker_item_mark_heap_deleted (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * ignore_args
)
function file_tracker_item_reuse_heap¶
static int file_tracker_item_reuse_heap (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_item_spacedb¶
static int file_tracker_item_spacedb (
THREAD_ENTRY * thread_p,
PAGE_PTR page_of_item,
FILE_EXTENSIBLE_DATA * extdata,
int index_item,
bool * stop,
void * args
)
function file_tracker_map¶
static int file_tracker_map (
THREAD_ENTRY * thread_p,
PGBUF_LATCH_MODE latch_mode,
FILE_TRACK_ITEM_FUNC func,
void * args
)
function file_tracker_register¶
static int file_tracker_register (
THREAD_ENTRY * thread_p,
const VFID * vfid,
FILE_TYPE ftype,
FILE_TRACK_METADATA * metadata
)
function file_tracker_register_internal¶
static int file_tracker_register_internal (
THREAD_ENTRY * thread_p,
PAGE_PTR page_track_head,
const FILE_TRACK_ITEM * item
)
function file_tracker_spacedb¶
function file_tracker_unregister¶
function file_user_page_table_extdata_dump¶
static int file_user_page_table_extdata_dump (
THREAD_ENTRY * thread_p,
const FILE_EXTENSIBLE_DATA * extdata,
bool * stop,
void * args
)
function file_user_page_table_item_dump¶
static int file_user_page_table_item_dump (
THREAD_ENTRY * thread_p,
const void * data,
int index,
bool * stop,
void * args
)
Macro Definition Documentation¶
define FILE_ALLOC_TYPE_STRING¶
#define FILE_ALLOC_TYPE_STRING (
alloc_type
) `((alloc_type) == FILE_ALLOC_USER_PAGE ? "alloc user page" : "alloc table page" )`
define FILE_CACHE_LAST_FIND_NTH¶
define FILE_EXTDATA_AS_ARGS¶
#define FILE_EXTDATA_AS_ARGS (
extdata
) `VPID_AS_ARGS (&( extdata )->vpid_next), ( extdata )->max_size, ( extdata )->size_of_item, ( extdata )->n_items`
define FILE_EXTDATA_HEADER_ALIGNED_SIZE¶
#define FILE_EXTDATA_HEADER_ALIGNED_SIZE `( DB_ALIGN ( sizeof ( FILE_EXTENSIBLE_DATA ), MAX_ALIGNMENT ))`
define FILE_EXTDATA_MSG¶
#define FILE_EXTDATA_MSG (
name
) `"\t" name ": { vpid_next = %d|%d, max_size = %d, item_size = %d, n_items = %d } \ n"`
define FILE_FLAG_ENCRYPTED_AES¶
define FILE_FLAG_ENCRYPTED_ARIA¶
define FILE_FLAG_ENCRYPTED_MASK¶
define FILE_FLAG_NUMERABLE¶
define FILE_FLAG_TEMPORARY¶
define FILE_GET_HEADER_VPID¶
#define FILE_GET_HEADER_VPID (
vfid,
vpid
) `( vpid )->volid = ( vfid )->volid; ( vpid )->pageid = ( vfid )->fileid`
define FILE_GET_TRACKER_LOCK_MODE¶
#define FILE_GET_TRACKER_LOCK_MODE (
file_type
) `(((file_type) == FILE_BTREE ) ? IX_LOCK : SCH_S_LOCK )`
define FILE_HEADER_ALIGNED_SIZE¶
#define FILE_HEADER_ALIGNED_SIZE `(( INT16 ) ( DB_ALIGN ( sizeof ( FILE_HEADER ), MAX_ALIGNMENT )))`
define FILE_HEADER_GET_FULL_FTAB¶
define FILE_HEADER_GET_PART_FTAB¶
define FILE_HEADER_GET_USER_PAGE_FTAB¶
define FILE_HEAD_ALLOC_AS_ARGS¶
define FILE_HEAD_ALLOC_MSG¶
define FILE_HEAD_FULL_AS_ARGS¶
define FILE_HEAD_FULL_MSG¶
define FILE_IS_NUMERABLE¶
define FILE_IS_TDE_ENCRYPTED¶
define FILE_IS_TEMPORARY¶
define FILE_NUMERABLE_REGULAR_STRING¶
#define FILE_NUMERABLE_REGULAR_STRING (
is_numerable
) `(( is_numerable ) ? "numerable" : "regular")`
define FILE_PARTSECT_AS_ARGS¶
#define FILE_PARTSECT_AS_ARGS (
ps
) `VSID_AS_ARGS (&( ps )-> vsid ), ( long long unsigned int ) ( ps )-> page_bitmap`
define FILE_PARTSECT_MSG¶
#define FILE_PARTSECT_MSG (
name
) `"\t" name ": { vsid = %d|%d, page bitmap = " BIT64_HEXA_PRINT_FORMAT " } \n"`
define FILE_PERM_TEMP_STRING¶
define FILE_RV_DEALLOC_COMPENSATE¶
define FILE_RV_DEALLOC_RUN_POSTPONE¶
define FILE_TABLESPACE_AS_ARGS¶
define FILE_TABLESPACE_DEFAULT_MAX_EXPAND¶
#define FILE_TABLESPACE_DEFAULT_MAX_EXPAND `( DISK_SECTOR_NPAGES * DB_PAGESIZE * 1024); /* 1 k sectors */`
define FILE_TABLESPACE_DEFAULT_MIN_EXPAND¶
define FILE_TABLESPACE_DEFAULT_RATIO_EXPAND¶
define FILE_TABLESPACE_FOR_PERM_NPAGES¶
define FILE_TABLESPACE_FOR_TEMP_NPAGES¶
define FILE_TABLESPACE_MSG¶
#define FILE_TABLESPACE_MSG `"\ttablespace = { init_size = % lld , expand_ratio = %f, expand_min_size = %d, expand_max_size = %d } \ n"`
define FILE_TEMPCACHE_AS_ARGS¶
define FILE_TEMPCACHE_ENTRY_AS_ARGS¶
#define FILE_TEMPCACHE_ENTRY_AS_ARGS (
ent
) `ent, VFID_AS_ARGS (&(ent)-> vfid ), file_type_to_string ((ent)->ftype)`
define FILE_TEMPCACHE_ENTRY_MSG¶
define FILE_TEMPCACHE_MSG¶
define FILE_TRACK_ITEM_AS_ARGS¶
#define FILE_TRACK_ITEM_AS_ARGS (
item
) `(item)->volid, (item)->fileid, file_type_to_string (( FILE_TYPE ) (item)->type)`
define FILE_TRACK_ITEM_MSG¶
define FILE_TYPE_CAN_BE_NUMERABLE¶
define FILE_TYPE_IS_ALWAYS_TEMP¶
define FILE_TYPE_IS_NEVER_TEMP¶
#define FILE_TYPE_IS_NEVER_TEMP (
ftype
) `(! FILE_TYPE_IS_ALWAYS_TEMP (ftype) && ! FILE_TYPE_IS_SOMETIMES_TEMP (ftype))`
define FILE_TYPE_IS_SOMETIMES_TEMP¶
define FILE_USER_PAGE_CLEAR_MARK_DELETED¶
#define FILE_USER_PAGE_CLEAR_MARK_DELETED (
vpid
) `(( VPID *) vpid )->pageid &= ~ FILE_USER_PAGE_MARK_DELETE_FLAG`
define FILE_USER_PAGE_IS_MARKED_DELETED¶
#define FILE_USER_PAGE_IS_MARKED_DELETED (
vpid
) `(((( VPID *) vpid )->pageid & FILE_USER_PAGE_MARK_DELETE_FLAG ) != 0)`
define FILE_USER_PAGE_MARK_DELETED¶
#define FILE_USER_PAGE_MARK_DELETED (
vpid
) `(( VPID *) vpid )->pageid |= FILE_USER_PAGE_MARK_DELETE_FLAG`
define FILE_USER_PAGE_MARK_DELETE_FLAG¶
define LOG_BOOL_COUNT¶
define LOG_BOOL_COUNT¶
define LOG_DATA_SIZE¶
define UNDO_DATA_SIZE¶
define file_log¶
#define file_log (
func,
msg,
...
) `if ( file_Logging ) \ _er_log_debug ( ARG_FILE_LINE , "FILE " func " " LOG_THREAD_TRAN_MSG ": " msg "\n", \ LOG_THREAD_TRAN_ARGS ( thread_get_thread_entry_info ()), __VA_ARGS__ )`
The documentation for this class was generated from the following file cubrid/src/storage/file_manager.c