MCPcopy
hub / github.com/olric-data/olric / DMaps

Struct DMaps

config/dmaps.go:26–79  ·  view source on GitHub ↗

DMaps denotes a global configuration for DMaps. You can still overwrite it by setting a DMap for a particular distributed map via Custom field. Most of the fields are related with distributed cache implementation.

Source from the content-addressed store, hash-verified

24// setting a DMap for a particular distributed map via Custom field. Most of the
25// fields are related with distributed cache implementation.
26type DMaps struct {
27 // Engine contains configuration for a storage engine implementation. It may contain the implementation.
28 // See Engine itself.
29 Engine *Engine
30
31 // NumEvictionWorkers denotes the number of goroutines that are used to find
32 // keys for eviction. This is a global configuration variable. So you cannot set
33 // // different values per DMap.
34 NumEvictionWorkers int64
35
36 // MaxIdleDuration denotes maximum time for each entry to stay idle in the DMap.
37 // It limits the lifetime of the entries relative to the time of the last
38 // read or write access performed on them. The entries whose idle period exceeds
39 // this limit are expired and evicted automatically. An entry is idle if no Get,
40 // Put, Expire on it. Configuration of MaxIdleDuration feature varies by preferred
41 // deployment method.
42 MaxIdleDuration time.Duration
43
44 // TTLDuration is useful to set a default TTL for every key/value pair a
45 // distributed map instance.
46 TTLDuration time.Duration
47
48 // MaxKeys denotes maximum key count on a particular node. So if you have 10
49 // nodes with MaxKeys=100000, your key count in the cluster should be around
50 // MaxKeys*10=1000000
51 MaxKeys int
52
53 // MaxInuse denotes maximum amount of in-use memory on a particular node.
54 // So if you have 10 nodes with MaxInuse=100M (it has to be in bytes), amount
55 // of in-use memory should be around MaxInuse*10=1G
56 MaxInuse int
57
58 // LRUSamples denotes amount of randomly selected key count by the approximate
59 // LRU implementation. Lower values are better for high performance. It's
60 // 5 by default.
61 LRUSamples int
62
63 // EvictionPolicy determines the eviction policy in use. It's NONE by default.
64 // Set as LRU to enable LRU eviction policy.
65 EvictionPolicy EvictionPolicy
66
67 // CheckEmptyFragmentsInterval is the interval between two sequential calls of empty
68 // fragment cleaner. This is a global configuration variable. So you cannot set
69 // different values per DMap.
70 CheckEmptyFragmentsInterval time.Duration
71
72 // TriggerCompactionInterval is interval between two sequential call of compaction worker.
73 // This is a global configuration variable. So you cannot set
74 // different values per DMap.
75 TriggerCompactionInterval time.Duration
76
77 // Custom is useful to set custom cache config per DMap instance.
78 Custom map[string]DMap
79}
80
81// Sanitize sets default values to empty configuration variables, if it's possible.
82func (dm *DMaps) Sanitize() error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected