Skip to content

Utilize min heap for keysWithExpiry #151

@osteensco

Description

@osteensco

Problem:
We currently use heaps for our LFU and LRU eviction rules. We do not use a heap with simple TTL.
In the evictKeysWithExpiredTTL method, the key eviction process is:

  • based on sample size, iterate through the keysWithExpiry map sampleSize times and pseudo random keys to an array
  • iterate through this array, check if the keys expired, and delete the key
    This process also has the potential to keep live what should be evicted keys.

Proposed Solution:
Utilizing a min heap instead would simplify this process and allow it to scale more efficiently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions