@ -10,6 +10,7 @@
# include "rocksdb/slice.h"
# include "port/port.h"
# include "util/hash.h"
# include <atomic>
# include <memory>
@ -35,12 +36,10 @@ class DynamicBloom {
explicit DynamicBloom ( Allocator * allocator ,
uint32_t total_bits , uint32_t locality = 0 ,
uint32_t num_probes = 6 ,
uint32_t ( * hash_func ) ( const Slice & key ) = nullptr ,
size_t huge_page_tlb_size = 0 ,
Logger * logger = nullptr ) ;
explicit DynamicBloom ( uint32_t num_probes = 6 ,
uint32_t ( * hash_func ) ( const Slice & key ) = nullptr ) ;
explicit DynamicBloom ( uint32_t num_probes = 6 ) ;
void SetTotalBits ( Allocator * allocator , uint32_t total_bits ,
uint32_t locality , size_t huge_page_tlb_size ,
@ -86,7 +85,6 @@ class DynamicBloom {
uint32_t kNumBlocks ;
const uint32_t kNumProbes ;
uint32_t ( * hash_func_ ) ( const Slice & key ) ;
std : : atomic < uint8_t > * data_ ;
// or_func(ptr, mask) should effect *ptr |= mask with the appropriate
@ -95,10 +93,10 @@ class DynamicBloom {
void AddHash ( uint32_t hash , const OrFunc & or_func ) ;
} ;
inline void DynamicBloom : : Add ( const Slice & key ) { AddHash ( hash_func_ ( key ) ) ; }
inline void DynamicBloom : : Add ( const Slice & key ) { AddHash ( BloomHash ( key ) ) ; }
inline void DynamicBloom : : AddConcurrently ( const Slice & key ) {
AddHashConcurrently ( hash_func_ ( key ) ) ;
AddHashConcurrently ( BloomHash ( key ) ) ;
}
inline void DynamicBloom : : AddHash ( uint32_t hash ) {
@ -122,7 +120,7 @@ inline void DynamicBloom::AddHashConcurrently(uint32_t hash) {
}
inline bool DynamicBloom : : MayContain ( const Slice & key ) const {
return ( MayContainHash ( hash_func_ ( key ) ) ) ;
return ( MayContainHash ( BloomHash ( key ) ) ) ;
}
# if defined(_MSC_VER)