Set the key access frequency. only relevant if the server's maxmemory policy * is LFU based. * The frequency is a logarithmic counter that provides an indication of * the access frequencyonly (must be <= 255). * returns REDISMODULE_OK if the LFU was updated, REDISMODULE_ERR otherwise. */
| 9055 | * the access frequencyonly (must be <= 255). |
| 9056 | * returns REDISMODULE_OK if the LFU was updated, REDISMODULE_ERR otherwise. */ |
| 9057 | int RM_SetLFU(RedisModuleKey *key, long long lfu_freq) { |
| 9058 | if (!key->value) |
| 9059 | return REDISMODULE_ERR; |
| 9060 | if (objectSetLRUOrLFU(key->value, lfu_freq, -1, 0, 1)) |
| 9061 | return REDISMODULE_OK; |
| 9062 | return REDISMODULE_ERR; |
| 9063 | } |
| 9064 | |
| 9065 | /* Gets the key access frequency or -1 if the server's eviction policy is not |
| 9066 | * LFU based. |
nothing calls this directly
no test coverage detected