common

package
v2.0.0-...-cf564f5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout            = 120
	DefaultIntFieldName       = "int64"
	DefaultFloatFieldName     = "float"
	DefaultVarcharFieldName   = "varchar"
	DefaultFloatVecFieldName  = "floatVec"
	DefaultBinaryVecFieldName = "binaryVec"
	DefaultPartition          = "_default"
	DefaultIndexName          = "_default_idx_102"
	DefaultIndexNameBinary    = "_default_idx_100"
	DefaultDim                = 128
	DefaultDimStr             = "128"
	MaxDim                    = 32768
	DefaultMaxLength          = "65535"
	DefaultShards             = int32(2)
	DefaultConsistencyLevel   = entity.ConsistencyLevel(0)
	DefaultNb                 = 3000
	DefaultNq                 = 5
	DefaultTopK               = 10
	MaxCollectionNameLen      = 255
	RowCount                  = "row_count"
	RetentionDuration         = 40 // common.retentionDuration
)

Variables

View Source
var IndexStateValue = map[string]int32{
	"IndexStateNone": 0,
	"Unissued":       1,
	"InProgress":     2,
	"Finished":       3,
	"Failed":         4,
	"Retry":          5,
}

Functions

func CheckCollection

func CheckCollection(t *testing.T, actualCollection *entity.Collection, expCollName string, expShardNum int32,
	expSchema *entity.Schema, expConsistencyLevel entity.ConsistencyLevel)

check

func CheckContainsCollection

func CheckContainsCollection(t *testing.T, collections []*entity.Collection, collName string)

check collections contains collName

func CheckErr

func CheckErr(t *testing.T, actualErr error, expErrNil bool, expErrorMsg ...string)

check err and errMsg

func CheckIndexResult

func CheckIndexResult(t *testing.T, actualIndexes []entity.Index, expIndexes ...entity.Index)

check index result, index type, metric type, index params

func CheckInsertResult

func CheckInsertResult(t *testing.T, actualIds entity.Column, expIds entity.Column)

check insert result, ids len (insert count), ids data (pks, but no auto ids)

func CheckOutputFields

func CheckOutputFields(t *testing.T, actualColumns []entity.Column, expFields []string)

check query output fields

func CheckPersistentSegments

func CheckPersistentSegments(t *testing.T, actualSegments []*entity.Segment, expNb int64)

check persistent segments

func CheckQueryResult

func CheckQueryResult(t *testing.T, actualColumns []entity.Column, expColumns []entity.Column)

check query result, column name, type and field date expColumns are

func CheckSearchResult

func CheckSearchResult(t *testing.T, actualSearchResults []client.SearchResult, expNq int, expTopK int)

check search result, check nq, topK, ids, score

func EqualColumn

func EqualColumn(t *testing.T, columnA entity.Column, columnB entity.Column)

assert field data is equal of two columns

func EqualFields

func EqualFields(t *testing.T, fieldA *entity.Field, fieldB *entity.Field)

equal two fields

func EqualSchema

func EqualSchema(t *testing.T, schemaA entity.Schema, schemaB entity.Schema)

equal two schemas

func GenAllBinaryIndex

func GenAllBinaryIndex(metricType entity.MetricType) []entity.Index

gen all binary vector index

func GenAllFields

func GenAllFields() []*entity.Field

gen fields with all scala field types

func GenAllFloatIndex

func GenAllFloatIndex(metricType entity.MetricType) []entity.Index

gen all float vector index

func GenBinaryVector

func GenBinaryVector(nb int, dim int) [][]byte

gen binary vector values

func GenDefaultBinaryData

func GenDefaultBinaryData(start int, nb int, dim int) (*entity.ColumnInt64, *entity.ColumnFloat, *entity.ColumnBinaryVector)

gen default binary collection data

func GenDefaultBinaryFields

func GenDefaultBinaryFields(autoID bool, dim string) []*entity.Field

gen default binary fields with int64, float, binaryVector field

func GenDefaultColumnData

func GenDefaultColumnData(start int, nb int, dim int) (*entity.ColumnInt64, *entity.ColumnFloat, *entity.ColumnFloatVector)

gen default column with data

func GenDefaultFields

func GenDefaultFields(autoID bool) []*entity.Field

gen default fields with int64, float, floatVector field

func GenDefaultVarcharData

func GenDefaultVarcharData(start int, nb int, dim int) (*entity.ColumnVarChar, *entity.ColumnBinaryVector)

func GenDefaultVarcharFields

func GenDefaultVarcharFields(autoID bool) []*entity.Field

gen default fields with varchar, floatVector field

func GenFloatVector

func GenFloatVector(nb, dim int) [][]float32

gen float vector values

func GenLongString

func GenLongString(n int) string

gen invalid long string

func GenRandomString

func GenRandomString(n int) string

gen random string

func GenScalaField

func GenScalaField(name string, fieldType entity.FieldType, primaryKey bool, autoID bool) *entity.Field

gen scala field

func GenSchema

func GenSchema(name string, autoID bool, fields []*entity.Field) *entity.Schema

gen schema

func GenSearchVectors

func GenSearchVectors(nq int, dim int, dataType entity.FieldType) []entity.Vector

gen search vectors

func GenVectorField

func GenVectorField(name string, fieldType entity.FieldType, dim string) *entity.Field

gen vector field

Types

This section is empty.

Jump to

Keyboard shortcuts

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