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, pageSize uint64, ...) Cache[byte]
- func NewShardedFloat32LockCache(vecForID common.VectorForID[float32], maxSize int, pageSize uint64, ...) Cache[float32]
- func NewShardedMultiFloat32LockCache(multipleVecForID common.VectorForID[[]float32], maxSize int, ...) Cache[float32]
- func NewShardedMultiUInt64LockCache(multipleVecForID common.VectorForID[uint64], maxSize int, ...) Cache[uint64]
- func NewShardedUInt64LockCache(vecForID common.VectorForID[uint64], maxSize int, pageSize uint64, ...) Cache[uint64]
- type CacheKeys
- type MultiCache
Constants ¶
View Source
const ( InitialSize = 1000 RelativeInitialSize = 100 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 { MultiCache[T] Get(ctx context.Context, id uint64) ([]T, error) MultiGet(ctx context.Context, ids []uint64) ([][]T, []error) GetAllInCurrentLock(ctx context.Context, id uint64, out [][]T, errs []error) ([][]T, []error, uint64, uint64) PageSize() uint64 Len() int32 CountVectors() int64 Delete(ctx context.Context, id uint64) Preload(id uint64, vec []T) PreloadNoLock(id uint64, vec []T) SetSizeAndGrowNoLock(id uint64) Prefetch(id uint64) Grow(size uint64) Drop() UpdateMaxSize(size int64) CopyMaxSize() int64 All() [][]T LockAll() UnlockAll() }
func NewShardedByteLockCache ¶
func NewShardedByteLockCache(vecForID common.VectorForID[byte], maxSize int, pageSize uint64, logger logrus.FieldLogger, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[byte]
func NewShardedFloat32LockCache ¶
func NewShardedFloat32LockCache(vecForID common.VectorForID[float32], maxSize int, pageSize uint64, logger logrus.FieldLogger, normalizeOnRead bool, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[float32]
func NewShardedMultiFloat32LockCache ¶
func NewShardedMultiFloat32LockCache(multipleVecForID common.VectorForID[[]float32], maxSize int, logger logrus.FieldLogger, normalizeOnRead bool, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[float32]
func NewShardedMultiUInt64LockCache ¶
func NewShardedMultiUInt64LockCache(multipleVecForID common.VectorForID[uint64], maxSize int, logger logrus.FieldLogger, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[uint64]
func NewShardedUInt64LockCache ¶
func NewShardedUInt64LockCache(vecForID common.VectorForID[uint64], maxSize int, pageSize uint64, logger logrus.FieldLogger, deletionInterval time.Duration, allocChecker memwatch.AllocChecker, ) Cache[uint64]
Click to show internal directories.
Click to hide internal directories.