Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultCacheIndexReap is the default Cache Index Reap interval DefaultCacheIndexReap = 3 * time.Second // DefaultCacheIndexFlush is the default Cache Index Flush interval DefaultCacheIndexFlush = 5 * time.Second // DefaultCacheMaxSizeBytes is the default Max Cache Size in Bytes DefaultCacheMaxSizeBytes = 536870912 // DefaultMaxSizeBackoffBytes is the default Max Cache Backoff Size in Bytes DefaultMaxSizeBackoffBytes = 16777216 // DefaultMaxSizeObjects is the default Max Cache Object Count DefaultMaxSizeObjects = 0 // DefaultMaxSizeBackoffObjects is the default Max Cache Backoff Object Count DefaultMaxSizeBackoffObjects = 100 // DefaultIndexExpiry is the default Index Expiry DefaultIndexExpiry = time.Hour * 24 * 365 // 1 year )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// ReapInterval defines how long the Cache Index reaper sleeps between reap cycles
ReapInterval time.Duration `yaml:"reap_interval,omitempty"`
// FlushInterval sets how often the Cache Index saves its metadata to the cache from application memory
FlushInterval time.Duration `yaml:"flush_interval,omitempty"`
// IndexExpiry defines the interval at which to consider a flushed index as expired
IndexExpiry time.Duration `yaml:"index_expiry,omitempty"`
// MaxSizeBytes indicates how large the cache can grow in bytes before the Index evicts
// least-recently-accessed items.
MaxSizeBytes int64 `yaml:"max_size_bytes,omitempty"`
// MaxSizeBackoffBytes indicates how far below max_size_bytes the cache size must be
// to complete a byte-size-based eviction exercise.
MaxSizeBackoffBytes int64 `yaml:"max_size_backoff_bytes,omitempty"`
// MaxSizeObjects indicates how large the cache can grow in objects before the Index
// evicts least-recently-accessed items.
MaxSizeObjects int64 `yaml:"max_size_objects,omitempty"`
// MaxSizeBackoffObjects indicates how far under max_size_objects the cache size must
// be to complete object-size-based eviction exercise.
MaxSizeBackoffObjects int64 `yaml:"max_size_backoff_objects,omitempty"`
}
Options defines the operation of the Cache Indexer
func New ¶
func New() *Options
New returns a new Cache Index Options Reference with default values set
Click to show internal directories.
Click to hide internal directories.