aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/storage/needle_map_metric.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.go
index 7cf48dd72..0bdfdcedc 100644
--- a/weed/storage/needle_map_metric.go
+++ b/weed/storage/needle_map_metric.go
@@ -93,10 +93,10 @@ func (mm *mapMetric) MaybeSetMaxFileKey(key NeedleId) {
func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
mm = &mapMetric{}
- var bf *boom.StableBloomFilter
+ var bf *boom.BloomFilter
buf := make([]byte, NeedleIdSize)
err = reverseWalkIndexFile(r, func(entryCount int64) {
- bf = boom.NewDefaultStableBloomFilter(uint(entryCount), 0.001)
+ bf = boom.NewBloomFilter(uint(entryCount), 0.001)
}, func(key NeedleId, offset Offset, size Size) error {
mm.MaybeSetMaxFileKey(key)
@@ -105,9 +105,8 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
mm.FileByteCounter += uint64(size)
}
- if !bf.Test(buf) {
+ if !bf.TestAndAdd(buf) {
mm.FileCounter++
- bf.Add(buf)
} else {
// deleted file
mm.DeletionCounter++