INNER CODE UNIT · Go
func
go-graphite/go-carbon · cache/cache.go:105
func (c *Cache) InitCacheScanAdds() {
for _, shard := range c.data {
shard.adds = make(map[string]struct{})
}
}
// SetWriteStrategy ...
func (c *Cache) SetWriteStrategy(s string) (err error) {
c.mu.Lock()
defer c.mu.Unlock()
switch s {
case "max":
c.writeStrategy = MaximumLength
case "sorted":
c.writeStrategy = TimestampOrder
case "noop":
c.writeStrategy = Noop