indexcgowrapper

package
v0.10.3-0...-4820dd7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTextIndex

func CreateTextIndex(ctx context.Context, buildIndexInfo *indexcgopb.BuildIndexInfo) (map[string]int64, error)

func DeleteBuildIndexInfo

func DeleteBuildIndexInfo(info *BuildIndexInfo)

func GetBinarySetKeys

func GetBinarySetKeys(cBinarySet C.CBinarySet) ([]string, error)

func GetBinarySetSize

func GetBinarySetSize(cBinarySet C.CBinarySet, key string) (int64, error)

func GetBinarySetValue

func GetBinarySetValue(cBinarySet C.CBinarySet, key string) ([]byte, error)

func GetLocalUsedSize

func GetLocalUsedSize(path string) (int64, error)

func HandleCStatus

func HandleCStatus(status *C.CStatus, extraInfo string) error

HandleCStatus deal with the error returned from CGO

Types

type Blob

type Blob = storage.Blob

type BuildIndexInfo

type BuildIndexInfo struct {
	// contains filtered or unexported fields
}

func NewBuildIndexInfo

func NewBuildIndexInfo(config *indexpb.StorageConfig) (*BuildIndexInfo, error)

func (*BuildIndexInfo) AppendBuildIndexParam

func (bi *BuildIndexInfo) AppendBuildIndexParam(indexParams map[string]string) error

func (*BuildIndexInfo) AppendBuildTypeParam

func (bi *BuildIndexInfo) AppendBuildTypeParam(typeParams map[string]string) error

func (*BuildIndexInfo) AppendFieldMetaInfo

func (bi *BuildIndexInfo) AppendFieldMetaInfo(collectionID int64, partitionID int64, segmentID int64, fieldID int64, fieldType schemapb.DataType) error

func (*BuildIndexInfo) AppendFieldMetaInfoV2

func (bi *BuildIndexInfo) AppendFieldMetaInfoV2(collectionID int64, partitionID int64, segmentID int64, fieldID int64, fieldType schemapb.DataType, fieldName string, dim int64) error

func (*BuildIndexInfo) AppendIndexEngineVersion

func (bi *BuildIndexInfo) AppendIndexEngineVersion(indexEngineVersion int32) error

func (*BuildIndexInfo) AppendIndexMetaInfo

func (bi *BuildIndexInfo) AppendIndexMetaInfo(indexID int64, buildID int64, indexVersion int64) error

func (*BuildIndexInfo) AppendIndexStorageInfo

func (bi *BuildIndexInfo) AppendIndexStorageInfo(dataStorePath, indexStorePath string, dataStoreVersion int64) error

func (*BuildIndexInfo) AppendInsertFile

func (bi *BuildIndexInfo) AppendInsertFile(filePath string) error

func (*BuildIndexInfo) AppendOptionalField

func (bi *BuildIndexInfo) AppendOptionalField(optField *indexpb.OptionalFieldInfo) error

type CgoIndex

type CgoIndex struct {
	// contains filtered or unexported fields
}

func (*CgoIndex) Build

func (index *CgoIndex) Build(dataset *Dataset) error

TODO: this seems to be used only for test. We should mark the method name with ForTest, or maybe move to test file.

func (*CgoIndex) CleanLocalData

func (index *CgoIndex) CleanLocalData() error

func (*CgoIndex) Delete

func (index *CgoIndex) Delete() error

func (*CgoIndex) GetIndexFileInfo

func (index *CgoIndex) GetIndexFileInfo() ([]*IndexFileInfo, error)

func (*CgoIndex) Load

func (index *CgoIndex) Load(blobs []*Blob) error

func (*CgoIndex) Serialize

func (index *CgoIndex) Serialize() ([]*Blob, error)

func (*CgoIndex) UpLoad

func (index *CgoIndex) UpLoad() (map[string]int64, error)

type CodecIndex

type CodecIndex interface {
	Build(*Dataset) error
	Serialize() ([]*Blob, error)
	GetIndexFileInfo() ([]*IndexFileInfo, error)
	Load([]*Blob) error
	Delete() error
	CleanLocalData() error
	UpLoad() (map[string]int64, error)
}

func CreateIndex

func CreateIndex(ctx context.Context, buildIndexInfo *indexcgopb.BuildIndexInfo) (CodecIndex, error)

func NewCgoIndex

func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]string) (CodecIndex, error)

used only in test TODO: use proto.Marshal instead of proto.MarshalTextString for better compatibility.

type Dataset

type Dataset struct {
	DType schemapb.DataType
	Data  map[string]interface{}
}

func GenBFloat16VecDataset

func GenBFloat16VecDataset(vectors []byte) *Dataset

func GenBinaryVecDataset

func GenBinaryVecDataset(vectors []byte) *Dataset

func GenDataset

func GenDataset(data storage.FieldData) *Dataset

func GenFloat16VecDataset

func GenFloat16VecDataset(vectors []byte) *Dataset

func GenFloatVecDataset

func GenFloatVecDataset(vectors []float32) *Dataset

func GenSparseFloatVecDataset

func GenSparseFloatVecDataset(data *storage.SparseFloatVectorFieldData) *Dataset

type IndexFileInfo

type IndexFileInfo struct {
	FileName string
	FileSize int64
}

Jump to

Keyboard shortcuts

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