Skip to content

Commit

Permalink
Log number of blocks and false positive rates for infinifilter
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Dec 22, 2024
1 parent c3274ed commit 2a5417f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/peergos/blockstore/CidInfiniFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static CidInfiniFilter build(Blockstore bs) {
public static CidInfiniFilter build(Blockstore bs, double falsePositiveRate) {
List<Cid> refs = bs.refs(false).join();
int nBlocks = refs.size()*5/4; // increase by 25% to avoid expansion during build
LOG.info("Building infini filter for " + nBlocks + " blocks with false positive rate: " + falsePositiveRate);
CidInfiniFilter infini = build(nBlocks, falsePositiveRate);
refs.forEach(c -> infini.add(c));
return infini;
Expand Down

0 comments on commit 2a5417f

Please sign in to comment.