common

package
v0.0.0-...-572c485 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StartOfUserFieldID represents the starting ID of the user-defined field
	StartOfUserFieldID = 100

	// RowIDField is the ID of the RowID field reserved by the system
	RowIDField = 0

	// TimeStampField is the ID of the Timestamp field reserved by the system
	TimeStampField = 1

	// RowIDFieldName defines the name of the RowID field
	RowIDFieldName = "RowID"

	// TimeStampFieldName defines the name of the Timestamp field
	TimeStampFieldName = "Timestamp"

	// MetaFieldName is the field name of dynamic schema
	MetaFieldName = "$meta"

	// DefaultShardsNum defines the default number of shards when creating a collection
	DefaultShardsNum = int32(1)

	// DefaultPartitionsWithPartitionKey defines the default number of partitions when use partition key
	DefaultPartitionsWithPartitionKey = int64(16)

	// InvalidPartitionID indicates that the partition is not specified. It will be set when the partitionName is empty
	InvalidPartitionID = int64(-1)

	// AllPartitionsID indicates data applies to all partitions.
	AllPartitionsID = int64(-1)

	// InvalidFieldID indicates that the field does not exist . It will be set when the field is not found.
	InvalidFieldID = int64(-1)

	// NotRegisteredID means node is not registered into etcd.
	NotRegisteredID = int64(-1)

	// InvalidNodeID indicates that node is not valid in querycoord replica or shard cluster.
	InvalidNodeID = int64(-1)
)
View Source
const (
	// SegmentInsertLogPath storage path const for segment insert binlog.
	SegmentInsertLogPath = `insert_log`

	// SegmentDeltaLogPath storage path const for segment delta log.
	SegmentDeltaLogPath = `delta_log`

	// SegmentStatslogPath storage path const for segment stats log.
	SegmentStatslogPath = `stats_log`

	// SegmentIndexPath storage path const for segment index files.
	SegmentIndexPath = `index_files`

	// PartitionStatsPath storage path const for partition stats files
	PartitionStatsPath = `part_stats`

	// AnalyzeStatsPath storage path const for analyze.
	AnalyzeStatsPath = `analyze_stats`
	OffsetMapping    = `offset_mapping`
	Centroids        = "centroids"
)
View Source
const (
	TopKKey         = "topk"
	SearchParamKey  = "search_param"
	SegmentNumKey   = "segment_num"
	WithFilterKey   = "with_filter"
	DataTypeKey     = "data_type"
	ChannelNumKey   = "channel_num"
	WithOptimizeKey = "with_optimize"
	CollectionKey   = "collection"

	IndexParamsKey = "params"
	IndexTypeKey   = "index_type"
	MetricTypeKey  = "metric_type"
	DimKey         = "dim"
	MaxLengthKey   = "max_length"
	MaxCapacityKey = "max_capacity"

	DropRatioBuildKey = "drop_ratio_build"

	IsSparseKey               = "is_sparse"
	AutoIndexName             = "AUTOINDEX"
	BitmapCardinalityLimitKey = "bitmap_cardinality_limit"
)

Search, Index parameter keys

View Source
const (
	CollectionTTLConfigKey      = "collection.ttl.seconds"
	CollectionAutoCompactionKey = "collection.autocompaction.enabled"

	// rate limit
	CollectionInsertRateMaxKey   = "collection.insertRate.max.mb"
	CollectionInsertRateMinKey   = "collection.insertRate.min.mb"
	CollectionUpsertRateMaxKey   = "collection.upsertRate.max.mb"
	CollectionUpsertRateMinKey   = "collection.upsertRate.min.mb"
	CollectionDeleteRateMaxKey   = "collection.deleteRate.max.mb"
	CollectionDeleteRateMinKey   = "collection.deleteRate.min.mb"
	CollectionBulkLoadRateMaxKey = "collection.bulkLoadRate.max.mb"
	CollectionBulkLoadRateMinKey = "collection.bulkLoadRate.min.mb"
	CollectionQueryRateMaxKey    = "collection.queryRate.max.qps"
	CollectionQueryRateMinKey    = "collection.queryRate.min.qps"
	CollectionSearchRateMaxKey   = "collection.searchRate.max.vps"
	CollectionSearchRateMinKey   = "collection.searchRate.min.vps"
	CollectionDiskQuotaKey       = "collection.diskProtection.diskQuota.mb"

	PartitionDiskQuotaKey = "partition.diskProtection.diskQuota.mb"

	// database level properties
	DatabaseReplicaNumber       = "database.replica.number"
	DatabaseResourceGroups      = "database.resource_groups"
	DatabaseDiskQuotaKey        = "database.diskQuota.mb"
	DatabaseMaxCollectionsKey   = "database.max.collections"
	DatabaseForceDenyWritingKey = "database.force.deny.writing"

	// collection level load properties
	CollectionReplicaNumber  = "collection.replica.number"
	CollectionResourceGroups = "collection.resource_groups"
)
View Source
const (
	MmapEnabledKey           = "mmap.enabled"
	LazyLoadEnableKey        = "lazyload.enabled"
	PartitionKeyIsolationKey = "partitionkey.isolation"
)

common properties

View Source
const (
	PropertiesKey string = "properties"
	TraceIDKey    string = "uber-trace-id"
)
View Source
const (
	// LatestVerision is the magic number for watch latest revision
	LatestRevision = int64(-1)
)

Variables

Endian is type alias of binary.LittleEndian. Milvus uses little endian by default.

View Source
var ErrNodeIDNotMatch = errors.New("target node id not match")

ErrNodeIDNotMatch stands for the error that grpc target id and node session id not match.

View Source
var Version semver.Version

Version current version for session

Functions

func CollectionLevelReplicaNumber

func CollectionLevelReplicaNumber(kvs []*commonpb.KeyValuePair) (int64, error)

func CollectionLevelResourceGroups

func CollectionLevelResourceGroups(kvs []*commonpb.KeyValuePair) ([]string, error)

func DatabaseLevelReplicaNumber

func DatabaseLevelReplicaNumber(kvs []*commonpb.KeyValuePair) (int64, error)

func DatabaseLevelResourceGroups

func DatabaseLevelResourceGroups(kvs []*commonpb.KeyValuePair) ([]string, error)

func FieldHasMmapKey

func FieldHasMmapKey(schema *schemapb.CollectionSchema, fieldID int64) bool

func HasLazyload

func HasLazyload(props []*commonpb.KeyValuePair) bool

func IsCollectionLazyLoadEnabled

func IsCollectionLazyLoadEnabled(kvs ...*commonpb.KeyValuePair) bool

func IsFieldMmapEnabled

func IsFieldMmapEnabled(schema *schemapb.CollectionSchema, fieldID int64) bool

func IsIgnorableError

func IsIgnorableError(err error) bool

func IsMmapEnabled

func IsMmapEnabled(kvs ...*commonpb.KeyValuePair) bool

func IsPartitionKeyIsolationKvEnabled

func IsPartitionKeyIsolationKvEnabled(kvs ...*commonpb.KeyValuePair) (bool, error)

func IsPartitionKeyIsolationPropEnabled

func IsPartitionKeyIsolationPropEnabled(props map[string]string) (bool, error)

func IsSystemField

func IsSystemField(fieldID int64) bool

func MapEquals

func MapEquals(m1, m2 map[int64]int64) bool

func NewIgnorableError

func NewIgnorableError(err error) error

func WrapNodeIDNotMatchError

func WrapNodeIDNotMatchError(targetID, nodeID int64) error

WrapNodeIDNotMatchError wraps `ErrNodeIDNotMatch` with targetID and sessionID.

func WrapNodeIDNotMatchMsg

func WrapNodeIDNotMatchMsg(targetID, nodeID int64) string

WrapNodeIDNotMatchMsg fmt error msg with `ErrNodeIDNotMatch`, targetID and sessionID.

Types

type ByteSlice

type ByteSlice []byte

func CloneByteSlice

func CloneByteSlice(s ByteSlice) ByteSlice

func (ByteSlice) Clone

func (s ByteSlice) Clone() ByteSlice

func (ByteSlice) Equal

func (s ByteSlice) Equal(other ByteSlice) bool

type IgnorableError

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

func (*IgnorableError) Error

func (i *IgnorableError) Error() string

type Int64Tuple

type Int64Tuple struct {
	Key, Value int64
}

type KeyDataPairs

type KeyDataPairs []*commonpb.KeyDataPair

func CloneKeyDataPairs

func CloneKeyDataPairs(pairs KeyDataPairs) KeyDataPairs

func (KeyDataPairs) Clone

func (pairs KeyDataPairs) Clone() KeyDataPairs

func (KeyDataPairs) Equal

func (pairs KeyDataPairs) Equal(other KeyDataPairs) bool

func (KeyDataPairs) ToMap

func (pairs KeyDataPairs) ToMap() map[string][]byte

type KeyValuePairs

type KeyValuePairs []*commonpb.KeyValuePair

func CloneKeyValuePairs

func CloneKeyValuePairs(pairs KeyValuePairs) KeyValuePairs

func (KeyValuePairs) Clone

func (pairs KeyValuePairs) Clone() KeyValuePairs

func (KeyValuePairs) Equal

func (pairs KeyValuePairs) Equal(other KeyValuePairs) bool

func (KeyValuePairs) ToMap

func (pairs KeyValuePairs) ToMap() map[string]string

type Str2Str

type Str2Str map[string]string

func CloneStr2Str

func CloneStr2Str(m Str2Str) Str2Str

func (Str2Str) Clone

func (m Str2Str) Clone() Str2Str

func (Str2Str) Equal

func (m Str2Str) Equal(other Str2Str) bool

type StringList

type StringList []string

func CloneStringList

func CloneStringList(l StringList) StringList

func (StringList) Clone

func (l StringList) Clone() StringList

func (StringList) Equal

func (l StringList) Equal(other StringList) bool

Jump to

Keyboard shortcuts

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