CUBRID Engine  latest
extendible_hash.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <math.h>
#include "chartype.h"
#include "storage_common.h"
#include "memory_alloc.h"
#include "object_representation.h"
#include "error_manager.h"
#include "xserver_interface.h"
#include "log_manager.h"
#include "extendible_hash.h"
#include "page_buffer.h"
#include "lock_manager.h"
#include "slotted_page.h"
#include "file_manager.h"
#include "overflow_file.h"
#include "memory_hash.h"
#include "tz_support.h"
#include "db_date.h"
#include "thread_compat.hpp"

Go to the source code of this file.

Classes

struct  ehash_dir_header
 
struct  ehash_dir_record
 
struct  ehash_bucket_header
 
struct  ehash_repetition
 

Macros

#define EHASH_OVERFLOW_RATE   0.9 /* UPPER THRESHOLD for a merge operation. */
 
#define EHASH_UNDERFLOW_RATE   0.4 /* LOWER THRESHOLD for a merge operation. */
 
#define EHASH_OVERFLOW_THRESHOLD   (EHASH_OVERFLOW_RATE * DB_PAGESIZE)
 
#define EHASH_UNDERFLOW_THRESHOLD   (EHASH_UNDERFLOW_RATE * DB_PAGESIZE)
 
#define EHASH_HASH_KEY_BITS   (sizeof(EHASH_HASH_KEY) * 8)
 
#define EHASH_SHORT_BITS   (sizeof(short) * 8)
 
#define EHASH_LONG_STRING_PREFIX_SIZE   10
 
#define EHASH_DIR_HEADER_SIZE   ((ssize_t) (((sizeof(EHASH_DIR_HEADER) + sizeof(int) - 1 ) / sizeof(int) ) * sizeof(int)))
 
#define EHASH_MAX_STRING_SIZE   (DB_PAGESIZE - (SSIZEOF(EHASH_BUCKET_HEADER) + 16))
 
#define EHASH_NUM_FIRST_PAGES   ((DB_PAGESIZE - EHASH_DIR_HEADER_SIZE) / SSIZEOF (EHASH_DIR_RECORD))
 
#define EHASH_LAST_OFFSET_IN_FIRST_PAGE   (EHASH_DIR_HEADER_SIZE + (EHASH_NUM_FIRST_PAGES - 1) * sizeof(EHASH_DIR_RECORD))
 
#define EHASH_NUM_NON_FIRST_PAGES   (DB_PAGESIZE / sizeof(EHASH_DIR_RECORD))
 
#define EHASH_LAST_OFFSET_IN_NON_FIRST_PAGE   ((EHASH_NUM_NON_FIRST_PAGES - 1) * sizeof(EHASH_DIR_RECORD))
 
#define GETBITS(value, pos, n)   ( ((value) >> ( EHASH_HASH_KEY_BITS - (pos) - (n) + 1)) & (~(~0UL << (n))) )
 
#define FIND_OFFSET(hash_key, depth)   (GETBITS((hash_key), 1, (depth)))
 
#define GETBIT(word, pos)   (GETBITS((word), (pos), 1))
 
#define SETBIT(word, pos)   ( (word) | (1 << (EHASH_HASH_KEY_BITS - (pos))) )
 
#define CLEARBIT(word, pos)   ( (word) & ~(1 << (EHASH_HASH_KEY_BITS - (pos))) )
 

Typedefs

typedef unsigned int EHASH_HASH_KEY
 
typedef struct ehash_dir_header EHASH_DIR_HEADER
 
typedef struct ehash_dir_record EHASH_DIR_RECORD
 
typedef struct ehash_bucket_header EHASH_BUCKET_HEADER
 
typedef struct ehash_repetition EHASH_REPETITION
 

Enumerations

enum  EHASH_RESULT {
  EHASH_SUCCESSFUL_COMPLETION, EHASH_BUCKET_FULL, EHASH_BUCKET_UNDERFLOW, EHASH_BUCKET_EMPTY,
  EHASH_FULL_SIBLING_BUCKET, EHASH_NO_SIBLING_BUCKET, EHASH_ERROR_OCCURRED
}
 

Functions

static char * ehash_allocate_recdes (RECDES *recdes, int size, short type)
 
static void ehash_free_recdes (RECDES *recdes)
 
static int ehash_initialize_bucket_new_page (THREAD_ENTRY *thread_p, PAGE_PTR page_p, void *alignment_depth)
 
static int ehash_initialize_dir_new_page (THREAD_ENTRY *thread_p, PAGE_PTR page_p, void *args)
 
static short ehash_get_key_size (DB_TYPE key_type)
 
static EHIDehash_create_helper (THREAD_ENTRY *thread_p, EHID *ehid, DB_TYPE key_type, int exp_num_entries, OID *class_oid, int attr_id, bool istmp)
 
static PAGE_PTR ehash_fix_old_page (THREAD_ENTRY *thread_p, const VFID *vfid, const VPID *vpid, PGBUF_LATCH_MODE mode)
 
static PAGE_PTR ehash_fix_ehid_page (THREAD_ENTRY *thread_p, EHID *ehid, PGBUF_LATCH_MODE latch_mode)
 
static PAGE_PTR ehash_fix_nth_page (THREAD_ENTRY *thread_p, const VFID *vfid, int offset, PGBUF_LATCH_MODE mode)
 
static void * ehash_insert_helper (THREAD_ENTRY *thread_p, EHID *ehid, void *key, OID *value_ptr, int lock_type, VPID *existing_ovf_vpid)
 
static EHASH_RESULT ehash_insert_to_bucket (THREAD_ENTRY *thread_p, EHID *ehid, VFID *ovf_file, bool is_temp, PAGE_PTR buc_pgptr, DB_TYPE key_type, void *key_ptr, OID *value_ptr, VPID *existing_ovf_vpid)
 
static int ehash_compose_record (DB_TYPE key_type, void *key_ptr, OID *value_ptr, RECDES *recdes)
 
static bool ehash_locate_slot (THREAD_ENTRY *thread_p, PAGE_PTR page, DB_TYPE key_type, void *key, PGSLOTID *position)
 
static PAGE_PTR ehash_split_bucket (THREAD_ENTRY *thread_p, EHASH_DIR_HEADER *dir_header, PAGE_PTR buc_pgptr, void *key, int *old_local_depth, int *new_local_depth, VPID *sib_vpid, bool is_temp)
 
static int ehash_expand_directory (THREAD_ENTRY *thread_p, EHID *ehid, int new_depth, bool is_temp)
 
static int ehash_connect_bucket (THREAD_ENTRY *thread_p, EHID *ehid, int local_depth, EHASH_HASH_KEY hash_key, VPID *buc_vpid, bool is_temp)
 
static char ehash_find_depth (THREAD_ENTRY *thread_p, EHID *ehid, int location, VPID *vpid, VPID *sib_vpid)
 
static void ehash_merge (THREAD_ENTRY *thread_p, EHID *ehid, void *key, bool is_temp)
 
static void ehash_shrink_directory (THREAD_ENTRY *thread_p, EHID *ehid, int new_depth, bool is_temp)
 
static EHASH_HASH_KEY ehash_hash (void *orig_key, DB_TYPE key_type)
 
static int ehash_find_bucket_vpid (THREAD_ENTRY *thread_p, EHID *ehid, EHASH_DIR_HEADER *dir_header, int location, PGBUF_LATCH_MODE latch, VPID *out_vpid)
 
static PAGE_PTR ehash_find_bucket_vpid_with_hash (THREAD_ENTRY *thread_p, EHID *ehid, void *key, PGBUF_LATCH_MODE root_latch, PGBUF_LATCH_MODE bucket_latch, VPID *out_vpid, EHASH_HASH_KEY *out_hash_key, int *out_location)
 
static char * ehash_read_oid_from_record (char *rec_p, OID *oid_p)
 
static char * ehash_write_oid_to_record (char *rec_p, OID *oid_p)
 
static char * ehash_read_ehid_from_record (char *rec_p, EHID *ehid_p)
 
static char * ehash_write_ehid_to_record (char *rec_p, EHID *ehid_p)
 
static int ehash_rv_delete (THREAD_ENTRY *thread_p, EHID *ehid, void *key)
 
static void ehash_adjust_local_depth (THREAD_ENTRY *thread_p, EHID *ehid, PAGE_PTR dir_Rpgptr, EHASH_DIR_HEADER *dir_header, int depth, int delta, bool is_temp)
 
static int ehash_apply_each (THREAD_ENTRY *thread_p, EHID *ehid, RECDES *recdes, DB_TYPE key_type, char *bucrec_ptr, OID *assoc_value, int *out_apply_error, int(*apply_function)(THREAD_ENTRY *thread_p, void *key, void *data, void *args), void *args)
 
static int ehash_merge_permanent (THREAD_ENTRY *thread_p, EHID *ehid, PAGE_PTR dir_Rpgptr, EHASH_DIR_HEADER *dir_header, PAGE_PTR buc_pgptr, PAGE_PTR sib_pgptr, VPID *buc_vpid, VPID *sib_vpid, int num_recs, int loc, PGSLOTID first_slotid, int *out_new_local_depth, bool is_temp)
 
static void ehash_shrink_directory_if_need (THREAD_ENTRY *thread_p, EHID *ehid, EHASH_DIR_HEADER *dir_header, bool is_temp)
 
static EHASH_RESULT ehash_check_merge_possible (THREAD_ENTRY *thread_p, EHID *ehid, EHASH_DIR_HEADER *dir_header, VPID *buc_vpid, PAGE_PTR buc_pgptr, int location, int lock_type, int *old_local_depth, VPID *sib_vpid, PAGE_PTR *out_sib_pgptr, PGSLOTID *out_first_slotid, int *out_num_recs, int *out_loc)
 
static int ehash_distribute_records_into_two_bucket (THREAD_ENTRY *thread_p, EHASH_DIR_HEADER *dir_header, PAGE_PTR buc_pgptr, EHASH_BUCKET_HEADER *buc_header, int num_recs, PGSLOTID first_slotid, PAGE_PTR sib_pgptr)
 
static int ehash_find_first_bit_position (THREAD_ENTRY *thread_p, EHASH_DIR_HEADER *dir_header, PAGE_PTR buc_pgptr, EHASH_BUCKET_HEADER *buc_header, void *key, int num_recs, PGSLOTID first_slotid, int *old_local_depth, int *new_local_depth)
 
static int ehash_get_pseudo_key (THREAD_ENTRY *thread_p, RECDES *recdes, DB_TYPE key_type, EHASH_HASH_KEY *out_hash_key)
 
static bool ehash_binary_search_bucket (THREAD_ENTRY *thread_p, PAGE_PTR buc_pgptr, PGSLOTID num_record, DB_TYPE key_type, void *key, PGSLOTID *position)
 
static int ehash_compare_key (THREAD_ENTRY *thread_p, char *bucrec_ptr, DB_TYPE key_type, void *key, INT16 rec_type, int *out_compare_result)
 
static int ehash_write_key_to_record (RECDES *recdes, DB_TYPE key_type, void *key_ptr, short key_size, OID *value_ptr, bool long_str)
 
static EHASH_RESULT ehash_insert_bucket_after_extend_if_need (THREAD_ENTRY *thread_p, EHID *ehid, PAGE_PTR dir_Rpgptr, EHASH_DIR_HEADER *dir_header, VPID *buc_vpid, void *key, EHASH_HASH_KEY hash_key, int lock_type, bool is_temp, OID *value_ptr, VPID *existing_ovf_vpid)
 
static PAGE_PTR ehash_extend_bucket (THREAD_ENTRY *thread_p, EHID *ehid, PAGE_PTR dir_Rpgptr, EHASH_DIR_HEADER *dir_header, PAGE_PTR buc_pgptr, void *key, EHASH_HASH_KEY hash_key, int *new_bit, VPID *buc_vpid, bool is_temp)
 
static int ehash_insert_to_bucket_after_create (THREAD_ENTRY *thread_p, EHID *ehid, PAGE_PTR dir_Rpgptr, EHASH_DIR_HEADER *dir_header, VPID *buc_vpid, int location, EHASH_HASH_KEY hash_key, bool is_temp, void *key, OID *value_ptr, VPID *existing_ovf_vpid)
 
static EHASH_HASH_KEY ehash_hash_string_type (char *key, char *orig_key)
 
static EHASH_HASH_KEY ehash_hash_eight_bytes_type (char *key)
 
static void ehash_dump_bucket (THREAD_ENTRY *thread_p, PAGE_PTR buc_pgptr, DB_TYPE key_type)
 
static void ehash_dir_locate (int *out_page_no_p, int *out_offset_p)
 
int ehash_rv_init_dir_new_page_redo (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
EHIDxehash_create (THREAD_ENTRY *thread_p, EHID *ehid_p, DB_TYPE key_type, int exp_num_entries, OID *class_oid_p, int attr_id, bool is_tmp)
 
int xehash_destroy (THREAD_ENTRY *thread_p, EHID *ehid_p)
 
EH_SEARCH ehash_search (THREAD_ENTRY *thread_p, EHID *ehid_p, void *key_p, OID *value_p)
 
void * ehash_insert (THREAD_ENTRY *thread_p, EHID *ehid_p, void *key_p, OID *value_p)
 
void * ehash_delete (THREAD_ENTRY *thread_p, EHID *ehid_p, void *key_p)
 
int ehash_map (THREAD_ENTRY *thread_p, EHID *ehid_p, int(*apply_function)(THREAD_ENTRY *thread_p, void *key, void *data, void *args), void *args)
 
void ehash_dump (THREAD_ENTRY *thread_p, EHID *ehid_p)
 
int ehash_rv_init_bucket_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_init_dir_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_insert_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_insert_undo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_delete_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_delete_undo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_increment (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 
int ehash_rv_connect_bucket_redo (THREAD_ENTRY *thread_p, LOG_RCV *recv_p)
 

Macro Definition Documentation

#define CLEARBIT (   word,
  pos 
)    ( (word) & ~(1 << (EHASH_HASH_KEY_BITS - (pos))) )
#define EHASH_DIR_HEADER_SIZE   ((ssize_t) (((sizeof(EHASH_DIR_HEADER) + sizeof(int) - 1 ) / sizeof(int) ) * sizeof(int)))
#define EHASH_HASH_KEY_BITS   (sizeof(EHASH_HASH_KEY) * 8)
#define EHASH_LAST_OFFSET_IN_FIRST_PAGE   (EHASH_DIR_HEADER_SIZE + (EHASH_NUM_FIRST_PAGES - 1) * sizeof(EHASH_DIR_RECORD))

Definition at line 166 of file extendible_hash.c.

Referenced by ehash_expand_directory().

#define EHASH_LAST_OFFSET_IN_NON_FIRST_PAGE   ((EHASH_NUM_NON_FIRST_PAGES - 1) * sizeof(EHASH_DIR_RECORD))

Definition at line 174 of file extendible_hash.c.

Referenced by ehash_expand_directory().

#define EHASH_LONG_STRING_PREFIX_SIZE   10
#define EHASH_MAX_STRING_SIZE   (DB_PAGESIZE - (SSIZEOF(EHASH_BUCKET_HEADER) + 16))

Definition at line 158 of file extendible_hash.c.

Referenced by ehash_compose_record(), and ehash_insert_helper().

#define EHASH_NUM_FIRST_PAGES   ((DB_PAGESIZE - EHASH_DIR_HEADER_SIZE) / SSIZEOF (EHASH_DIR_RECORD))

Definition at line 162 of file extendible_hash.c.

Referenced by ehash_dir_locate().

#define EHASH_NUM_NON_FIRST_PAGES   (DB_PAGESIZE / sizeof(EHASH_DIR_RECORD))

Definition at line 170 of file extendible_hash.c.

Referenced by ehash_dir_locate().

#define EHASH_OVERFLOW_RATE   0.9 /* UPPER THRESHOLD for a merge operation. */

Definition at line 67 of file extendible_hash.c.

#define EHASH_OVERFLOW_THRESHOLD   (EHASH_OVERFLOW_RATE * DB_PAGESIZE)

Definition at line 88 of file extendible_hash.c.

Referenced by ehash_check_merge_possible().

#define EHASH_SHORT_BITS   (sizeof(short) * 8)

Definition at line 95 of file extendible_hash.c.

Referenced by ehash_hash_eight_bytes_type().

#define EHASH_UNDERFLOW_RATE   0.4 /* LOWER THRESHOLD for a merge operation. */

Definition at line 79 of file extendible_hash.c.

#define EHASH_UNDERFLOW_THRESHOLD   (EHASH_UNDERFLOW_RATE * DB_PAGESIZE)

Definition at line 89 of file extendible_hash.c.

Referenced by ehash_delete(), and ehash_merge().

#define FIND_OFFSET (   hash_key,
  depth 
)    (GETBITS((hash_key), 1, (depth)))

Definition at line 207 of file extendible_hash.c.

Referenced by ehash_find_bucket_vpid_with_hash().

#define GETBIT (   word,
  pos 
)    (GETBITS((word), (pos), 1))
#define GETBITS (   value,
  pos,
 
)    ( ((value) >> ( EHASH_HASH_KEY_BITS - (pos) - (n) + 1)) & (~(~0UL << (n))) )

Definition at line 191 of file extendible_hash.c.

Referenced by ehash_connect_bucket().

#define SETBIT (   word,
  pos 
)    ( (word) | (1 << (EHASH_HASH_KEY_BITS - (pos))) )

Typedef Documentation

Definition at line 124 of file extendible_hash.c.

Definition at line 100 of file extendible_hash.c.

Definition at line 117 of file extendible_hash.c.

typedef unsigned int EHASH_HASH_KEY

Definition at line 97 of file extendible_hash.c.

Definition at line 142 of file extendible_hash.c.

Enumeration Type Documentation

Enumerator
EHASH_SUCCESSFUL_COMPLETION 
EHASH_BUCKET_FULL 
EHASH_BUCKET_UNDERFLOW 
EHASH_BUCKET_EMPTY 
EHASH_FULL_SIBLING_BUCKET 
EHASH_NO_SIBLING_BUCKET 
EHASH_ERROR_OCCURRED 

Definition at line 130 of file extendible_hash.c.

Function Documentation

static void ehash_adjust_local_depth ( THREAD_ENTRY thread_p,
EHID ehid,
PAGE_PTR  dir_Rpgptr,
EHASH_DIR_HEADER dir_header,
int  depth,
int  delta,
bool  is_temp 
)
static
static char * ehash_allocate_recdes ( RECDES recdes,
int  size,
short  type 
)
static
static int ehash_apply_each ( THREAD_ENTRY thread_p,
EHID ehid,
RECDES recdes,
DB_TYPE  key_type,
char *  bucrec_ptr,
OID assoc_value,
int *  out_apply_error,
int(*)(THREAD_ENTRY *thread_p, void *key, void *data, void *args)  apply_function,
void *  args 
)
static
static bool ehash_binary_search_bucket ( THREAD_ENTRY thread_p,
PAGE_PTR  buc_pgptr,
PGSLOTID  num_record,
DB_TYPE  key_type,
void *  key,
PGSLOTID position 
)
static

Definition at line 2393 of file extendible_hash.c.

References ARG_FILE_LINE, recdes::data, ehash_compare_key(), ER_EH_CORRUPTED, ER_FATAL_ERROR_SEVERITY, er_set(), NO_ERROR, PEEK, S_SUCCESS, spage_get_record(), and recdes::type.

Referenced by ehash_locate_slot().

Here is the caller graph for this function:

static EHASH_RESULT ehash_check_merge_possible ( THREAD_ENTRY thread_p,
EHID ehid,
EHASH_DIR_HEADER dir_header,
VPID buc_vpid,
PAGE_PTR  buc_pgptr,
int  location,
int  lock_type,
int *  old_local_depth,
VPID sib_vpid,
PAGE_PTR out_sib_pgptr,
PGSLOTID out_first_slotid,
int *  out_num_recs,
int *  out_loc 
)
static
static int ehash_compare_key ( THREAD_ENTRY thread_p,
char *  bucrec_ptr,
DB_TYPE  key_type,
void *  key,
INT16  rec_type,
int *  out_compare_result 
)
static
static int ehash_compose_record ( DB_TYPE  key_type,
void *  key_ptr,
OID value_ptr,
RECDES recdes 
)
static
static void ehash_dir_locate ( int *  out_page_no_p,
int *  out_offset_p 
)
static
static int ehash_distribute_records_into_two_bucket ( THREAD_ENTRY thread_p,
EHASH_DIR_HEADER dir_header,
PAGE_PTR  buc_pgptr,
EHASH_BUCKET_HEADER buc_header,
int  num_recs,
PGSLOTID  first_slotid,
PAGE_PTR  sib_pgptr 
)
static
static PAGE_PTR ehash_extend_bucket ( THREAD_ENTRY thread_p,
EHID ehid,
PAGE_PTR  dir_Rpgptr,
EHASH_DIR_HEADER dir_header,
PAGE_PTR  buc_pgptr,
void *  key,
EHASH_HASH_KEY  hash_key,
int *  new_bit,
VPID buc_vpid,
bool  is_temp 
)
static
static int ehash_find_bucket_vpid ( THREAD_ENTRY thread_p,
EHID ehid,
EHASH_DIR_HEADER dir_header,
int  location,
PGBUF_LATCH_MODE  latch,
VPID out_vpid 
)
static
static PAGE_PTR ehash_find_bucket_vpid_with_hash ( THREAD_ENTRY thread_p,
EHID ehid,
void *  key,
PGBUF_LATCH_MODE  root_latch,
PGBUF_LATCH_MODE  bucket_latch,
VPID out_vpid,
EHASH_HASH_KEY out_hash_key,
int *  out_location 
)
static
static char ehash_find_depth ( THREAD_ENTRY thread_p,
EHID ehid,
int  location,
VPID vpid,
VPID sib_vpid 
)
static
static int ehash_find_first_bit_position ( THREAD_ENTRY thread_p,
EHASH_DIR_HEADER dir_header,
PAGE_PTR  buc_pgptr,
EHASH_BUCKET_HEADER buc_header,
void *  key,
int  num_recs,
PGSLOTID  first_slotid,
int *  old_local_depth,
int *  new_local_depth 
)
static
static PAGE_PTR ehash_fix_ehid_page ( THREAD_ENTRY thread_p,
EHID ehid,
PGBUF_LATCH_MODE  latch_mode 
)
static
static PAGE_PTR ehash_fix_nth_page ( THREAD_ENTRY thread_p,
const VFID vfid,
int  offset,
PGBUF_LATCH_MODE  mode 
)
static
static int ehash_get_pseudo_key ( THREAD_ENTRY thread_p,
RECDES recdes,
DB_TYPE  key_type,
EHASH_HASH_KEY out_hash_key 
)
static

Definition at line 2501 of file extendible_hash.c.

References recdes::data, ehash_hash(), ER_FAILED, free_and_init, NO_ERROR, NULL, REC_BIGONE, and recdes::type.

Referenced by ehash_distribute_records_into_two_bucket(), and ehash_find_first_bit_position().

Here is the caller graph for this function:

static EHASH_HASH_KEY ehash_hash_eight_bytes_type ( char *  key)
static

Definition at line 4236 of file extendible_hash.c.

References EHASH_SHORT_BITS, htonl(), i, and ntohs().

Referenced by ehash_hash().

Here is the caller graph for this function:

static EHASH_HASH_KEY ehash_hash_string_type ( char *  key,
char *  orig_key 
)
static

Definition at line 4148 of file extendible_hash.c.

References char_isspace(), free_and_init, i, mht_1strhash(), mht_2strhash(), mht_3strhash(), NULL, p, and strlen.

Referenced by ehash_hash().

Here is the caller graph for this function:

static int ehash_initialize_dir_new_page ( THREAD_ENTRY thread_p,
PAGE_PTR  page_p,
void *  args 
)
static

Definition at line 710 of file extendible_hash.c.

References DONT_FREE, log_append_undoredo_data2(), NO_ERROR, NULL, PAGE_EHASH, pgbuf_set_dirty(), pgbuf_set_page_ptype(), and RVEH_INIT_NEW_DIR_PAGE.

Referenced by ehash_expand_directory().

Here is the caller graph for this function:

void* ehash_insert ( THREAD_ENTRY thread_p,
EHID ehid_p,
void *  key_p,
OID value_p 
)

Definition at line 1455 of file extendible_hash.c.

References ehash_insert_helper(), NULL, and S_LOCK.

Referenced by qexec_upddel_add_unique_oid_to_ehid().

Here is the caller graph for this function:

static EHASH_RESULT ehash_insert_bucket_after_extend_if_need ( THREAD_ENTRY thread_p,
EHID ehid,
PAGE_PTR  dir_Rpgptr,
EHASH_DIR_HEADER dir_header,
VPID buc_vpid,
void *  key,
EHASH_HASH_KEY  hash_key,
int  lock_type,
bool  is_temp,
OID value_ptr,
VPID existing_ovf_vpid 
)
static
static bool ehash_locate_slot ( THREAD_ENTRY thread_p,
PAGE_PTR  page,
DB_TYPE  key_type,
void *  key,
PGSLOTID position 
)
static
static int ehash_merge_permanent ( THREAD_ENTRY thread_p,
EHID ehid,
PAGE_PTR  dir_Rpgptr,
EHASH_DIR_HEADER dir_header,
PAGE_PTR  buc_pgptr,
PAGE_PTR  sib_pgptr,
VPID buc_vpid,
VPID sib_vpid,
int  num_recs,
int  loc,
PGSLOTID  first_slotid,
int *  out_new_local_depth,
bool  is_temp 
)
static
static char * ehash_read_ehid_from_record ( char *  rec_p,
EHID ehid_p 
)
static

Definition at line 5779 of file extendible_hash.c.

References vfid::fileid, ehid::pageid, ehid::vfid, and vfid::volid.

Referenced by ehash_rv_delete_undo(), and ehash_rv_insert_undo().

Here is the caller graph for this function:

static char * ehash_read_oid_from_record ( char *  rec_p,
OID oid_p 
)
static

Definition at line 5749 of file extendible_hash.c.

References db_identifier::pageid, db_identifier::slotid, and db_identifier::volid.

Referenced by ehash_dump_bucket(), ehash_map(), ehash_rv_delete_undo(), and ehash_search().

Here is the caller graph for this function:

int ehash_rv_connect_bucket_redo ( THREAD_ENTRY thread_p,
LOG_RCV recv_p 
)
int ehash_rv_increment ( THREAD_ENTRY thread_p,
LOG_RCV recv_p 
)
int ehash_rv_init_dir_redo ( THREAD_ENTRY thread_p,
LOG_RCV recv_p 
)
static void ehash_shrink_directory_if_need ( THREAD_ENTRY thread_p,
EHID ehid,
EHASH_DIR_HEADER dir_header,
bool  is_temp 
)
static

Definition at line 3607 of file extendible_hash.c.

References ehash_dir_header::depth, ehash_shrink_directory(), i, and ehash_dir_header::local_depth_count.

Referenced by ehash_merge().

Here is the caller graph for this function:

static char * ehash_write_ehid_to_record ( char *  rec_p,
EHID ehid_p 
)
static

Definition at line 5794 of file extendible_hash.c.

References vfid::fileid, ehid::pageid, ehid::vfid, and vfid::volid.

Referenced by ehash_delete(), and ehash_insert_to_bucket().

Here is the caller graph for this function:

static int ehash_write_key_to_record ( RECDES recdes,
DB_TYPE  key_type,
void *  key_ptr,
short  key_size,
OID value_ptr,
bool  long_str 
)
static
static char * ehash_write_oid_to_record ( char *  rec_p,
OID oid_p 
)
static

Definition at line 5764 of file extendible_hash.c.

References db_identifier::pageid, db_identifier::slotid, and db_identifier::volid.

Referenced by ehash_insert_to_bucket(), and ehash_write_key_to_record().

Here is the caller graph for this function:

EHID* xehash_create ( THREAD_ENTRY thread_p,
EHID ehid_p,
DB_TYPE  key_type,
int  exp_num_entries,
OID class_oid_p,
int  attr_id,
bool  is_tmp 
)

Definition at line 864 of file extendible_hash.c.

References ehash_create_helper().

Referenced by boot_create_all_volumes(), catalog_create(), and qexec_init_upddel_ehash_files().

Here is the caller graph for this function:

int xehash_destroy ( THREAD_ENTRY thread_p,
EHID ehid_p 
)