service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package service manages the main logic of server.

Package service manages the main logic of server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NGT

type NGT interface {
	Start(ctx context.Context) <-chan error
	Search(vec []float32, size uint32, epsilon, radius float32) ([]model.Distance, error)
	SearchByID(uuid string, size uint32, epsilon, radius float32) ([]model.Distance, error)
	Insert(uuid string, vec []float32) (err error)
	InsertMultiple(vecs map[string][]float32) (err error)
	Update(uuid string, vec []float32) (err error)
	UpdateMultiple(vecs map[string][]float32) (err error)
	Delete(uuid string) (err error)
	DeleteMultiple(uuids ...string) (err error)
	GetObject(uuid string) (vec []float32, err error)
	CreateIndex(ctx context.Context, poolSize uint32) (err error)
	SaveIndex(ctx context.Context) (err error)
	Exists(string) (uint32, bool)
	CreateAndSaveIndex(ctx context.Context, poolSize uint32) (err error)
	IsIndexing() bool
	IsSaving() bool
	Len() uint64
	NumberOfCreateIndexExecution() uint64
	NumberOfProactiveGCExecution() uint64
	UUIDs(context.Context) (uuids []string)
	DeleteVQueueBufferLen() uint64
	InsertVQueueBufferLen() uint64
	DeleteVQueueChannelLen() uint64
	InsertVQueueChannelLen() uint64
	GetDimensionSize() int
	Close(ctx context.Context) error
}

func New

func New(cfg *config.NGT, opts ...Option) (nn NGT, err error)

type Option added in v0.0.47

type Option func(n *ngt) error

func WithAutoIndexCheckDuration added in v0.0.47

func WithAutoIndexCheckDuration(dur string) Option

func WithAutoIndexDurationLimit added in v0.0.47

func WithAutoIndexDurationLimit(dur string) Option

func WithAutoIndexLength added in v0.0.47

func WithAutoIndexLength(l int) Option

func WithAutoSaveIndexDuration added in v0.0.47

func WithAutoSaveIndexDuration(dur string) Option

func WithDefaultEpsilon added in v0.0.47

func WithDefaultEpsilon(epsilon float32) Option

func WithDefaultPoolSize added in v0.0.47

func WithDefaultPoolSize(ps uint32) Option

func WithDefaultRadius added in v0.0.47

func WithDefaultRadius(rad float32) Option

func WithEnableInMemoryMode added in v0.0.47

func WithEnableInMemoryMode(enabled bool) Option

func WithErrGroup added in v0.0.47

func WithErrGroup(eg errgroup.Group) Option

func WithIndexPath added in v0.0.47

func WithIndexPath(path string) Option

func WithInitialDelayMaxDuration added in v0.0.47

func WithInitialDelayMaxDuration(dur string) Option

func WithLoadIndexTimeoutFactor added in v0.0.47

func WithLoadIndexTimeoutFactor(dur string) Option

func WithMaxLoadIndexTimeout added in v0.0.47

func WithMaxLoadIndexTimeout(dur string) Option

func WithMinLoadIndexTimeout added in v0.0.47

func WithMinLoadIndexTimeout(dur string) Option

func WithProactiveGC added in v0.0.56

func WithProactiveGC(enabled bool) Option

Directories

Path Synopsis
Package vqueue manages the vector cache layer for reducing FFI overhead for fast Agent processing.
Package vqueue manages the vector cache layer for reducing FFI overhead for fast Agent processing.

Jump to

Keyboard shortcuts

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