On Wed, Aug 27, 2008 at 8:26 PM, Ian Clarke <ian.clarke at gmail.com> wrote:
> On Wed, Aug 27, 2008 at 6:10 AM, Matthew Toseland
> <toad at amphibian.dyndns.org> wrote:
>> On Wednesday 27 August 2008 09:41, Daniel Cheng wrote:
>>> On Wed, Aug 27, 2008 at 5:12 AM,  <toad at freenetproject.org> wrote:
>>> > Author: toad
>>> > Date: 2008-08-26 21:12:19 +0000 (Tue, 26 Aug 2008)
>>> > New Revision: 22181
>>> >
>>> > Modified:
>>> >   branches/db4o/freenet/src/freenet/support/CountingBloomFilter.java
>>> > Log:
>>> > FIX MAJOR BUG IN COUNTING BLOOM FILTER:
>>> > / 4 not / 8 * 2.
>>> > setBit(1000) was effectively also doing setBit(1008).
>>> > PORT TO SALTED HASH STORE BRANCH ASAP!
>>>
>>> Your bloom filters are outdated.
>>>
>>> The Bloom filters was designed to work only at size of multiples of 8 .
>>> Salted hash store took the alternative approach by enforcing this in r22021.
>>
>> I don't understand how that would produce this bug. I was already using
>> multiples of 8.
>>
>> If you are trying to set bit number 1000, the location will be (with the old
>> code) 1000 / 8 * 2 = 250. The specific block within the byte will be 1000 % 4
>> = 0. Now, if you try to set bit number 1004, the location with the old code
>> will be 1004 / 8 * 2 = 250, and the block within the byte will again be 0.
>>
>> Have you tried running the BloomFilterTest I committed against your code, 
>> with
>> a counting filter vs a non-counting one?
>
> Why aren't you using a BitSet for this?
>

1. The is the counting bloom filter, each "bit" is a counter.

2. This use MappedByteBuffer (mmap'ed file) as oppose to java heap,
    this make better memory utilization.

> Ian.
>
> --
> Ian Clarke
> CEO, Uprizer Labs
> Email: ian at uprizer.com
> Cell: +1 512 422 3588
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>

Reply via email to