t.set(0, reducerBag);
BuildBloom.Final reducer =
new BuildBloom.Final(hashFunc, "fixed", size, numHash);
DataByteArray dba = reducer.exec(t);
Bloom bloom = new Bloom("bla");
bloom.setFilter(dba);
// Test that everything we put in passes.
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
Tuple t1 = tf.newTuple(1);
t1.set(0, i * 10 + j);
assertTrue(bloom.exec(t1));
}
}
// A few that don't pass
for (int i = 100; i < 10; i++) {
Tuple t1 = tf.newTuple(1);
t1.set(0, i);
assertFalse(bloom.exec(t1));
}
}