diff --git a/cache.go b/cache.go index c6821c393..8ae8caefc 100644 --- a/cache.go +++ b/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. diff --git a/fragment.go b/fragment.go index 827dda6e2..ef2a5bfab 100644 --- a/fragment.go +++ b/fragment.go @@ -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