MCPcopy Create free account
hub / github.com/F-Stack/f-stack / updateLFU

Function updateLFU

app/redis-6.2.6/src/db.c:54–58  ·  view source on GitHub ↗

Update LFU when an object is accessed. * Firstly, decrement the counter if the decrement time is reached. * Then logarithmically increment the counter, and update the access time. */

Source from the content-addressed store, hash-verified

52 * Firstly, decrement the counter if the decrement time is reached.
53 * Then logarithmically increment the counter, and update the access time. */
54void updateLFU(robj *val) {
55 unsigned long counter = LFUDecrAndReturn(val);
56 counter = LFULogIncr(counter);
57 val->lru = (LFUGetTimeInMinutes()<<8) | counter;
58}
59
60/* Low level key lookup API, not actually called directly from commands
61 * implementations that should instead rely on lookupKeyRead(),

Callers 1

lookupKeyFunction · 0.85

Calls 3

LFUDecrAndReturnFunction · 0.85
LFULogIncrFunction · 0.85
LFUGetTimeInMinutesFunction · 0.85

Tested by

no test coverage detected