aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-29 21:26:38 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-29 21:26:38 -0700
commit5adfdd79823ab0576259c8b4fa173903f301bc16 (patch)
tree93001c5ee59ffeecd841bef7269b407055317260 /weed
parent05f32376eb8e215fe69a5942ef741d406b6e93eb (diff)
downloadseaweedfs-5adfdd79823ab0576259c8b4fa173903f301bc16.tar.xz
seaweedfs-5adfdd79823ab0576259c8b4fa173903f301bc16.zip
change to a new bloom filter library
Diffstat (limited to 'weed')
-rw-r--r--weed/storage/needle_map_metric.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.go
index 3618dada9..7cf48dd72 100644
--- a/weed/storage/needle_map_metric.go
+++ b/weed/storage/needle_map_metric.go
@@ -7,7 +7,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/storage/idx"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
- "github.com/willf/bloom"
+ "github.com/tylertreat/BoomFilters"
)
type mapMetric struct {
@@ -93,10 +93,10 @@ func (mm *mapMetric) MaybeSetMaxFileKey(key NeedleId) {
func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
mm = &mapMetric{}
- var bf *bloom.BloomFilter
+ var bf *boom.StableBloomFilter
buf := make([]byte, NeedleIdSize)
err = reverseWalkIndexFile(r, func(entryCount int64) {
- bf = bloom.NewWithEstimates(uint(entryCount), 0.001)
+ bf = boom.NewDefaultStableBloomFilter(uint(entryCount), 0.001)
}, func(key NeedleId, offset Offset, size Size) error {
mm.MaybeSetMaxFileKey(key)