bloom_filter_mod module¶
Bloom Filter: Probabilistic set membership testing for large sets.
- class bloom_filter_mod.Array_backend(num_bits)[source]¶
Bases:
object
Backend storage for our “array of bits” using a python array of integers.
- effs = 4294967295¶
- class bloom_filter_mod.Array_then_file_seek_backend(num_bits, filename, max_bytes_in_memory)[source]¶
Bases:
object
Backend storage for our “array of bits” using a python array of integers up to some maximum number of bytes…
…then spilling over to a file. This is -not- a cache; we instead save the leftmost bits in RAM, and the rightmost bits (if necessary) in a file. On open, we read from the file to RAM. On close, we write from RAM to the file.
- effs = 255¶
- class bloom_filter_mod.Bloom_filter(ideal_num_elements_n, error_rate_p, probe_bitnoer=<function get_bitno_lin_comb>, filename=None, start_fresh=False)[source]¶
Bases:
object
Probabilistic set membership testing for large sets.
- class bloom_filter_mod.File_seek_backend(num_bits, filename)[source]¶
Bases:
object
Backend storage for our “array of bits” using a file in which we seek.
- effs = 5¶
- class bloom_filter_mod.Mmap_backend(num_bits, filename)[source]¶
Bases:
object
Backend storage for our “array of bits” using an mmap’d file.
Please note that this has only been tested on Linux so far: 2 -11-01.
- effs = 5¶
- bloom_filter_mod.get_bitno_lin_comb(bloom_filter, key)[source]¶
Apply num_probes_k hash functions to key. Generate the array index and bitmask corresponding to each result.
- bloom_filter_mod.get_bitno_seed_rnd(bloom_filter, key)[source]¶
Apply num_probes_k hash functions to key. Generate the array index and bitmask corresponding to each result.