dtinfo subdirectory DtMmdb

This commit is contained in:
Ulrich Wilkens
2013-08-28 19:16:37 +02:00
committed by Jon Trulson
parent 0be684281d
commit fbd81ef151
159 changed files with 735 additions and 588 deletions

View File

@@ -74,8 +74,8 @@ public:
protected:
int v_buckets;
disk_bucket* v_cached_bucket_ptr;
page_storage* v_key_store;
disk_bucket* v_cached_bucket_ptr;
};
typedef bucket_array* bucket_arrayPtr;

View File

@@ -95,12 +95,13 @@ protected:
page* bucket_page();
protected:
int v_bucket_num;
page_storage* v_key_store;
Boolean v_overflowed;
//unsigned int v_k;
//unsigned int v_r;
int v_bucket_num;
page_storage* v_key_store;
buffer& buf;
};

View File

@@ -79,7 +79,7 @@ index_agent(), key_store(store), buf(store -> aux_buf())
init_params(prime, expected_n);
bucket_vector = new bucket_array(M+v, store);
hash_vector = new void_ptr_array(2*MAX(expected_n, n));
hash_vector = new void_ptr_array(2*MAX(expected_n, (int) n));
k_vector = new void_ptr_array(M+v);
r_vector = new void_ptr_array(M+v);
@@ -159,7 +159,7 @@ Boolean disk_hash::rehash(data_t& w)
{
//MESSAGE(cerr, "REHASH:");
char tmp_name[PATHSIZ];
sprintf(tmp_name, "%s.tmp", key_store -> my_name());
snprintf(tmp_name, sizeof(tmp_name), "%s.tmp", key_store -> my_name());
fstream pool(form("%s/%s", key_store -> my_path(), tmp_name),
ios::in | ios::out
@@ -271,7 +271,7 @@ Boolean disk_hash::_insert(data_t& w, Boolean rehash_if_fail)
//MESSAGE(cerr, "INSERT to overflow buckets");
//debug(cerr, hash);
for ( hash %= v; hash < v; hash++ ) {
for ( hash %= v; hash < (int) v; hash++ ) {
disk_bucket& overflowb = bucket_vector -> get_bucket(hash+M);
@@ -386,7 +386,7 @@ Boolean disk_hash::member(data_t& w, disk_bucket*& b, int& slot_num) const
if ( b -> overflow() == true ) {
for ( hash %= v; hash<v; hash++ ) {
for ( hash %= v; hash < (int) v; hash++ ) {
b = &bucket_vector -> get_bucket(hash+M);
@@ -411,7 +411,7 @@ disk_bucket* disk_hash::get_bucket(int& ind)
void disk_hash::next_bucket(int& ind)
{
ind = ( ind >= M+v-1 ) ? -1 : (ind+1);
ind = ( ind >= (int)(M+v-1) ) ? -1 : (ind+1);
}

View File

@@ -123,7 +123,7 @@ protected:
unsigned int k; // parameter used in the 1st level hash function
unsigned int p; // prime number p
//unsigned int n; // current key set size
unsigned int n; // current key set size
bucket_array* bucket_vector; // bucket array