Examples of RandomStringGenerator


Examples of com.clearspring.analytics.stream.membership.KeyGenerator.RandomStringGenerator

        assertEquals(125085, serialize(f).length);

        assertEquals(10000064, (f = new BloomFilter(1000000, 0.01)).buckets());
        assertEquals(1250085, serialize(f).length);

        for (String s : new RandomStringGenerator(new Random().nextInt(), 1000000)) {
            f.add(s);
        }
        assertEquals(10000064, f.buckets());
        assertEquals(1250085, serialize(f).length);
View Full Code Here

Examples of org.apache.cassandra.utils.KeyGenerator.RandomStringGenerator

    public void compareBitSets()
    {
        BloomFilter bf2 = (BloomFilter) FilterFactory.getFilter(FilterTestHelper.ELEMENTS / 2, FilterTestHelper.MAX_FAILURE_RATE, false);
        BloomFilter bf3 = (BloomFilter) FilterFactory.getFilter(FilterTestHelper.ELEMENTS / 2, FilterTestHelper.MAX_FAILURE_RATE, true);

        RandomStringGenerator gen1 = new KeyGenerator.RandomStringGenerator(new Random().nextInt(), FilterTestHelper.ELEMENTS);

        // make sure both bitsets are empty.
        compare(bf2.bitset, bf3.bitset);

        while (gen1.hasNext())
        {
            ByteBuffer key = gen1.next();
            bf2.add(key);
            bf3.add(key);
        }

        compare(bf2.bitset, bf3.bitset);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.