Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GDSFEvictionPolicy<Key, Value, ArgumentsBundle>

Greedy Dual-Size with Frequency eviction policy. To be used carefully, as in practice, if no items are evicted, items frequency will increase with a very low rate.

Type parameters

  • Key

    Type of the key.

  • Value

    Type of the value.

  • ArgumentsBundle

    Type of the arguments bundle.

Hierarchy

  • BaseLFUEvictionPolicy<Key, Value, ArgumentsBundle>
    • GDSFEvictionPolicy

Constructors

constructor

  • Type parameters

    • Key

    • Value

    • ArgumentsBundle

    Parameters

    • cacheMaxCapacity: number

      Cache maximum capacity.

    • cacheBackendElementsCount: CacheBackendElementsCount

      Cache backend elements count.

    • Optional sizeOfInBytes: SizeOf<Value>

      Function which computes sizeof cache entry in bytes.

    Returns GDSFEvictionPolicy<Key, Value, ArgumentsBundle>

Accessors

size

  • get size(): number
  • Returns number

    Total number of elements from frequency list.

Methods

onClear

  • onClear(): void
  • inheritdoc

    Returns void

onDelete

  • onDelete(entry: EvictableCacheEntry<Key, Value>): void
  • inheritdoc

    Parameters

    • entry: EvictableCacheEntry<Key, Value>

    Returns void

onHit

  • inheritdoc

    Parameters

    • entry: EvictableCacheEntry<Key, Value>

    Returns EntryValidity

onMiss

  • onMiss(): void
  • inheritdoc

    Returns void

onSet

  • onSet(entry: EvictableCacheEntry<Key, Value>): void
  • inheritdoc

    Parameters

    • entry: EvictableCacheEntry<Key, Value>

    Returns void

onUpdate

  • onUpdate(entry: EvictableCacheEntry<Key, Value>): void
  • inheritdoc

    Parameters

    • entry: EvictableCacheEntry<Key, Value>

    Returns void

setDeleter

  • setDeleter(deleter: Deleter<Key, Value>): void
  • inheritdoc

    Parameters

    Returns void