Documentation ¶
Index ¶
Constants ¶
const DefaultHashFns int = 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletableBloom ¶
type DeletableBloom struct {
// contains filtered or unexported fields
}
func NewDeletableBF ¶
func NewDeletableBF(size int, hashSeeds []int, numRegions int) *DeletableBloom
NewDeletableBF creates a deletable bloom filter of length `size` bytes and `hashSeeds` are the seed values for the murmur hash functions bloom will be initialized with len(hashSeeds) hash functions with provided seeds. if no hashSeeds are provided then 2 hash functions will be used with random seeds. numRegions are the number of regions in which the bloom filter needs to be split so as to make it deletable. For each region, one extra bit of memory will be allocated.
func (*DeletableBloom) Check ¶
func (b *DeletableBloom) Check(x []byte) (bool, error)
Check checks the existence of the element `x` in the bloom filter
func (*DeletableBloom) Delete ¶
func (b *DeletableBloom) Delete(x []byte) (bool, error)
Delete possibly deletes the element `x` from the bloom filter the element `x` returns error if any and if the element `x` was deleted or not
func (*DeletableBloom) Put ¶
func (b *DeletableBloom) Put(x []byte) error
Put puts the element `x` in the deletable bloom filter
type SimpleBF ¶
type SimpleBF struct {
// contains filtered or unexported fields
}
func NewSimpleBF ¶
NewSimpleBF creates a simple bloom filter of length `size` bytes and `hashSeeds` are the seed values for themurmur hash functions bloom will be initialized with len(hashSeeds) hash functions with provided seeds. if no hashSeeds are provided then 2 hash functions will be used with random seeds.