Commit 58ac860c by Celine Mercier

Added macro for the bloom filter parameters and deleted old unused

macros for crc
parent d44117d6
......@@ -1273,7 +1273,7 @@ OBIDMS_avl_p obi_create_avl(OBIDMS_p dms, const char* avl_name)
avl->data_fd = avl_data_file_descriptor;
// Bloom filter
bloom_init(&((avl->header)->bloom_filter), 2000000, 0.001); // TODO use macros
bloom_init(&((avl->header)->bloom_filter), NODE_COUNT_PER_AVL, BLOOM_FILTER_ERROR_RATE);
//close(avl_file_descriptor);
......@@ -1575,7 +1575,7 @@ index_t insert_in_avl_group(OBIDMS_avl_group_p avl_group, byte_t* value) // TODO
// not found in any avl: add in current
// first, check if make new one
if ((((avl_group->sub_avls)[avl_group->current_avl_idx])->header)->nb_items == 2000000) // TODO add condition with data size + use macro
if ((((avl_group->sub_avls)[avl_group->current_avl_idx])->header)->nb_items == NODE_COUNT_PER_AVL) // TODO add condition with data size
obi_add_new_avl_in_group(avl_group);
bloom_add(&((((avl_group->sub_avls)[avl_group->current_avl_idx])->header)->bloom_filter), value, (BYTE_ARRAY_HEADER_SIZE + *((int32_t*)(value+1))));
......
......@@ -27,8 +27,9 @@
#include "bloom.h"
#define NB_OF_AVLS (64)
#define MASK (63)
#define NODE_COUNT_PER_AVL (2000000)
#define BLOOM_FILTER_ERROR_RATE (0.001)
#define AVL_MAX_NAME (1024) /**< The maximum length of an AVL tree name.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment