System.out.println((created-start)+"ms to setup UUF");
System.out.println((finished-created)+"ms to perform all adds");
}
private UriUniqFilter createUriUniqFilter(String testClass) throws IOException {
UriUniqFilter uniq = null;
if(BdbUriUniqFilter.class.getName().endsWith(testClass)) {;
// BDB setup
File tmpDir = File.createTempFile("uuf","benchmark");
tmpDir.delete();
tmpDir.mkdir();
uniq = new BdbUriUniqFilter(tmpDir, 50);
} else if(BloomUriUniqFilter.class.getName().endsWith(testClass)) {
// bloom setup
uniq = new BloomUriUniqFilter();
} else if(MemUriUniqFilter.class.getName().endsWith(testClass)) {
// mem hashset
uniq = new MemUriUniqFilter();
} else if (FPUriUniqFilter.class.getName().endsWith(testClass)) {
// mem fp set (open-addressing) setup
uniq = new FPUriUniqFilter(new MemLongFPSet(21,0.75f));
}
uniq.setDestination(this);
return uniq;
}