Versions in this module Expand all Collapse all v1 v1.2.0 Feb 29, 2024 Changes in this version + const IncIterNumCacheSize + const IncIterNumCacheTTL + const TimeSizeBytes + var GlobalIncIterNumCache = NewCache(IncIterNumCacheSize, IncIterNumCacheTTL) + var NodeIncIterNumCache = NewCache(IncIterNumCacheSize, IncIterNumCacheTTL) + func GetGlobalIterNum(queryID string) (int32, bool) + func GetNodeIterNum(queryID string) (int32, bool) + func PutGlobalIterNum(queryID string, iterCount int32) + func PutNodeIterNum(queryID string, iterCount int32) + func UpdateIterNumFunc(old, new Entry) bool + func UpdateMetaData(_, _ Entry) bool + type Cache struct + func NewCache(maxBytes int64, expireTime time.Duration) *Cache + func (c *Cache) Get(key string) (Entry, bool) + func (c *Cache) Len() int + func (c *Cache) Put(key string, value Entry, needUpdate func(old Entry, new Entry) bool) + func (c *Cache) Remove(key string) + type Entry interface + GetKey func() string + GetTime func() time.Time + GetValue func() interface{} + SetTime func(time time.Time) + SetValue func(value interface{}) + Size func() int64 + type IncIterNumEntry struct + func NewIncIterNumEntry(queryID string) *IncIterNumEntry + func (e *IncIterNumEntry) GetKey() string + func (e *IncIterNumEntry) GetTime() time.Time + func (e *IncIterNumEntry) GetValue() interface{} + func (e *IncIterNumEntry) SetTime(time time.Time) + func (e *IncIterNumEntry) SetValue(value interface{}) + func (e *IncIterNumEntry) Size() int64