Browse Source
the statistical methord for fileCount should stay same (#3477)
the statistical methord for fileCount between should stay same
They all equal to the entry count in .idx file.
relate to commit(c7892bc
)
pull/3478/head
Guo Lei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
weed/storage/needle_map_memory.go
|
@ -35,8 +35,8 @@ func LoadCompactNeedleMap(file *os.File) (*NeedleMap, error) { |
|
|
func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) { |
|
|
func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) { |
|
|
e := idx.WalkIndexFile(file, 0, func(key NeedleId, offset Offset, size Size) error { |
|
|
e := idx.WalkIndexFile(file, 0, func(key NeedleId, offset Offset, size Size) error { |
|
|
nm.MaybeSetMaxFileKey(key) |
|
|
nm.MaybeSetMaxFileKey(key) |
|
|
|
|
|
nm.FileCounter++ |
|
|
if !offset.IsZero() && size.IsValid() { |
|
|
if !offset.IsZero() && size.IsValid() { |
|
|
nm.FileCounter++ |
|
|
|
|
|
nm.FileByteCounter = nm.FileByteCounter + uint64(size) |
|
|
nm.FileByteCounter = nm.FileByteCounter + uint64(size) |
|
|
oldOffset, oldSize := nm.m.Set(NeedleId(key), offset, size) |
|
|
oldOffset, oldSize := nm.m.Set(NeedleId(key), offset, size) |
|
|
if !oldOffset.IsZero() && oldSize.IsValid() { |
|
|
if !oldOffset.IsZero() && oldSize.IsValid() { |
|
|