diff --git a/src/obiavl.c b/src/obiavl.c index 69f2a3e..c96e24b 100644 --- a/src/obiavl.c +++ b/src/obiavl.c @@ -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)))); diff --git a/src/obiavl.h b/src/obiavl.h index 1850455..cfe1c5f 100644 --- a/src/obiavl.h +++ b/src/obiavl.h @@ -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. */