List of usage examples for org.apache.hadoop.util.bloom DynamicBloomFilter DynamicBloomFilter
public DynamicBloomFilter(int vectorSize, int nbHash, int hashType, int nr)
From source file:boa.aggregators.DistinctAggregator.java
License:Apache License
/** {@inheritDoc} */ @Override/*from w w w . j a v a 2s . c om*/ public void start(final EmitKey key) { super.start(key); this.filter = new DynamicBloomFilter(this.vectorSize, HASH_COUNT, Hash.MURMUR_HASH, (int) this.getArg()); }
From source file:hivemall.sketch.bloom.BloomFilterUtils.java
License:Apache License
@Nonnull public static DynamicBloomFilter newDynamicBloomFilter(@Nonnegative final int expectedNumberOfElements, @Nonnegative final float errorRate, @Nonnegative final int nbHash) { int vectorSize = (int) Math .ceil((-nbHash * expectedNumberOfElements) / Math.log(1.d - Math.pow(errorRate, 1.d / nbHash))); return new DynamicBloomFilter(vectorSize, nbHash, Hash.MURMUR_HASH, expectedNumberOfElements); }