moveToHotCache moves a buffer from the cold to the hot cache. loc represents the location of the buffer in the cold cache.
(key string, loc location)
| 342 | // moveToHotCache moves a buffer from the cold to the hot cache. |
| 343 | // loc represents the location of the buffer in the cold cache. |
| 344 | func (c *BufferCache) moveToHotCache(key string, loc location) { |
| 345 | // Extract buffer and cell index from the location |
| 346 | bidx, cidx := loc.coldBucketIdx(), loc.coldCellIdx() |
| 347 | |
| 348 | // Retrieve the log line |
| 349 | l, compressed := c.cold.buckets[bidx].get(cidx) |
| 350 | // Clear the corresponding cell in the bitmap |
| 351 | c.cold.buckets[bidx].freecells.clearBit(cidx) |
| 352 | c.putInHot(key, l, compressed) |
| 353 | c.m.m[key] = hotCacheLocation |
| 354 | } |
| 355 | |
| 356 | // Metrics returns a snapshot of the cache performance counters. |
| 357 | // |