MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / UnorderedCache

Struct UnorderedCache

pkg/util/cache/cache.go:351–354  ·  view source on GitHub ↗

UnorderedCache is a cache which supports custom eviction triggers and two eviction policies: LRU and FIFO. A listener pattern is available for eviction events. This cache uses a hashmap for storing elements, making it the most performant. Only exact lookups are supported. UnorderedCache requires th

Source from the content-addressed store, hash-verified

349//
350// UnorderedCache is not safe for concurrent access.
351type UnorderedCache struct {
352 baseCache
353 hmap map[interface{}]interface{}
354}
355
356// NewUnorderedCache creates a new UnorderedCache backed by a hash map.
357func NewUnorderedCache(config Config) *UnorderedCache {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected