mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Associate a Comphash with a BloomFilterVal.
We also keep track of the Bloom filter's element type inside each value. The first use of the BiF bloomfilter_add will "typify" the Bloom filter and lock the Bloom filter's type to the element type.
This commit is contained in:
parent
751cf61293
commit
880d02f720
4 changed files with 91 additions and 5 deletions
|
@ -199,6 +199,21 @@ size_t BasicBloomFilter::CountImpl(const HashPolicy::HashVector& h) const
|
|||
return 1;
|
||||
}
|
||||
|
||||
CountingBloomFilter::CountingBloomFilter(double fp, size_t capacity,
|
||||
size_t width)
|
||||
: BloomFilter(BasicBloomFilter::K(BasicBloomFilter::M(fp, capacity),
|
||||
capacity))
|
||||
{
|
||||
cells_ = new CounterVector(width, BasicBloomFilter::M(fp, capacity));
|
||||
}
|
||||
|
||||
CountingBloomFilter::CountingBloomFilter(size_t cells, size_t capacity,
|
||||
size_t width)
|
||||
: BloomFilter(BasicBloomFilter::K(cells, capacity))
|
||||
{
|
||||
cells_ = new CounterVector(width, cells);
|
||||
}
|
||||
|
||||
|
||||
IMPLEMENT_SERIAL(CountingBloomFilter, SER_COUNTINGBLOOMFILTER)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue