mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix build
This commit is contained in:
parent
44d0ac95f6
commit
f811fd0903
|
@ -93,10 +93,10 @@ func (mm *mapMetric) MaybeSetMaxFileKey(key NeedleId) {
|
||||||
|
|
||||||
func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
|
func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
|
||||||
mm = &mapMetric{}
|
mm = &mapMetric{}
|
||||||
var bf *boom.StableBloomFilter
|
var bf *boom.BloomFilter
|
||||||
buf := make([]byte, NeedleIdSize)
|
buf := make([]byte, NeedleIdSize)
|
||||||
err = reverseWalkIndexFile(r, func(entryCount int64) {
|
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 {
|
}, func(key NeedleId, offset Offset, size Size) error {
|
||||||
|
|
||||||
mm.MaybeSetMaxFileKey(key)
|
mm.MaybeSetMaxFileKey(key)
|
||||||
|
@ -105,9 +105,8 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
|
||||||
mm.FileByteCounter += uint64(size)
|
mm.FileByteCounter += uint64(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !bf.Test(buf) {
|
if !bf.TestAndAdd(buf) {
|
||||||
mm.FileCounter++
|
mm.FileCounter++
|
||||||
bf.Add(buf)
|
|
||||||
} else {
|
} else {
|
||||||
// deleted file
|
// deleted file
|
||||||
mm.DeletionCounter++
|
mm.DeletionCounter++
|
||||||
|
|
Loading…
Reference in a new issue