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. */
| 8855 | * the access frequencyonly (must be <= 255). |
| 8856 | * returns REDISMODULE_OK if the LFU was updated, REDISMODULE_ERR otherwise. */ |
| 8857 | int RM_SetLFU(RedisModuleKey *key, long long lfu_freq) { |
| 8858 | if (!key->value) |
| 8859 | return REDISMODULE_ERR; |
| 8860 | if (objectSetLRUOrLFU(key->value, lfu_freq, -1, 0, 1)) |
| 8861 | return REDISMODULE_OK; |
| 8862 | return REDISMODULE_ERR; |
| 8863 | } |
| 8864 | |
| 8865 | /* Gets the key access frequency or -1 if the server's eviction policy is not |
| 8866 | * LFU based. |
nothing calls this directly
no test coverage detected