model

package
v0.10.3-0...-54aaeda Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFieldsEqual

func CheckFieldsEqual(fieldsA, fieldsB []*Field) bool

func CheckPartitionsEqual

func CheckPartitionsEqual(partitionsA, partitionsB []*Partition) bool

func MarshalAliasModel

func MarshalAliasModel(alias *Alias) *pb.AliasInfo

func MarshalCollectionModel

func MarshalCollectionModel(coll *Collection) *pb.CollectionInfo

MarshalCollectionModel marshal only collection-related information. partitions, aliases and fields won't be marshaled. They should be written to newly path.

func MarshalCollectionModelWithOption

func MarshalCollectionModelWithOption(coll *Collection, opts ...Option) *pb.CollectionInfo

func MarshalCredentialModel

func MarshalCredentialModel(cred *Credential) *internalpb.CredentialInfo

func MarshalDatabaseModel

func MarshalDatabaseModel(db *Database) *pb.DatabaseInfo

func MarshalFieldModel

func MarshalFieldModel(field *Field) *schemapb.FieldSchema

func MarshalFieldModels

func MarshalFieldModels(fields []*Field) []*schemapb.FieldSchema

func MarshalFunctionModel

func MarshalFunctionModel(function *Function) *schemapb.FunctionSchema

func MarshalFunctionModels

func MarshalFunctionModels(functions []*Function) []*schemapb.FunctionSchema

func MarshalIndexModel

func MarshalIndexModel(index *Index) *indexpb.FieldIndex

func MarshalPartitionModel

func MarshalPartitionModel(partition *Partition) *pb.PartitionInfo

func MarshalSegmentIndexModel

func MarshalSegmentIndexModel(segIdx *SegmentIndex) *indexpb.SegmentIndex

Types

type Alias

type Alias struct {
	Name         string
	CollectionID int64
	CreatedTime  uint64
	State        pb.AliasState
	DbID         int64
}

func UnmarshalAliasModel

func UnmarshalAliasModel(info *pb.AliasInfo) *Alias

func (*Alias) Available

func (a *Alias) Available() bool

func (*Alias) Clone

func (a *Alias) Clone() *Alias

func (*Alias) Equal

func (a *Alias) Equal(other Alias) bool

type Collection

type Collection struct {
	TenantID             string
	DBID                 int64
	CollectionID         int64
	Partitions           []*Partition
	Name                 string
	Description          string
	AutoID               bool
	Fields               []*Field
	Functions            []*Function
	VirtualChannelNames  []string
	PhysicalChannelNames []string
	ShardsNum            int32
	StartPositions       []*commonpb.KeyDataPair
	CreateTime           uint64
	ConsistencyLevel     commonpb.ConsistencyLevel
	Aliases              []string // TODO: deprecate this.
	Properties           []*commonpb.KeyValuePair
	State                pb.CollectionState
	EnableDynamicField   bool
}

func UnmarshalCollectionModel

func UnmarshalCollectionModel(coll *pb.CollectionInfo) *Collection

func (*Collection) Available

func (c *Collection) Available() bool

func (*Collection) Clone

func (c *Collection) Clone() *Collection

func (*Collection) Equal

func (c *Collection) Equal(other Collection) bool

func (*Collection) GetPartitionNum

func (c *Collection) GetPartitionNum(filterUnavailable bool) int

type CollectionLoadInfo

type CollectionLoadInfo struct {
	CollectionID         int64
	PartitionIDs         []int64
	ReleasedPartitionIDs []int64
	LoadType             querypb.LoadType
	LoadPercentage       int64
	Status               querypb.LoadStatus
	ReplicaNumber        int32
	FieldIndexID         map[int64]int64
}

type Credential

type Credential struct {
	Username          string
	EncryptedPassword string
	Tenant            string
	IsSuper           bool
	Sha256Password    string
}

type Database

type Database struct {
	TenantID    string
	ID          int64
	Name        string
	State       pb.DatabaseState
	CreatedTime uint64
	Properties  []*commonpb.KeyValuePair
}

func NewDatabase

func NewDatabase(id int64, name string, state pb.DatabaseState, properties []*commonpb.KeyValuePair) *Database

func NewDefaultDatabase

func NewDefaultDatabase() *Database

func UnmarshalDatabaseModel

func UnmarshalDatabaseModel(info *pb.DatabaseInfo) *Database

func (*Database) Available

func (c *Database) Available() bool

func (*Database) Clone

func (c *Database) Clone() *Database

func (*Database) Equal

func (c *Database) Equal(other Database) bool

func (*Database) GetProperty

func (c *Database) GetProperty(key string) string

type Field

type Field struct {
	FieldID          int64
	Name             string
	IsPrimaryKey     bool
	Description      string
	DataType         schemapb.DataType
	TypeParams       []*commonpb.KeyValuePair
	IndexParams      []*commonpb.KeyValuePair
	AutoID           bool
	State            schemapb.FieldState
	IsDynamic        bool
	IsPartitionKey   bool // partition key mode, multi logic partitions share a physical partition
	IsClusteringKey  bool
	IsFunctionOutput bool
	DefaultValue     *schemapb.ValueField
	ElementType      schemapb.DataType
	Nullable         bool
}

func CloneFields

func CloneFields(fields []*Field) []*Field

func UnmarshalFieldModel

func UnmarshalFieldModel(fieldSchema *schemapb.FieldSchema) *Field

func UnmarshalFieldModels

func UnmarshalFieldModels(fieldSchemas []*schemapb.FieldSchema) []*Field

func (*Field) Available

func (f *Field) Available() bool

func (*Field) Clone

func (f *Field) Clone() *Field

func (*Field) Equal

func (f *Field) Equal(other Field) bool

type Function

type Function struct {
	Name        string
	ID          int64
	Description string

	Type schemapb.FunctionType

	InputFieldIDs   []int64
	InputFieldNames []string

	OutputFieldIDs   []int64
	OutputFieldNames []string

	Params []*commonpb.KeyValuePair
}

func CloneFunctions

func CloneFunctions(functions []*Function) []*Function

func UnmarshalFunctionModel

func UnmarshalFunctionModel(schema *schemapb.FunctionSchema) *Function

func UnmarshalFunctionModels

func UnmarshalFunctionModels(functions []*schemapb.FunctionSchema) []*Function

func (*Function) Clone

func (f *Function) Clone() *Function

func (*Function) Equal

func (f *Function) Equal(other Function) bool

type Index

type Index struct {
	TenantID        string
	CollectionID    int64
	FieldID         int64
	IndexID         int64
	IndexName       string
	IsDeleted       bool
	CreateTime      uint64
	TypeParams      []*commonpb.KeyValuePair
	IndexParams     []*commonpb.KeyValuePair
	IsAutoIndex     bool
	UserIndexParams []*commonpb.KeyValuePair
}

func CloneIndex

func CloneIndex(index *Index) *Index

func UnmarshalIndexModel

func UnmarshalIndexModel(indexInfo *indexpb.FieldIndex) *Index

type Option

type Option func(c *config)

func WithFields

func WithFields() Option

func WithPartitions

func WithPartitions() Option

type Partition

type Partition struct {
	PartitionID               int64
	PartitionName             string
	PartitionCreatedTimestamp uint64
	Extra                     map[string]string // deprecated.
	CollectionID              int64
	State                     pb.PartitionState
}

func ClonePartitions

func ClonePartitions(partitions []*Partition) []*Partition

func UnmarshalPartitionModel

func UnmarshalPartitionModel(info *pb.PartitionInfo) *Partition

func (*Partition) Available

func (p *Partition) Available() bool

func (*Partition) Clone

func (p *Partition) Clone() *Partition

func (*Partition) Equal

func (p *Partition) Equal(other Partition) bool

type PartitionLoadInfo

type PartitionLoadInfo struct {
	CollectionID   int64
	PartitionID    int64
	LoadType       querypb.LoadType
	LoadPercentage int64
	Status         querypb.LoadStatus
	ReplicaNumber  int32
	FieldIndexID   map[int64]int64
}

type Segment

type Segment struct {
	SegmentID           int64
	CollectionID        int64
	PartitionID         int64
	NumRows             int64
	BinLogs             []string
	MemSize             int64
	DmChannel           string
	CompactionFrom      []int64
	CreatedByCompaction bool
	SegmentState        commonpb.SegmentState
	// IndexInfos          []*SegmentIndex
	ReplicaIDs []int64
	NodeIDs    []int64
}

type SegmentIndex

type SegmentIndex struct {
	SegmentID      int64
	CollectionID   int64
	PartitionID    int64
	NumRows        int64
	IndexID        int64
	BuildID        int64
	NodeID         int64
	IndexVersion   int64
	IndexState     commonpb.IndexState
	FailReason     string
	IsDeleted      bool
	CreatedUTCTime uint64
	IndexFileKeys  []string
	IndexSize      uint64
	// deprecated
	WriteHandoff        bool
	CurrentIndexVersion int32
	IndexStoreVersion   int64
}

func CloneSegmentIndex

func CloneSegmentIndex(segIndex *SegmentIndex) *SegmentIndex

func UnmarshalSegmentIndexModel

func UnmarshalSegmentIndexModel(segIndex *indexpb.SegmentIndex) *SegmentIndex

Jump to

Keyboard shortcuts

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