Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CountingBloomFilter #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lynxbat
Copy link

@lynxbat lynxbat commented Aug 11, 2013

Love this gem but needed a counting filter for some operations that required decrementing from filter.
Took the existing ContinuousBloomFilter and refactored to implement counters.

Notes

  • Added spec tests but have not touched the benchmarks
  • Allows you to pass counter limit in decimal and will use log2 to find a suitable bit bucket size
  • Grants control of roll over behavior with counters with #new
  • Easy to implement simple add/remove existence with #add(key) and #clear(key). #include(key) will respond with counter > 0 (true | false).

Questions

  • Did not implement mutexes like ContinuousBloomFilter, not sure if thread safety is an issue yet with this new class

Love this gem but needed a counting filter for some operations that required decrementing from filter.
Took the existing ContinuousBloomFilter and refactored to implement counters.

__Notes__
* Added spec tests but have not touched the benchmarks
* Allows you to pass counter limit in decimal and will use log2 to find a suitable bit bucket size
* Grants control of roll over behavior with counters with `#new`
* Easy to implement simple add/remove existence with `#set(key, 1)` and `#clear(key)`. #include(key) will respond with `counter > 0`

__Questions__
* Did not implement mutexes like ContinuousBloomFilter, not sure if thread safety is am issue yet with this new class
@colinsurprenant
Copy link
Owner

Great contribution! Thanks! I am traveling until Aug 20th and will review/merge this when I come back!

@rb2k
Copy link

rb2k commented Apr 2, 2014

Any news on this?

@colinsurprenant
Copy link
Owner

yikes, this fell in a crack, sorry about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants