MCPcopy
hub / github.com/dgraph-io/badger / WithKeepBlocksInCache

Method WithKeepBlocksInCache

options.go:691–698  ·  view source on GitHub ↗

WithKeepBlocksInCache returns a new Option value with KeepBlocksInCache set to the given value. When this option is set badger will store the block in the cache. The size of the cache is determined by the MaxCacheSize option.If the MaxCacheSize is set to zero, then MaxCacheSize is set to 100 mb. T

(val bool)

Source from the content-addressed store, hash-verified

689//
690// The default value of KeepBlocksInCache is false.
691func (opt Options) WithKeepBlocksInCache(val bool) Options {
692 opt.KeepBlocksInCache = val
693
694 if val && opt.MaxCacheSize == 0 {
695 opt.MaxCacheSize = 100 << 20
696 }
697 return opt
698}

Callers 1

TestIteratePrefixFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestIteratePrefixFunction · 0.64