#include <ndb_global.h>#include <ConfigValues.hpp>#include <NdbOut.hpp>#include <NdbTCP.h>Include dependency graph for ConfigValues.cpp:

Go to the source code of this file.
Defines | |
| #define | KP_TYPE_MASK (15) |
| #define | KP_TYPE_SHIFT (28) |
| #define | KP_SECTION_MASK (0x3FFF) |
| #define | KP_SECTION_SHIFT (14) |
| #define | KP_KEYVAL_MASK (0x3FFF) |
| #define | KP_KEYVAL_SHIFT (0) |
| #define | KP_MASK (0x0FFFFFFF) |
| #define | DEBUG if(0) |
Functions | |
| static Uint32 | hash (Uint32 key, Uint32 size) |
| static Uint32 | nextHash (Uint32 key, Uint32 size, Uint32 pos, Uint32 count) |
| static bool | findKey (const Uint32 *vals, Uint32 sz, Uint32 key, Uint32 *pos) |
| ConfigValues::ValueType | getTypeOf (Uint32 k) |
| static Uint32 | directory (Uint32 sz) |
| static int | mod4 (unsigned int i) |
Variables | |
| static const Uint32 | CFV_KEY_PARENT = (KP_KEYVAL_MASK - 1) |
| static const Uint32 | CFV_KEY_FREE = ~0 |
| static const char | Magic [] = { 'N', 'D', 'B', 'C', 'O', 'N', 'F', 'V' } |
| #define DEBUG if(0) |
Definition at line 39 of file ConfigValues.cpp.
| #define KP_KEYVAL_MASK (0x3FFF) |
Definition at line 26 of file ConfigValues.cpp.
Referenced by ConfigValuesFactory::extractCurrentSection(), and ConfigValuesFactory::put().
| #define KP_KEYVAL_SHIFT (0) |
| #define KP_MASK (0x0FFFFFFF) |
Definition at line 28 of file ConfigValues.cpp.
Referenced by findKey(), ConfigValuesFactory::put(), and ConfigValuesFactory::unpack().
| #define KP_SECTION_MASK (0x3FFF) |
Definition at line 24 of file ConfigValues.cpp.
Referenced by ConfigValuesFactory::ConfigValuesFactory(), and ConfigValuesFactory::extractCurrentSection().
| #define KP_SECTION_SHIFT (14) |
Definition at line 25 of file ConfigValues.cpp.
Referenced by ConfigValuesFactory::ConfigValuesFactory(), ConfigValuesFactory::extractCurrentSection(), and ConfigValuesFactory::openSection().
| #define KP_TYPE_MASK (15) |
t = Type - 4 bits 0-15 s = Section - 14 bits 0-16383 k = Key value - 14 bits 0-16383
1111111111222222222233 01234567890123456789012345678901 kkkkkkkkkkkkkkssssssssssssssoooo
Definition at line 22 of file ConfigValues.cpp.
Referenced by getTypeOf().
| #define KP_TYPE_SHIFT (28) |
Definition at line 23 of file ConfigValues.cpp.
Referenced by getTypeOf(), and ConfigValuesFactory::put().
Definition at line 238 of file ConfigValues.cpp.
Referenced by ConfigValuesFactory::ConfigValuesFactory(), ConfigValuesFactory::expand(), rl_filename_completion_function(), and ConfigValuesFactory::shrink().
00238 { 00239 const Uint32 _input = sz; 00240 if((sz & 1) == 0) 00241 sz ++; 00242 00243 bool prime = false; 00244 while(!prime){ 00245 prime = true; 00246 for(Uint32 n = 3; n*n <= sz; n += 2){ 00247 if((sz % n) == 0){ 00248 prime = false; 00249 sz += 2; 00250 break; 00251 } 00252 } 00253 } 00254 DEBUG printf("directory %d -> %d\n", _input, sz); 00255 return sz; 00256 }
Here is the caller graph for this function:

Definition at line 204 of file ConfigValues.cpp.
References count, hash(), KP_MASK, nextHash(), and pos().
Referenced by ConfigValues::ConstIterator::get(), and ConfigValues::Iterator::set().
00204 { 00205 Uint32 pos = hash(key, sz); 00206 Uint32 count = 0; 00207 while((values[pos] & KP_MASK) != key && count < sz){ 00208 pos = nextHash(key, sz, pos, ++count); 00209 } 00210 00211 if((values[pos] & KP_MASK)== key){ 00212 *_pos = pos; 00213 return true; 00214 } 00215 return false; 00216 }
Here is the call graph for this function:

Here is the caller graph for this function:

| ConfigValues::ValueType getTypeOf | ( | Uint32 | k | ) | [inline] |
Definition at line 44 of file ConfigValues.cpp.
References KP_TYPE_MASK, and KP_TYPE_SHIFT.
Referenced by ConfigValuesFactory::ConfigValuesFactory(), ConfigValues::getByPos(), ConfigValues::getPackedSize(), ConfigValues::pack(), and ConfigValuesFactory::unpack().
00044 { 00045 return (ConfigValues::ValueType)((k >> KP_TYPE_SHIFT) & KP_TYPE_MASK); 00046 }
Here is the caller graph for this function:

Definition at line 220 of file ConfigValues.cpp.
Referenced by _hash_init(), bench_md5(), bench_ripemd(), bench_sha(), buf_LRU_block_remove_hashed_page(), buf_page_init(), yaSSL::DH_Server::build(), calc_hash(), Dbdict::create_fg_prepare_start(), Dbdict::create_file_prepare_start(), NdbLinHash< C >::deleteKey(), dict_col_add_to_cache(), dict_col_remove_from_cache(), dict_col_reposition_in_cache(), dict_index_find_cols(), do_test(), findKey(), get_variable(), grant_load(), ha_insert_for_fold(), hash_check(), hash_delete(), hash_element(), hash_first(), hash_free(), hash_free_elements(), hash_key(), hash_next(), hash_rec_mask(), hash_replace(), hash_search(), hash_update(), hashcmp(), NdbLinHash< C >::insertKey(), lock_get_n_rec_locks(), lock_rec_create(), lock_rec_dequeue_from_page(), lock_rec_discard(), lock_rec_get_first_on_page(), lock_rec_get_first_on_page_addr(), lock_rec_get_next_on_page(), lock_validate(), my_hash_reset(), plugin_foreach(), ConfigValuesFactory::put(), yaSSL::DH_Server::read(), rec_hashnr(), remove_dup_with_hash_index(), safe_hash_change(), safe_hash_free(), safe_hash_init(), safe_hash_search(), safe_hash_set(), show_routine_grants(), sp_revoke_privileges(), thr_local_create(), thr_local_free(), and thr_local_get().
00220 { 00221 Uint32 tmp = (key >> 16) ^ (key & 0xFFFF); 00222 return (((tmp << 16) | tmp) % size) << 1; 00223 }
Here is the caller graph for this function:

| static int mod4 | ( | unsigned int | i | ) | [static] |
Definition at line 550 of file ConfigValues.cpp.
Referenced by PropertiesImpl::getPackedSize(), ConfigValues::getPackedSize(), PropertiesImpl::pack(), ConfigValues::pack(), PropertiesImpl::unpack(), and ConfigValuesFactory::unpack().
Here is the caller graph for this function:

Definition at line 227 of file ConfigValues.cpp.
References p.
Referenced by findKey(), and ConfigValuesFactory::put().
00227 { 00228 Uint32 p = (pos >> 1); 00229 if((key % size) != 0) 00230 p += key; 00231 else 00232 p += 1; 00233 return (p % size) << 1; 00234 }
Here is the caller graph for this function:

const Uint32 CFV_KEY_FREE = ~0 [static] |
Definition at line 31 of file ConfigValues.cpp.
Referenced by ConfigValues::ConfigValues(), ConfigValuesFactory::ConfigValuesFactory(), ConfigValues::getPackedSize(), ConfigValues::pack(), and ConfigValuesFactory::put().
const Uint32 CFV_KEY_PARENT = (KP_KEYVAL_MASK - 1) [static] |
Definition at line 30 of file ConfigValues.cpp.
Referenced by ConfigValues::ConstIterator::closeSection(), ConfigValuesFactory::extractCurrentSection(), ConfigValuesFactory::openSection(), and ConfigValues::ConstIterator::openSection().
Definition at line 33 of file ConfigValues.cpp.
Referenced by ConfigValues::getPackedSize(), ConfigValues::pack(), and ConfigValuesFactory::unpack().
1.4.7

