Documentation ¶
Index ¶
- Constants
- func NewNoopCache(vecForID common.VectorForID[float32], maxSize int, logger logrus.FieldLogger) *noopCache
- type Cache
- func NewShardedByteLockCache(vecForID common.VectorForID[byte], maxSize int, logger logrus.FieldLogger, ...) Cache[byte]
- func NewShardedFloat32LockCache(vecForID common.VectorForID[float32], maxSize int, logger logrus.FieldLogger, ...) Cache[float32]
- func NewShardedUInt64LockCache(vecForID common.VectorForID[uint64], maxSize int, logger logrus.FieldLogger, ...) Cache[uint64]
Constants ¶
View Source
const ( InitialSize = 1000 MinimumIndexGrowthDelta = 2000 )
View Source
const DefaultDeletionInterval = 3 * time.Second
Variables ¶
This section is empty.
Functions ¶
func NewNoopCache ¶
func NewNoopCache(vecForID common.VectorForID[float32], maxSize int, logger logrus.FieldLogger, ) *noopCache
Types ¶
type Cache ¶
type Cache[T any] interface { Get(ctx context.Context, id uint64) ([]T, error) MultiGet(ctx context.Context, ids []uint64) ([][]T, []error) Len() int32 CountVectors() int64 Delete(ctx context.Context, id uint64) Preload(id uint64, vec []T) Prefetch(id uint64) Grow(size uint64) Drop() UpdateMaxSize(size int64) CopyMaxSize() int64 All() [][]T }
func NewShardedByteLockCache ¶
func NewShardedByteLockCache(vecForID common.VectorForID[byte], maxSize int, logger logrus.FieldLogger, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[byte]
func NewShardedFloat32LockCache ¶
func NewShardedFloat32LockCache(vecForID common.VectorForID[float32], maxSize int, logger logrus.FieldLogger, normalizeOnRead bool, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[float32]
func NewShardedUInt64LockCache ¶
func NewShardedUInt64LockCache(vecForID common.VectorForID[uint64], maxSize int, logger logrus.FieldLogger, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[uint64]
Click to show internal directories.
Click to hide internal directories.