diff --git a/component/ascend-common/common-utils/cache/lrucache.go b/component/ascend-common/common-utils/cache/lrucache.go index 0c0d42085a9d9e680886f3189d908463a47b2f23..f7d5c218eee04a5f6997ae25137ba41c2a3f4616 100644 --- a/component/ascend-common/common-utils/cache/lrucache.go +++ b/component/ascend-common/common-utils/cache/lrucache.go @@ -25,7 +25,7 @@ import ( ) const ( - segmentCount = 16 + segmentCount = 1600 int64One int64 = 1 int64Zero int64 = 0 negInt64One int64 = -1 @@ -62,9 +62,10 @@ type ConcurrencyLRUCache struct { } // Set create or update an element using key -// key: The identity of an element -// value: new value of the element -// expireTime: expire time, positive int64 or -1 which means never overdue +// +// key: The identity of an element +// value: new value of the element +// expireTime: expire time, positive int64 or -1 which means never overdue func (cl *ConcurrencyLRUCache) Set(key string, value interface{}, expireTime time.Duration) error { if cl == nil || cl.cacheBuket[0] == nil { return notInitErr @@ -80,10 +81,11 @@ func (cl *ConcurrencyLRUCache) Set(key string, value interface{}, expireTime tim } // Get get the value of a cached element by key. If key do not exist, this function will return nil and an error msg -// key: The identity of an element -// return: -// value: the cached value, nil if key do not exist -// err: error info, nil if value is not nil +// +// key: The identity of an element +// return: +// value: the cached value, nil if key do not exist +// err: error info, nil if value is not nil func (cl *ConcurrencyLRUCache) Get(key string) (interface{}, error) { if cl == nil || cl.cacheBuket[0] == nil { return nil, notInitErr