mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
use cache.Recalculate instead of Invalidate for imports
Invalidate does not always rebuild the cache - if the last rebuild is < 10s ago, it does nothing. We always want to rebuild the cache after imports. Also updated the comments around recalculate/invalidate to clarify.
This commit is contained in:
parent
14a8362261
commit
3ea07ae3a7
2 changed files with 4 additions and 4 deletions
4
cache.go
4
cache.go
|
|
@ -40,10 +40,10 @@ type cache interface {
|
|||
// Returns a list of all IDs.
|
||||
IDs() []uint64
|
||||
|
||||
// Updates the cache, if necessary.
|
||||
// Soft ask for the cache to be rebuilt - may not if it has been done recently.
|
||||
Invalidate()
|
||||
|
||||
// Rebuilds the cache
|
||||
// Rebuilds the cache.
|
||||
Recalculate()
|
||||
|
||||
// Returns an ordered list of the top ranked bitmaps.
|
||||
|
|
|
|||
|
|
@ -1386,7 +1386,7 @@ func (f *fragment) bulkImport(rowIDs, columnIDs []uint64) error {
|
|||
f.cache.BulkAdd(rowID, n)
|
||||
}
|
||||
|
||||
f.cache.Invalidate()
|
||||
f.cache.Recalculate()
|
||||
return snapshot(f, results)
|
||||
}
|
||||
|
||||
|
|
@ -1462,7 +1462,7 @@ func (f *fragment) importRoaringBytes(roaringBytes []byte) error {
|
|||
n := bm.CountRange(rowID*ShardWidth, (rowID+1)*ShardWidth)
|
||||
f.cache.BulkAdd(rowID, n)
|
||||
}
|
||||
f.cache.Invalidate()
|
||||
f.cache.Recalculate()
|
||||
|
||||
err = snapshot(f, bm)
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue