Storage based on probabilistic structure Bloom filter
Suitable for storing huge amount of data and quering if element is present or not
git clone --recursive
echo "REGISTER MODULE 'pure-lua-bloom-filter/luaxxhash/luaxxhash.lua'" | aql
echo "REGISTER MODULE 'pure-lua-bloom-filter/bloom_filter.lua'" | aql
echo "REGISTER MODULE 'bloom.lua'" | aql
Use Aerospike apply
Module: bloom
Method: add
Example in python:
as_client.apply(key, "bloom", "add", ["bin", value, {}])) #returns 1 if not found else 0
Params: bin, value, conf Adds value to bloom filter, when already present returns 0, otherwise 1.
Last param is conf, when empty defaults defined on first lines of the code are used.
Default size is 10000 elements with precision 0.01 and ttl 4 hours.
Configuration options are:
- items - count of elements
- probability - precision 0 > p > 1
- ttl - AS ttl (0 for never)
Params: bin, value
Returns 1 if value was found and 0 if not
params: bin
Clears whole bloom filter
- Any ideas how to test this
Feel free to contribute with PR.
© 2016 Vít Listík
Released under MIT licence