MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_GetLFU

Function RM_GetLFU

src/module.cpp:9068–9077  ·  view source on GitHub ↗

Gets the key access frequency or -1 if the server's eviction policy is not * LFU based. * returns REDISMODULE_OK if when key is valid. */

Source from the content-addressed store, hash-verified

9066 * LFU based.
9067 * returns REDISMODULE_OK if when key is valid. */
9068int RM_GetLFU(RedisModuleKey *key, long long *lfu_freq) {
9069 *lfu_freq = -1;
9070 if (!key->value)
9071 return REDISMODULE_ERR;
9072 if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU)
9073 {
9074 *lfu_freq = LFUDecrAndReturn(key->value);
9075 }
9076 return REDISMODULE_OK;
9077}
9078
9079/* --------------------------------------------------------------------------
9080 * ## Miscellaneous APIs

Callers

nothing calls this directly

Calls 1

LFUDecrAndReturnFunction · 0.85

Tested by

no test coverage detected