ion_master_table.c
Go to the documentation of this file.
83 if (1 != fwrite(&(config->dictionary_size), sizeof(config->dictionary_size), 1, ion_master_table_file)) {
87 if (1 != fwrite(&(config->dictionary_type), sizeof(config->dictionary_type), 1, ion_master_table_file)) {
91 if (1 != fwrite(&(config->dictionary_status), sizeof(config->dictionary_status), 1, ion_master_table_file)) {
152 if (1 != fread(&(config->dictionary_size), sizeof(config->dictionary_size), 1, ion_master_table_file)) {
156 if (1 != fread(&(config->dictionary_type), sizeof(config->dictionary_type), 1, ion_master_table_file)) {
160 if (1 != fread(&(config->dictionary_status), sizeof(config->dictionary_status), 1, ion_master_table_file)) {
343 .id = dictionary->instance->id, .use_type = 0, .type = dictionary->instance->key_type, .key_size = dictionary->instance->record.key_size, .value_size = dictionary->instance->record.value_size, .dictionary_size = dictionary_size, .dictionary_type = dictionary->instance->type, .dictionary_status = dictionary->status
367 err = dictionary_create(handler, dictionary, id, key_type, key_size, value_size, dictionary_size);
Definition: kv_system.h:141
ion_err_t ion_lookup_in_master_table(ion_dictionary_id_t id, ion_dictionary_config_info_t *config)
Looks up the config of the given id.
Definition: ion_master_table.c:379
Definition: kv_system.h:160
enum ION_KEY_TYPE ion_key_type_t
This is the available key types for ION_DB. All types will be based on system defines.
ion_byte_t ion_dict_use_t
A type describing how a dictionary is used.
Definition: dictionary_types.h:59
ion_dictionary_type_t dictionary_type
Definition: dictionary_types.h:196
#define ION_MASTER_TABLE_CALCULATE_POS
Definition: ion_master_table.h:64
ion_err_t ion_master_table_create_dictionary(ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary, ion_key_type_t key_type, ion_key_size_t key_size, ion_value_size_t value_size, ion_dictionary_size_t dictionary_size)
Creates a dictionary through use of the master table.
Definition: ion_master_table.c:350
Definition: kv_system.h:147
ion_err_t ion_add_to_master_table(ion_dictionary_t *dictionary, ion_dictionary_size_t dictionary_size)
Adds the given dictionary to the master table.
Definition: ion_master_table.c:338
ion_err_t ion_master_table_read(ion_dictionary_config_info_t *config, long where)
Read a record to the master table.
Definition: ion_master_table.c:118
void linear_hash_dict_init(ion_dictionary_handler_t *handler)
Registers a linear hash handler to a dictionary instance.
Definition: linear_hash_handler.c:40
ion_value_size_t value_size
Definition: dictionary_types.h:191
ion_err_t ion_switch_handler(ion_dictionary_type_t type, ion_dictionary_handler_t *handler)
Retrieves the type of dictionary stored under a particular id in the master table.
Definition: ion_master_table.c:537
enum ION_DICTIONARY_TYPE ion_dictionary_type_t
This is the available dictionary types for ION_DB. All types will be based on system defines...
ion_err_t ion_delete_dictionary(ion_dictionary_t *dictionary, ion_dictionary_id_t id)
Deletes a given dictionary instance and deletes it from the master table.
Definition: ion_master_table.c:496
unsigned int ion_dictionary_id_t
A type used to identify dictionaries, specifically in the master table.
Definition: dictionary_types.h:51
unsigned int ion_dictionary_size_t
The implementation specific size of the dictionary.
Definition: kv_system.h:264
Struct containing details for opening a dictionary previously created.
Definition: dictionary_types.h:183
void oadict_init(ion_dictionary_handler_t *handler)
Registers a specific handler for a dictionary instance.
Definition: open_address_hash_dictionary_handler.c:324
Definition: kv_system.h:188
#define ION_MASTER_TABLE_FILENAME
File name for IonDB master table.
Definition: ion_master_table.h:74
ion_dictionary_status_t dictionary_status
Definition: dictionary_types.h:198
ion_err_t ion_master_table_write(ion_dictionary_config_info_t *config, long where)
Write a record to the master table.
Definition: ion_master_table.c:44
ion_err_t dictionary_create(ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary, ion_dictionary_id_t id, ion_key_type_t key_type, ion_key_size_t key_size, ion_value_size_t value_size, ion_dictionary_size_t dictionary_size)
Creates as instance of a specific type of dictionary.
Definition: dictionary.c:125
Definition: kv_system.h:139
Master table API.
A dictionary contains information regarding an instance of the storage element and the associated han...
Definition: dictionary_types.h:273
ion_err_t ion_delete_from_master_table(ion_dictionary_id_t id)
Deletes a dictionary from the master table.
Definition: ion_master_table.c:437
ion_dictionary_type_t ion_get_dictionary_type(ion_dictionary_id_t id)
Retrieves the type of dictionary stored under a particular id in the master table.
Definition: ion_master_table.c:447
Definition: kv_system.h:185
ion_err_t ion_close_dictionary(ion_dictionary_t *dictionary)
Closes a given dictionary.
Definition: ion_master_table.c:486
Definition: kv_system.h:179
void ffdict_init(ion_dictionary_handler_t *handler)
Given the handler instance, bind the appropriate flat file functions.
Definition: flat_file_dictionary_handler.c:364
Definition: kv_system.h:149
ion_err_t dictionary_destroy_dictionary(ion_dictionary_handler_t *handler, ion_dictionary_id_t id)
Destroys dictionary.
Definition: dictionary.c:185
void oafdict_init(ion_dictionary_handler_t *handler)
Registers a specific handler for a dictionary instance.
Definition: open_address_file_hash_dictionary_handler.c:394
ion_err_t dictionary_delete_dictionary(ion_dictionary_t *dictionary)
Destroys dictionary.
Definition: dictionary.c:178
void bpptree_init(ion_dictionary_handler_t *handler)
Registers a specific handler for a dictionary instance.
Definition: bpp_tree_handler.c:711
Definition: kv_system.h:197
Definition: kv_system.h:162
ion_err_t ion_open_dictionary(ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary, ion_dictionary_id_t id)
Finds the target dictionary and opens it.
Definition: ion_master_table.c:463
Definition: kv_system.h:171
Definition: kv_system.h:182
ion_dictionary_id_t ion_master_table_next_id
Master table resposible for managing instances.
Definition: ion_master_table.c:41
ion_err_t dictionary_close(ion_dictionary_t *dictionary)
Closes a dictionary.
Definition: dictionary.c:372
Definition: kv_system.h:151
ion_err_t dictionary_open(ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary, ion_dictionary_config_info_t *config)
Opens a dictionary, given the desired config.
Definition: dictionary.c:287
Definition: kv_system.h:212
ion_dictionary_size_t dictionary_size
Definition: dictionary_types.h:192
#define ION_MASTER_TABLE_WRITE_FROM_END
Definition: ion_master_table.h:65
Definition: kv_system.h:191
ion_err_t ion_close_all_master_table(void)
Closes the master table and all dictionary instances within it.
Definition: ion_master_table.c:259
#define ION_MASTER_TABLE_RECORD_SIZE(cp)
Definition: ion_master_table.h:66
ion_err_t ion_find_by_use_master_table(ion_dictionary_config_info_t *config, ion_dict_use_t use_type, char whence)
Find first or last dictionary in master table with a given use.
Definition: ion_master_table.c:396
void sldict_init(ion_dictionary_handler_t *handler)
Registers a skiplist handler to a dictionary instance.
Definition: skip_list_handler.c:351
ion_err_t ion_master_table_get_next_id(ion_dictionary_id_t *id)
Returns the next dictionary ID, then increments.
Definition: ion_master_table.c:177
#define ION_MASTER_TABLE_FIND_LAST
Flag used when searching master table; search for last instance matching criteria.
Definition: ion_master_table.h:91
A dictionary_handler is responsible for dealing with the specific interface for an underlying diction...
Definition: dictionary_types.h:207