Struct EvictStrategy

Struct Documentation

struct nv::merlin::EvictStrategy

The eviction strategies.

Note

The Score concept is introduced to define the importance of each key, the larger, the more important, the less likely they will be evicted. On kLru mode, the scores parameter of the APIs should keep nullptr, the score for each key is assigned internally in LRU(Least Recently Used) policy. On kCustomized mode, the scores should be provided by caller.

Note

Eviction occurs automatically when a bucket is full. The keys with the minimum score value are evicted first.

Note

on kLru, Set the score to the Device clock in a nanosecond, which could differ slightly from the host clock.

Note

For kEpochLru and kEpochLfu, the high 32bits would be set to global_epoch while the low 32 bits is timestamp or frequency.

Note

on kLfu, Frequency increment provided by caller via the input parameter of scores of insert-like APIs as the increment of frequency. when the scores reaches to the max of uint64_t, it will not increase any more.

Note

On kEpochLru, the high 32bits is the global epoch provided via the input parameter of global_epoch, the low 32bits is equal to (device_clock <blockquote><blockquote>20) & 0xffffffff with granularity close to 1 ms.

Note

On kEpochLfu, the high 32bits is the global epoch provided via the input parameter of global_epoch, the low 32bits is the frequency, the frequency will keep constant after reaching the max value of 0xffffffff.

Note

On kCustomized, fully provided by the caller via the input parameter of scores of insert-like APIs.

Public Types

enum EvictStrategyEnum

Values:

enumerator kLru

LRU mode.

enumerator kLfu

LFU mode.

enumerator kEpochLru

Epoch Lru mode.

enumerator kEpochLfu

Epoch Lfu mode.

enumerator kCustomized

Customized mode.