mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 12:57:22 +08:00
change to a new bloom filter library
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user