engine

package
v3.2.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0, MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Reader() Reader
	Writer() Writer
	//return three value, field to vearchpb.Field , new Schema info , error
	NewSnapshot() (proto.Snapshot, error)
	ApplySnapshot(peers []proto.Peer, iter proto.SnapIterator) error
	Optimize() error
	IndexStatus() int
	EngineStatus(status *EngineStatus) error
	Close()

	UpdateMapping(space *entity.Space) error
	GetMapping() *mapping.IndexMapping

	GetSpace() *entity.Space
	GetPartitionID() entity.PartitionID

	SetEngineCfg(config *gamma.Config) error
	GetEngineCfg(config *gamma.Config) error
}

Engine is the interface that wraps the core operations of a document store.

type EngineStatus

type EngineStatus struct {
	IndexStatus   int32
	DocNum        int32
	MaxDocid      int32
	MinIndexedNum int32
}

type Reader

type Reader interface {
	GetDoc(ctx context.Context, doc *vearchpb.Document) error

	ReadSN(ctx context.Context) (int64, error)

	DocCount(ctx context.Context) (uint64, error)

	Capacity(ctx context.Context) (int64, error)

	Search(ctx context.Context, request *vearchpb.SearchRequest, resp *vearchpb.SearchResponse) error
}

Reader is the read interface to an engine's data.

type Writer

type Writer interface {
	// use do by single cmd , support create update replace or delete
	Write(ctx context.Context, docCmd *vearchpb.DocCmd) error

	// flush memory to segment, new reader will read the newest data
	Flush(ctx context.Context, sn int64) error

	// commit is renew a memory block, return a chan to client, client get the chan to wait the old memory flush to segment
	Commit(ctx context.Context, sn int64) (chan error, error)
}

Writer is the write interface to an engine's data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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