#include <odb.h>
Data Fields | |
odb_node_t * | node_base |
odb_index_t * | hash_base |
odb_descr_t * | descr |
odb_hash_mask_t | hash_mask |
unsigned int | sizeof_header |
unsigned int | offset_node |
void * | base_memory |
int | fd |
char * | filename |
int | ref_count |
struct list_head | list |
a "database". this is an in memory only description.
We allow to manage a database inside a mapped file with an "header" of unknown size so odb_open get a parameter to specify the size of this header. A typical use is:
struct header { int etc; ... }; odb_open(&hash, filename, ODB_RW, sizeof(header)); so on this library have no dependency on the header type.
the internal memory layout from base_memory is: the unknown header (sizeof_header) odb_descr_t the node array: (descr->size * sizeof(odb_node_t) entries the hash table: array of odb_index_t indexing the node array (descr->size * BUCKET_FACTOR) entries
Definition at line 75 of file odb.h.
void* odb_data::base_memory |
base memory of the maped memory
Definition at line 82 of file odb.h.
Referenced by odb_close(), odb_get_data(), odb_grow_hashtable(), odb_open(), odb_sync(), odb_to_descr(), odb_to_hash_base(), and odb_to_node_base().
the current state of database
Definition at line 78 of file odb.h.
Referenced by add_node(), check_circular_list(), check_redundant_key(), odb_check_hash(), odb_close(), odb_commit_reservation(), odb_get_iterator(), odb_grow_hashtable(), odb_hash_stat(), odb_open(), odb_sync(), and odb_to_hash_base().
int odb_data::fd |
mmaped memory file descriptor
Definition at line 83 of file odb.h.
Referenced by odb_close(), odb_grow_hashtable(), and odb_open().
char* odb_data::filename |
full path name of sample file
Definition at line 84 of file odb.h.
Referenced by find_samples_data(), odb_close(), and odb_open().
base memory of hash table
Definition at line 77 of file odb.h.
Referenced by add_node(), check_circular_list(), odb_check_hash(), odb_grow_hashtable(), odb_hash_stat(), odb_open(), and odb_update_node_with_offset().
== descr->size - 1
Definition at line 79 of file odb.h.
Referenced by odb_do_hash(), odb_grow_hashtable(), and odb_open().
struct list_head odb_data::list [read] |
base memory area of the page
Definition at line 76 of file odb.h.
Referenced by add_node(), check_circular_list(), check_redundant_key(), odb_check_hash(), odb_get_iterator(), odb_grow_hashtable(), odb_hash_stat(), odb_open(), and odb_update_node_with_offset().
unsigned int odb_data::offset_node |
from base_memory to node array
Definition at line 81 of file odb.h.
Referenced by odb_open(), odb_to_hash_base(), odb_to_node_base(), and tables_size().
reference count
Definition at line 85 of file odb.h.
Referenced by odb_close(), odb_open(), and odb_open_count().
unsigned int odb_data::sizeof_header |
from base_memory to odb header
Definition at line 80 of file odb.h.
Referenced by odb_open(), and odb_to_descr().