CUBRID Engine
latest
|
#include <thread_lockfree_hash_map.hpp>
Classes | |
class | iterator |
Public Member Functions | |
lockfree_hashmap () | |
void | init (lf_tran_system &transys, int entry_idx, int hash_size, int freelist_block_size, int freelist_block_count, lf_entry_descriptor &edesc) |
void | init_as_old (lf_tran_system &transys, int hash_size, int freelist_block_count, int freelist_block_size, lf_entry_descriptor &edesc, int entry_idx) |
void | init_as_new (lockfree::tran::system &transys, size_t hash_size, size_t freelist_block_size, size_t freelist_block_count, lf_entry_descriptor &edesc) |
void | destroy () |
T * | find (cubthread::entry *thread_p, Key &key) |
bool | find_or_insert (cubthread::entry *thread_p, Key &key, T *&t) |
bool | insert (cubthread::entry *thread_p, Key &key, T *&t) |
bool | insert_given (cubthread::entry *thread_p, Key &key, T *&t) |
bool | erase (cubthread::entry *thread_p, Key &key) |
bool | erase_locked (cubthread::entry *thread_p, Key &key, T *&t) |
void | unlock (cubthread::entry *thread_p, T *&t) |
void | clear (cubthread::entry *thread_p) |
T * | freelist_claim (cubthread::entry *thread_p) |
void | freelist_retire (cubthread::entry *thread_p, T *&t) |
void | start_tran (cubthread::entry *thread_p) |
void | end_tran (cubthread::entry *thread_p) |
size_t | get_size () const |
size_t | get_element_count () const |
Private Types | |
enum | type { OLD, NEW, UNKNOWN } |
Private Member Functions | |
bool | is_old_type () const |
lf_tran_entry * | get_tran_entry (cubthread::entry *thread_p) |
Private Attributes | |
lf_hash_table_cpp< Key, T > | m_old_hash |
lockfree::hashmap< Key, T > | m_new_hash |
type | m_type |
int | m_entry_idx |
Definition at line 35 of file thread_lockfree_hash_map.hpp.
|
private |
Enumerator | |
---|---|
OLD | |
NEW | |
UNKNOWN |
Definition at line 75 of file thread_lockfree_hash_map.hpp.
cubthread::lockfree_hashmap< Key, T >::lockfree_hashmap | ( | ) |
Definition at line 119 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::m_new_hash, cubthread::lockfree_hashmap< Key, T >::m_type, and cubthread::lockfree_hashmap< Key, T >::UNKNOWN.
void cubthread::lockfree_hashmap< Key, T >::clear | ( | cubthread::entry * | thread_p | ) |
Definition at line 240 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func_noarg.
Referenced by catalog_clear_hash_table(), and fpcache_drop_all().
void cubthread::lockfree_hashmap< Key, T >::destroy | ( | ) |
Definition at line 172 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::is_old_type(), cubthread::lockfree_hashmap< Key, T >::m_new_hash, cubthread::lockfree_hashmap< Key, T >::m_old_hash, cubthread::lockfree_hashmap< Key, T >::m_type, and cubthread::lockfree_hashmap< Key, T >::UNKNOWN.
Referenced by catalog_finalize(), catalog_initialize(), dwb_destroy_internal(), fpcache_finalize(), session_states_finalize(), and spage_finalize().
void cubthread::lockfree_hashmap< Key, T >::end_tran | ( | cubthread::entry * | thread_p | ) |
Definition at line 268 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func_noarg.
Referenced by session_remove_expired_sessions(), and spage_free_saved_spaces().
bool cubthread::lockfree_hashmap< Key, T >::erase | ( | cubthread::entry * | thread_p, |
Key & | key | ||
) |
Definition at line 219 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
Referenced by catalog_delete_key(), and session_remove_expired_sessions().
bool cubthread::lockfree_hashmap< Key, T >::erase_locked | ( | cubthread::entry * | thread_p, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 226 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
Referenced by dwb_slots_hash_delete(), session_state_destroy(), and spage_free_saved_spaces().
T * cubthread::lockfree_hashmap< Key, T >::find | ( | cubthread::entry * | thread_p, |
Key & | key | ||
) |
Definition at line 191 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
Referenced by catalog_get_dir_oid_from_cache(), catalog_get_representation_item(), dwb_read_page(), dwb_slots_hash_delete(), fpcache_claim(), session_check_session(), session_get_session_state(), session_get_variable_no_copy(), session_state_create(), session_state_destroy(), spage_dump_saved_spaces_by_other_trans(), and spage_get_saved_spaces().
bool cubthread::lockfree_hashmap< Key, T >::find_or_insert | ( | cubthread::entry * | thread_p, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 198 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
Referenced by catalog_get_dir_oid_from_cache(), catalog_get_representation_item(), dwb_slots_hash_insert(), fpcache_retire(), and spage_save_space().
T * cubthread::lockfree_hashmap< Key, T >::freelist_claim | ( | cubthread::entry * | thread_p | ) |
Definition at line 247 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func_noarg.
void cubthread::lockfree_hashmap< Key, T >::freelist_retire | ( | cubthread::entry * | thread_p, |
T *& | t | ||
) |
Definition at line 254 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
size_t cubthread::lockfree_hashmap< Key, T >::get_element_count | ( | ) | const |
Definition at line 282 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::is_old_type(), cubthread::lockfree_hashmap< Key, T >::m_new_hash, and cubthread::lockfree_hashmap< Key, T >::m_old_hash.
Referenced by session_states_dump().
size_t cubthread::lockfree_hashmap< Key, T >::get_size | ( | void | ) | const |
Definition at line 275 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::is_old_type(), cubthread::lockfree_hashmap< Key, T >::m_new_hash, and cubthread::lockfree_hashmap< Key, T >::m_old_hash.
|
private |
Definition at line 300 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::m_entry_idx, and cubthread::entry::tran_entries.
Referenced by cubthread::lockfree_hashmap< Key, T >::iterator::iterator().
void cubthread::lockfree_hashmap< Key, T >::init | ( | lf_tran_system & | transys, |
int | entry_idx, | ||
int | hash_size, | ||
int | freelist_block_size, | ||
int | freelist_block_count, | ||
lf_entry_descriptor & | edesc | ||
) |
Definition at line 128 of file thread_lockfree_hash_map.hpp.
References cubthread::get_thread_entry_lftransys(), cubthread::lockfree_hashmap< Key, T >::init_as_new(), cubthread::lockfree_hashmap< Key, T >::init_as_old(), prm_get_bool_value(), and PRM_ID_ENABLE_NEW_LFHASH.
Referenced by catalog_initialize(), dwb_create_internal(), fpcache_initialize(), session_states_init(), and spage_boot().
void cubthread::lockfree_hashmap< Key, T >::init_as_new | ( | lockfree::tran::system & | transys, |
size_t | hash_size, | ||
size_t | freelist_block_size, | ||
size_t | freelist_block_count, | ||
lf_entry_descriptor & | edesc | ||
) |
Definition at line 154 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::m_new_hash, cubthread::lockfree_hashmap< Key, T >::m_type, and cubthread::lockfree_hashmap< Key, T >::NEW.
Referenced by cubthread::lockfree_hashmap< Key, T >::init().
void cubthread::lockfree_hashmap< Key, T >::init_as_old | ( | lf_tran_system & | transys, |
int | hash_size, | ||
int | freelist_block_count, | ||
int | freelist_block_size, | ||
lf_entry_descriptor & | edesc, | ||
int | entry_idx | ||
) |
Definition at line 144 of file thread_lockfree_hash_map.hpp.
References cubthread::lockfree_hashmap< Key, T >::m_entry_idx, cubthread::lockfree_hashmap< Key, T >::m_old_hash, cubthread::lockfree_hashmap< Key, T >::m_type, and cubthread::lockfree_hashmap< Key, T >::OLD.
Referenced by cubthread::lockfree_hashmap< Key, T >::init().
bool cubthread::lockfree_hashmap< Key, T >::insert | ( | cubthread::entry * | thread_p, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 205 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
Referenced by session_state_create().
bool cubthread::lockfree_hashmap< Key, T >::insert_given | ( | cubthread::entry * | thread_p, |
Key & | key, | ||
T *& | t | ||
) |
Definition at line 212 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
|
private |
Definition at line 292 of file thread_lockfree_hash_map.hpp.
References assert, cubthread::lockfree_hashmap< Key, T >::m_type, cubthread::lockfree_hashmap< Key, T >::NEW, and cubthread::lockfree_hashmap< Key, T >::OLD.
Referenced by cubthread::lockfree_hashmap< Key, T >::destroy(), cubthread::lockfree_hashmap< Key, T >::get_element_count(), cubthread::lockfree_hashmap< Key, T >::get_size(), cubthread::lockfree_hashmap< Key, T >::iterator::iterate(), cubthread::lockfree_hashmap< Key, T >::iterator::iterator(), and cubthread::lockfree_hashmap< Key, T >::iterator::restart().
void cubthread::lockfree_hashmap< Key, T >::start_tran | ( | cubthread::entry * | thread_p | ) |
Definition at line 261 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func_noarg.
Referenced by spage_free_saved_spaces().
void cubthread::lockfree_hashmap< Key, T >::unlock | ( | cubthread::entry * | thread_p, |
T *& | t | ||
) |
Definition at line 233 of file thread_lockfree_hash_map.hpp.
References lockfree_hashmap_forward_func.
Referenced by catalog_get_dir_oid_from_cache(), and catalog_get_representation_item().
|
private |
Definition at line 85 of file thread_lockfree_hash_map.hpp.
Referenced by cubthread::lockfree_hashmap< Key, T >::get_tran_entry(), and cubthread::lockfree_hashmap< Key, T >::init_as_old().
|
private |
Definition at line 83 of file thread_lockfree_hash_map.hpp.
Referenced by cubthread::lockfree_hashmap< Key, T >::destroy(), cubthread::lockfree_hashmap< Key, T >::get_element_count(), cubthread::lockfree_hashmap< Key, T >::get_size(), cubthread::lockfree_hashmap< Key, T >::init_as_new(), cubthread::lockfree_hashmap< Key, T >::iterator::iterator(), and cubthread::lockfree_hashmap< Key, T >::lockfree_hashmap().
|
private |
Definition at line 82 of file thread_lockfree_hash_map.hpp.
Referenced by cubthread::lockfree_hashmap< Key, T >::destroy(), cubthread::lockfree_hashmap< Key, T >::get_element_count(), cubthread::lockfree_hashmap< Key, T >::get_size(), cubthread::lockfree_hashmap< Key, T >::init_as_old(), and cubthread::lockfree_hashmap< Key, T >::iterator::iterator().
|
private |
Definition at line 84 of file thread_lockfree_hash_map.hpp.
Referenced by cubthread::lockfree_hashmap< Key, T >::destroy(), cubthread::lockfree_hashmap< Key, T >::init_as_new(), cubthread::lockfree_hashmap< Key, T >::init_as_old(), cubthread::lockfree_hashmap< Key, T >::is_old_type(), and cubthread::lockfree_hashmap< Key, T >::lockfree_hashmap().