CUBRID Engine  latest
memory_hash.h File Reference
#include "dbtype_def.h"
#include "memory_alloc.h"
#include "thread_compat.hpp"
#include <stdio.h>
Include dependency graph for memory_hash.h:

Go to the source code of this file.

Classes

struct  hentry
 
struct  mht_table
 
struct  hentry_hls
 
struct  mht_hls_table
 

Macros

#define MHT2STR_COLL(id, str, size)   (lang_get_collation (id))->mht2str ((lang_get_collation (id)), (str), (size))
 

Typedefs

typedef struct hentry HENTRY
 
typedef struct hentryHENTRY_PTR
 
typedef struct mht_table MHT_TABLE
 
typedef struct hentry_hls HENTRY_HLS
 
typedef struct hentry_hlsHENTRY_HLS_PTR
 
typedef struct mht_hls_table MHT_HLS_TABLE
 

Functions

unsigned int mht_2str_pseudo_key (const void *key, int key_size)
 
unsigned int mht_1strlowerhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_1strhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_2strhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_3strhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_4strhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_5strhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_numhash (const void *key, const unsigned int ht_size)
 
unsigned int mht_get_hash_number (const int ht_size, const DB_VALUE *val)
 
unsigned int mht_ptrhash (const void *ptr, const unsigned int ht_size)
 
unsigned int mht_valhash (const void *key, const unsigned int ht_size)
 
int mht_compare_identifiers_equal (const void *key1, const void *key2)
 
int mht_compare_strings_are_equal (const void *key1, const void *key2)
 
int mht_compare_ints_are_equal (const void *key1, const void *key2)
 
int mht_compare_logpageids_are_equal (const void *key1, const void *key2)
 
int mht_compare_ptrs_are_equal (const void *key1, const void *key2)
 
int mht_compare_dbvalues_are_equal (const void *key1, const void *key2)
 
MHT_TABLEmht_create (const char *name, int est_size, unsigned int(*hash_func)(const void *key, unsigned int ht_size), int(*cmp_func)(const void *key1, const void *key2))
 
void mht_destroy (MHT_TABLE *ht)
 
int mht_clear (MHT_TABLE *ht, int(*rem_func)(const void *key, void *data, void *args), void *func_args)
 
void * mht_get (MHT_TABLE *ht, const void *key)
 
void * mht_get2 (const MHT_TABLE *ht, const void *key, void **last)
 
const void * mht_put (MHT_TABLE *ht, const void *key, void *data)
 
const void * mht_put_data (MHT_TABLE *ht, const void *key, void *data)
 
const void * mht_put_new (MHT_TABLE *ht, const void *key, void *data)
 
const void * mht_put_if_not_exists (MHT_TABLE *ht, const void *key, void *data)
 
const void * mht_put2_new (MHT_TABLE *ht, const void *key, void *data)
 
int mht_rem (MHT_TABLE *ht, const void *key, int(*rem_func)(const void *key, void *data, void *args), void *func_args)
 
int mht_rem2 (MHT_TABLE *ht, const void *key, const void *data, int(*rem_func)(const void *key, void *data, void *args), void *func_args)
 
int mht_map (const MHT_TABLE *ht, int(*map_func)(const void *key, void *data, void *args), void *func_args)
 
int mht_map_no_key (THREAD_ENTRY *thread_p, const MHT_TABLE *ht, int(*map_func)(THREAD_ENTRY *thread_p, void *data, void *args), void *func_args)
 
int mht_adjust_lru_list (MHT_TABLE *ht, HENTRY_PTR hentry)
 
unsigned int mht_count (const MHT_TABLE *ht)
 
int mht_dump (THREAD_ENTRY *thread_p, FILE *out_fp, const MHT_TABLE *ht, const int print_id_opt, int(*print_func)(THREAD_ENTRY *thread_p, FILE *fp, const void *key, void *data, void *args), void *func_args)
 
const void * mht_put_hls (MHT_HLS_TABLE *ht, const void *key, void *data)
 
void * mht_get_hls (const MHT_HLS_TABLE *ht, const void *key, void **last)
 
MHT_HLS_TABLEmht_create_hls (const char *name, int est_size, unsigned int(*hash_func)(const void *key, unsigned int ht_size), int(*cmp_func)(const void *key1, const void *key2))
 
int mht_clear_hls (MHT_HLS_TABLE *ht, int(*rem_func)(const void *key, void *data, void *args), void *func_args)
 
void mht_destroy_hls (MHT_HLS_TABLE *ht)
 
int mht_dump_hls (THREAD_ENTRY *thread_p, FILE *out_fp, const MHT_HLS_TABLE *ht, const int print_id_opt, int(*print_func)(THREAD_ENTRY *thread_p, FILE *fp, const void *data, void *args), void *func_args)
 

Macro Definition Documentation

#define MHT2STR_COLL (   id,
  str,
  size 
)    (lang_get_collation (id))->mht2str ((lang_get_collation (id)), (str), (size))

Definition at line 36 of file memory_hash.h.

Referenced by mht_get_hash_number().

Typedef Documentation

typedef struct hentry HENTRY

Definition at line 40 of file memory_hash.h.

typedef struct hentry_hls HENTRY_HLS

Definition at line 136 of file memory_hash.h.

typedef struct hentry_hls* HENTRY_HLS_PTR

Definition at line 137 of file memory_hash.h.

typedef struct hentry* HENTRY_PTR

Definition at line 41 of file memory_hash.h.

typedef struct mht_hls_table MHT_HLS_TABLE

Definition at line 146 of file memory_hash.h.

typedef struct mht_table MHT_TABLE

Definition at line 54 of file memory_hash.h.

Function Documentation

unsigned int mht_1strhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 447 of file memory_hash.c.

References assert, mht_1str_pseudo_key(), and NULL.

Referenced by ehash_hash_string_type(), locator_initialize(), shard_stmt_initialize(), and ws_init().

Here is the caller graph for this function:

unsigned int mht_1strlowerhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 420 of file memory_hash.c.

References assert, char_tolower(), and NULL.

unsigned int mht_2str_pseudo_key ( const void *  key,
int  key_size 
)

Definition at line 175 of file memory_hash.c.

References assert, i, and NULL.

Referenced by lang_mht2str_default(), and mht_2strhash().

Here is the caller graph for this function:

unsigned int mht_2strhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 466 of file memory_hash.c.

References assert, mht_2str_pseudo_key(), and NULL.

Referenced by ehash_hash_string_type().

Here is the caller graph for this function:

unsigned int mht_3strhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 483 of file memory_hash.c.

References assert, mht_3str_pseudo_key(), and NULL.

Referenced by ehash_hash_string_type().

Here is the caller graph for this function:

unsigned int mht_4strhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 505 of file memory_hash.c.

References assert, mht_4str_pseudo_key(), and NULL.

Referenced by pt_make_subclass_list().

Here is the caller graph for this function:

unsigned int mht_5strhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 521 of file memory_hash.c.

References mht_5str_pseudo_key().

Referenced by er_call_stack_init(), es_name_hash_func(), xtx_add_lob_locator(), xtx_change_state_of_locator(), xtx_drop_lob_locator(), and xtx_find_lob_locator().

Here is the caller graph for this function:

int mht_adjust_lru_list ( MHT_TABLE ht,
HENTRY_PTR  hentry 
)

Definition at line 1457 of file memory_hash.c.

References assert, mht_table::build_lru_list, mht_table::lru_head, hentry::lru_next, hentry::lru_prev, mht_table::lru_tail, NO_ERROR, and NULL.

Referenced by mht_get().

Here is the caller graph for this function:

int mht_clear_hls ( MHT_HLS_TABLE ht,
int(*)(const void *key, void *data, void *args)  rem_func,
void *  func_args 
)
int mht_compare_dbvalues_are_equal ( const void *  key1,
const void *  key2 
)

Definition at line 791 of file memory_hash.c.

References DB_EQ, and tp_value_compare().

Referenced by qfile_compare_equal_db_value_array().

Here is the caller graph for this function:

int mht_compare_identifiers_equal ( const void *  key1,
const void *  key2 
)

Definition at line 755 of file memory_hash.c.

References intl_identifier_casecmp().

Referenced by pt_associate_label_with_value().

Here is the caller graph for this function:

int mht_compare_ints_are_equal ( const void *  key1,
const void *  key2 
)

Definition at line 731 of file memory_hash.c.

int mht_compare_logpageids_are_equal ( const void *  key1,
const void *  key2 
)

Definition at line 743 of file memory_hash.c.

Referenced by la_init_cache_log_buffer().

Here is the caller graph for this function:

int mht_compare_ptrs_are_equal ( const void *  key1,
const void *  key2 
)

Definition at line 779 of file memory_hash.c.

Referenced by tr_init().

Here is the caller graph for this function:

int mht_compare_strings_are_equal ( const void *  key1,
const void *  key2 
)

Definition at line 767 of file memory_hash.c.

Referenced by er_call_stack_init(), locator_initialize(), pt_make_subclass_list(), shard_stmt_initialize(), and ws_init().

Here is the caller graph for this function:

void mht_destroy_hls ( MHT_HLS_TABLE ht)

Definition at line 1160 of file memory_hash.c.

References assert, db_destroy_fixed_heap(), free_and_init, mht_hls_table::heap_id, NULL, and mht_hls_table::table.

Referenced by scan_close_scan().

Here is the caller graph for this function:

int mht_dump ( THREAD_ENTRY thread_p,
FILE *  out_fp,
const MHT_TABLE ht,
const int  print_id_opt,
int(*)(THREAD_ENTRY *thread_p, FILE *fp, const void *key, void *data, void *args)  print_func,
void *  func_args 
)
int mht_dump_hls ( THREAD_ENTRY thread_p,
FILE *  out_fp,
const MHT_HLS_TABLE ht,
const int  print_id_opt,
int(*)(THREAD_ENTRY *thread_p, FILE *fp, const void *data, void *args)  print_func,
void *  func_args 
)
void* mht_get ( MHT_TABLE ht,
const void *  key 
)
void* mht_get2 ( const MHT_TABLE ht,
const void *  key,
void **  last 
)
void* mht_get_hls ( const MHT_HLS_TABLE ht,
const void *  key,
void **  last 
)

Definition at line 1550 of file memory_hash.c.

References assert, hentry_hls::data, mht_hls_table::hash_func, NULL, mht_hls_table::size, and mht_hls_table::table.

Referenced by scan_hash_probe_next().

Here is the caller graph for this function:

unsigned int mht_numhash ( const void *  key,
const unsigned int  ht_size 
)

Definition at line 533 of file memory_hash.c.

References assert, and NULL.

unsigned int mht_ptrhash ( const void *  ptr,
const unsigned int  ht_size 
)

Definition at line 547 of file memory_hash.c.

References assert, GET_PTR_FOR_HASH, and NULL.

Referenced by tr_init().

Here is the caller graph for this function:

const void* mht_put2_new ( MHT_TABLE ht,
const void *  key,
void *  data 
)
const void* mht_put_data ( MHT_TABLE ht,
const void *  key,
void *  data 
)

Definition at line 1756 of file memory_hash.c.

References assert, MHT_OPT_KEEP_KEY, mht_put_internal(), and NULL.

Referenced by pt_associate_label_with_value().

Here is the caller graph for this function:

const void* mht_put_hls ( MHT_HLS_TABLE ht,
const void *  key,
void *  data 
)

Definition at line 1730 of file memory_hash.c.

References assert, MHT_OPT_INSERT_ONLY, mht_put_hls_internal(), and NULL.

Referenced by scan_build_hash_list_scan().

Here is the caller graph for this function:

const void* mht_put_if_not_exists ( MHT_TABLE ht,
const void *  key,
void *  data 
)

Definition at line 1749 of file memory_hash.c.

References assert, MHT_OPT_INSERT_IF_NOT_EXISTS, mht_put_internal(), and NULL.

Referenced by catcls_put_entry(), and partition_cache_pruning_context().

Here is the caller graph for this function:

const void* mht_put_new ( MHT_TABLE ht,
const void *  key,
void *  data 
)

Definition at line 1723 of file memory_hash.c.

References assert, MHT_OPT_INSERT_ONLY, mht_put_internal(), and NULL.

Referenced by heap_stats_add_bestspace(), and qfile_update_list_cache_entry().

Here is the caller graph for this function:

unsigned int mht_valhash ( const void *  key,
const unsigned int  ht_size 
)