Liking cljdoc? Tell your friends :D

com.fulcrologic.datomic-cloud-backup.id-cache

LRU cache for long->long mappings with bounded size.

This is a simple LRU cache - it doesn't know anything about Datomic IDs or entity indices. That logic belongs in the restore code that uses this cache.

LRU cache for long->long mappings with bounded size.

This is a simple LRU cache - it doesn't know anything about Datomic IDs
or entity indices. That logic belongs in the restore code that uses this cache.
raw docstring

default-max-cache-sizeclj

source

ILRUCachecljprotocol

Protocol for an LRU cache mapping long keys to long values.

Protocol for an LRU cache mapping long keys to long values.

cache-sizeclj

(cache-size this)

Returns the current number of entries in the cache.

Returns the current number of entries in the cache.

cache-statsclj

(cache-stats this)

Returns stats about cache hits/misses/evictions.

Returns stats about cache hits/misses/evictions.

lookupclj

(lookup this k)

Look up value for key k. Returns nil if not found. Marks entry as recently used.

Look up value for key k. Returns nil if not found. Marks entry as recently used.

max-cache-sizeclj

(max-cache-size this)

Returns the maximum allowed cache size.

Returns the maximum allowed cache size.

store!clj

(store! this k v)

Store mapping k->v. May evict least-recently-used entry if at capacity.

Store mapping k->v. May evict least-recently-used entry if at capacity.
sourceraw docstring

new-lru-cacheclj

(new-lru-cache)
(new-lru-cache {:keys [max-size] :or {max-size default-max-cache-size}})

Create a new LRU cache for long->long mappings.

Options:

  • :max-size - Maximum number of entries before LRU eviction (default 1,000,000)

Memory usage is approximately 48 bytes per entry.

Create a new LRU cache for long->long mappings.

Options:
- :max-size - Maximum number of entries before LRU eviction (default 1,000,000)

Memory usage is approximately 48 bytes per entry.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close