Documentation
¶
Overview ¶
Package a2filter implements a SipHash-2-4 based Active-Active Bloom Filter. It is designed to be stable over time even when filled to max capacity by implementing the active-active buffering (A2 buffering) scheme presented in "Aging Bloom Filter with Two Active Buffers for Dynamic Sets" (MyungKeun Yoon).
Note that none of the operations on the filter are constant time, and the the max backing Bloom Filter size is limited to 2^31 bytes. This package is threadsafe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type A2Filter ¶
A2Filter is an Active-Active Bloom Filter.
func New ¶
New constructs a new A2Filter with a filter set size 2^mLn2, and false postive rate p. The actual in memory footprint of the datastructure will be approximately 2^(mLn2+1) bits due to the double buffered nature of the filter.
func (*A2Filter) MaxEntries ¶
MaxEntries returns the maximum capacity of the A2Filter. This value is usually an underestimate as the filter is double buffered, however entry count accounting is only done for Active1, so Active2 should be ignored in calculations.
func (*A2Filter) TestAndSet ¶
TestAndSet tests the A2Filter for a given value's membership, adds the value to the filter and returns if it was present at the time of the call.