dynamic

package
v1.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, uc ent.UserConfig, store *lsmkv.Store) (*dynamic, error)

func ValidateUserConfigUpdate

func ValidateUserConfigUpdate(initial, updated schemaconfig.VectorIndexConfig) error

Types

type Config

type Config struct {
	ID                       string
	TargetVector             string
	Logger                   logrus.FieldLogger
	RootPath                 string
	ShardName                string
	ClassName                string
	PrometheusMetrics        *monitoring.PrometheusMetrics
	VectorForIDThunk         common.VectorForID[float32]
	TempVectorForIDThunk     common.TempVectorForID
	DistanceProvider         distancer.Provider
	MakeCommitLoggerThunk    hnsw.MakeCommitLogger
	TombstoneCallbacks       cyclemanager.CycleCallbackGroup
	ShardCompactionCallbacks cyclemanager.CycleCallbackGroup
	ShardFlushCallbacks      cyclemanager.CycleCallbackGroup
}

func (Config) Validate

func (c Config) Validate() error

type VectorIndex

type VectorIndex interface {
	Dump(labels ...string)
	Add(id uint64, vector []float32) error
	AddBatch(ctx context.Context, id []uint64, vector [][]float32) error
	Delete(id ...uint64) error
	SearchByVector(vector []float32, k int, allow helpers.AllowList) ([]uint64, []float32, error)
	SearchByVectorDistance(vector []float32, dist float32,
		maxLimit int64, allow helpers.AllowList) ([]uint64, []float32, error)
	UpdateUserConfig(updated schemaconfig.VectorIndexConfig, callback func()) error
	Drop(ctx context.Context) error
	Shutdown(ctx context.Context) error
	Flush() error
	SwitchCommitLogs(ctx context.Context) error
	ListFiles(ctx context.Context, basePath string) ([]string, error)
	PostStartup()
	Compressed() bool
	ValidateBeforeInsert(vector []float32) error
	DistanceBetweenVectors(x, y []float32) (float32, bool, error)
	ContainsNode(id uint64) bool
	DistancerProvider() distancer.Provider
	AlreadyIndexed() uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL