mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-06 00:25:55 +00:00
cache update on import adjustment
This commit is contained in:
parent
15e425ae8f
commit
b7780518cc
1 changed files with 4 additions and 2 deletions
|
|
@ -883,7 +883,8 @@ func (f *Fragment) Import(bitmapIDs, profileIDs []uint64) error {
|
|||
}
|
||||
|
||||
// Write to storage.
|
||||
if _, err := f.storage.Add(pos); err != nil {
|
||||
changed, err := f.storage.Add(pos)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -898,13 +899,14 @@ func (f *Fragment) Import(bitmapIDs, profileIDs []uint64) error {
|
|||
bmCounter = bitmap.Count()
|
||||
lastID = bitmapID
|
||||
}
|
||||
if bitmap.SetBit(profileID) {
|
||||
if changed {
|
||||
bmCounter += 1
|
||||
}
|
||||
|
||||
// Invalidate block checksum.
|
||||
delete(f.checksums, int(bitmapID/HashBlockSize))
|
||||
}
|
||||
f.cache.Add(lastID, bmCounter)
|
||||
|
||||
f.cache.Invalidate()
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue