MCPcopy Create free account
hub / github.com/AdRoll/baker / BufferCache

Struct BufferCache

pkg/buffercache/cache.go:54–71  ·  view source on GitHub ↗

A BufferCache is like a map[string][]byte that is optimized for appending new bytes to the cache values.

Source from the content-addressed store, hash-verified

52// A BufferCache is like a map[string][]byte that is optimized for appending
53// new bytes to the cache values.
54type BufferCache struct {
55 m locationMap
56 cold *coldCache
57 hot struct {
58 m map[string][]byte // actual cache
59 cap, maxcap int // current and total capacity (sum of all buffers)
60 maxbuflen int // max length allowed for a single buffer
61 }
62
63 // onFlush is called each time a buffer is evicted from the cache.
64 // nflushes is the number of times onFlush is called.
65 onFlush func([]byte)
66 nflushes uint64
67
68 compressionOn bool
69 comp compressor
70 decomp decompressor
71}
72
73type errInvalidConfig string
74

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected