Documentation ¶
Index ¶
- Constants
- Variables
- func CheckMsgType(got, expect commonpb.MsgType) error
- func CheckTimeTickLagExceeded(ctx context.Context, queryCoord types.QueryCoordClient, ...) error
- func DecodeMsgPositions(str string, msgPositions *[]*msgstream.MsgPosition) error
- func EncodeMsgPositions(msgPositions []*msgstream.MsgPosition) (string, error)
- func EqualKeyPairArray(p1 []*commonpb.KeyValuePair, p2 []*commonpb.KeyValuePair) bool
- func FormatCollectionKey(dbID int64, collectionName string) string
- func GetEarliestLimiter() *ratelimitutil.Limiter
- func GetInfLimiter(_ internalpb.RateType) *ratelimitutil.Limiter
- func Int64TupleMapToSlice(s map[int]common.Int64Tuple) []common.Int64Tuple
- func Int64TupleSliceToMap(s []common.Int64Tuple) map[int]common.Int64Tuple
- func NewSimpleStep(desc string, executeFunc func(ctx context.Context) ([]nestedStep, error)) nestedStep
- func SplitCollectionKey(key string) (dbID int64, collectionName string)
- type AlterCollectionStep
- type AlterDatabaseStep
- type BroadcastAlteredCollectionStep
- type Broker
- type Core
- func (c *Core) AllocID(ctx context.Context, in *rootcoordpb.AllocIDRequest) (*rootcoordpb.AllocIDResponse, error)
- func (c *Core) AllocTimestamp(ctx context.Context, in *rootcoordpb.AllocTimestampRequest) (*rootcoordpb.AllocTimestampResponse, error)
- func (c *Core) AlterAlias(ctx context.Context, in *milvuspb.AlterAliasRequest) (*commonpb.Status, error)
- func (c *Core) AlterCollection(ctx context.Context, in *milvuspb.AlterCollectionRequest) (*commonpb.Status, error)
- func (c *Core) AlterDatabase(ctx context.Context, in *rootcoordpb.AlterDatabaseRequest) (*commonpb.Status, error)
- func (c *Core) CheckHealth(ctx context.Context, in *milvuspb.CheckHealthRequest) (*milvuspb.CheckHealthResponse, error)
- func (c *Core) CreateAlias(ctx context.Context, in *milvuspb.CreateAliasRequest) (*commonpb.Status, error)
- func (c *Core) CreateCollection(ctx context.Context, in *milvuspb.CreateCollectionRequest) (*commonpb.Status, error)
- func (c *Core) CreateCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) (*commonpb.Status, error)
- func (c *Core) CreateDatabase(ctx context.Context, in *milvuspb.CreateDatabaseRequest) (*commonpb.Status, error)
- func (c *Core) CreatePartition(ctx context.Context, in *milvuspb.CreatePartitionRequest) (*commonpb.Status, error)
- func (c *Core) CreateRole(ctx context.Context, in *milvuspb.CreateRoleRequest) (*commonpb.Status, error)
- func (c *Core) DeleteCredential(ctx context.Context, in *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error)
- func (c *Core) DescribeAlias(ctx context.Context, in *milvuspb.DescribeAliasRequest) (*milvuspb.DescribeAliasResponse, error)
- func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)
- func (c *Core) DescribeCollectionInternal(ctx context.Context, in *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)
- func (c *Core) DescribeDatabase(ctx context.Context, req *rootcoordpb.DescribeDatabaseRequest) (*rootcoordpb.DescribeDatabaseResponse, error)
- func (c *Core) DropAlias(ctx context.Context, in *milvuspb.DropAliasRequest) (*commonpb.Status, error)
- func (c *Core) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRequest) (*commonpb.Status, error)
- func (c *Core) DropDatabase(ctx context.Context, in *milvuspb.DropDatabaseRequest) (*commonpb.Status, error)
- func (c *Core) DropPartition(ctx context.Context, in *milvuspb.DropPartitionRequest) (*commonpb.Status, error)
- func (c *Core) DropRole(ctx context.Context, in *milvuspb.DropRoleRequest) (*commonpb.Status, error)
- func (c *Core) ExpireCredCache(ctx context.Context, username string) error
- func (c *Core) ExpireMetaCache(ctx context.Context, dbName string, collNames []string, collectionID UniqueID, ...) error
- func (c *Core) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)
- func (c *Core) GetCredential(ctx context.Context, in *rootcoordpb.GetCredentialRequest) (*rootcoordpb.GetCredentialResponse, error)
- func (c *Core) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
- func (c *Core) GetPChannelInfo(ctx context.Context, in *rootcoordpb.GetPChannelInfoRequest) (*rootcoordpb.GetPChannelInfoResponse, error)
- func (c *Core) GetStateCode() commonpb.StateCode
- func (c *Core) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)
- func (c *Core) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error)
- func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error)
- func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error)
- func (c *Core) Init() error
- func (c *Core) InvalidateCollectionMetaCache(ctx context.Context, in *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error)
- func (c *Core) ListAliases(ctx context.Context, in *milvuspb.ListAliasesRequest) (*milvuspb.ListAliasesResponse, error)
- func (c *Core) ListCredUsers(ctx context.Context, in *milvuspb.ListCredUsersRequest) (*milvuspb.ListCredUsersResponse, error)
- func (c *Core) ListDatabases(ctx context.Context, in *milvuspb.ListDatabasesRequest) (*milvuspb.ListDatabasesResponse, error)
- func (c *Core) ListPolicy(ctx context.Context, in *internalpb.ListPolicyRequest) (*internalpb.ListPolicyResponse, error)
- func (c *Core) OperatePrivilege(ctx context.Context, in *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error)
- func (c *Core) OperateUserRole(ctx context.Context, in *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error)
- func (c *Core) Register() error
- func (c *Core) RenameCollection(ctx context.Context, req *milvuspb.RenameCollectionRequest) (*commonpb.Status, error)
- func (c *Core) SelectGrant(ctx context.Context, in *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error)
- func (c *Core) SelectRole(ctx context.Context, in *milvuspb.SelectRoleRequest) (*milvuspb.SelectRoleResponse, error)
- func (c *Core) SelectUser(ctx context.Context, in *milvuspb.SelectUserRequest) (*milvuspb.SelectUserResponse, error)
- func (c *Core) SetAddress(address string)
- func (c *Core) SetDataCoordClient(s types.DataCoordClient) error
- func (c *Core) SetEtcdClient(etcdClient *clientv3.Client)
- func (c *Core) SetProxyCreator(...)
- func (c *Core) SetQueryCoordClient(s types.QueryCoordClient) error
- func (c *Core) SetTiKVClient(client *txnkv.Client)
- func (c *Core) ShowCollections(ctx context.Context, in *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error)
- func (c *Core) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error)
- func (c *Core) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)
- func (c *Core) ShowPartitionsInternal(ctx context.Context, in *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)
- func (c *Core) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentsRequest) (*milvuspb.ShowSegmentsResponse, error)
- func (c *Core) Start() error
- func (c *Core) Stop() error
- func (c *Core) UpdateChannelTimeTick(ctx context.Context, in *internalpb.ChannelTimeTickMsg) (*commonpb.Status, error)
- func (c *Core) UpdateCredCache(ctx context.Context, credInfo *internalpb.CredentialInfo) error
- func (c *Core) UpdateCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) (*commonpb.Status, error)
- func (c *Core) UpdateStateCode(code commonpb.StateCode)
- type DdlTsLockManager
- type GarbageCollector
- type IMetaTable
- type IScheduler
- type Limit
- type MetaTable
- func (mt *MetaTable) AddCollection(ctx context.Context, coll *model.Collection) error
- func (mt *MetaTable) AddCredential(credInfo *internalpb.CredentialInfo) error
- func (mt *MetaTable) AddPartition(ctx context.Context, partition *model.Partition) error
- func (mt *MetaTable) AlterAlias(ctx context.Context, dbName string, alias string, collectionName string, ...) error
- func (mt *MetaTable) AlterCollection(ctx context.Context, oldColl *model.Collection, newColl *model.Collection, ...) error
- func (mt *MetaTable) AlterCredential(credInfo *internalpb.CredentialInfo) error
- func (mt *MetaTable) AlterDatabase(ctx context.Context, oldDB *model.Database, newDB *model.Database, ...) error
- func (mt *MetaTable) ChangeCollectionState(ctx context.Context, collectionID UniqueID, state pb.CollectionState, ...) error
- func (mt *MetaTable) ChangePartitionState(ctx context.Context, collectionID UniqueID, partitionID UniqueID, ...) error
- func (mt *MetaTable) CreateAlias(ctx context.Context, dbName string, alias string, collectionName string, ...) error
- func (mt *MetaTable) CreateDatabase(ctx context.Context, db *model.Database, ts typeutil.Timestamp) error
- func (mt *MetaTable) CreateRole(tenant string, entity *milvuspb.RoleEntity) error
- func (mt *MetaTable) DeleteCredential(username string) error
- func (mt *MetaTable) DescribeAlias(ctx context.Context, dbName string, alias string, ts Timestamp) (string, error)
- func (mt *MetaTable) DropAlias(ctx context.Context, dbName string, alias string, ts Timestamp) error
- func (mt *MetaTable) DropDatabase(ctx context.Context, dbName string, ts typeutil.Timestamp) error
- func (mt *MetaTable) DropGrant(tenant string, role *milvuspb.RoleEntity) error
- func (mt *MetaTable) DropRole(tenant string, roleName string) error
- func (mt *MetaTable) GetCollectionByID(ctx context.Context, dbName string, collectionID UniqueID, ts Timestamp, ...) (*model.Collection, error)
- func (mt *MetaTable) GetCollectionByIDWithMaxTs(ctx context.Context, collectionID UniqueID) (*model.Collection, error)
- func (mt *MetaTable) GetCollectionByName(ctx context.Context, dbName string, collectionName string, ts Timestamp) (*model.Collection, error)
- func (mt *MetaTable) GetCollectionVirtualChannels(colID int64) []string
- func (mt *MetaTable) GetCredential(username string) (*internalpb.CredentialInfo, error)
- func (mt *MetaTable) GetDatabaseByID(ctx context.Context, dbID int64, ts Timestamp) (*model.Database, error)
- func (mt *MetaTable) GetDatabaseByName(ctx context.Context, dbName string, ts Timestamp) (*model.Database, error)
- func (mt *MetaTable) GetPChannelInfo(pchannel string) *rootcoordpb.GetPChannelInfoResponse
- func (mt *MetaTable) IsAlias(db, name string) bool
- func (mt *MetaTable) ListAliases(ctx context.Context, dbName string, collectionName string, ts Timestamp) ([]string, error)
- func (mt *MetaTable) ListAliasesByID(collID UniqueID) []string
- func (mt *MetaTable) ListAllAvailCollections(ctx context.Context) map[int64][]int64
- func (mt *MetaTable) ListCollectionPhysicalChannels() map[typeutil.UniqueID][]string
- func (mt *MetaTable) ListCollections(ctx context.Context, dbName string, ts Timestamp, onlyAvail bool) ([]*model.Collection, error)
- func (mt *MetaTable) ListCredentialUsernames() (*milvuspb.ListCredUsersResponse, error)
- func (mt *MetaTable) ListDatabases(ctx context.Context, ts typeutil.Timestamp) ([]*model.Database, error)
- func (mt *MetaTable) ListPolicy(tenant string) ([]string, error)
- func (mt *MetaTable) ListUserRole(tenant string) ([]string, error)
- func (mt *MetaTable) OperatePrivilege(tenant string, entity *milvuspb.GrantEntity, ...) error
- func (mt *MetaTable) OperateUserRole(tenant string, userEntity *milvuspb.UserEntity, ...) error
- func (mt *MetaTable) RemoveCollection(ctx context.Context, collectionID UniqueID, ts Timestamp) error
- func (mt *MetaTable) RemovePartition(ctx context.Context, dbID int64, collectionID UniqueID, partitionID UniqueID, ...) error
- func (mt *MetaTable) RenameCollection(ctx context.Context, dbName string, oldName string, newDBName string, ...) error
- func (mt *MetaTable) SelectGrant(tenant string, entity *milvuspb.GrantEntity) ([]*milvuspb.GrantEntity, error)
- func (mt *MetaTable) SelectRole(tenant string, entity *milvuspb.RoleEntity, includeUserInfo bool) ([]*milvuspb.RoleResult, error)
- func (mt *MetaTable) SelectUser(tenant string, entity *milvuspb.UserEntity, includeRoleInfo bool) ([]*milvuspb.UserResult, error)
- type Opt
- type QuotaCenter
- type RateAllocateStrategy
- type ServerBroker
- func (b *ServerBroker) BroadcastAlteredCollection(ctx context.Context, req *milvuspb.AlterCollectionRequest) error
- func (b *ServerBroker) DropCollectionIndex(ctx context.Context, collID UniqueID, partIDs []UniqueID) error
- func (b *ServerBroker) GcConfirm(ctx context.Context, collectionID, partitionID UniqueID) bool
- func (b *ServerBroker) GetQuerySegmentInfo(ctx context.Context, collectionID int64, segIDs []int64) (retResp *querypb.GetSegmentInfoResponse, retErr error)
- func (b *ServerBroker) GetSegmentIndexState(ctx context.Context, collID UniqueID, indexName string, segIDs []UniqueID) ([]*indexpb.SegmentIndexState, error)
- func (b *ServerBroker) GetSegmentStates(ctx context.Context, req *datapb.GetSegmentStatesRequest) (*datapb.GetSegmentStatesResponse, error)
- func (b *ServerBroker) ReleaseCollection(ctx context.Context, collectionID UniqueID) error
- func (b *ServerBroker) ReleasePartitions(ctx context.Context, collectionID UniqueID, partitionIDs ...UniqueID) error
- func (b *ServerBroker) SyncNewCreatedPartition(ctx context.Context, collectionID UniqueID, partitionID UniqueID) error
- func (b *ServerBroker) UnwatchChannels(ctx context.Context, info *watchInfo) error
- func (b *ServerBroker) WatchChannels(ctx context.Context, info *watchInfo) error
- type StepExecutor
- type TimeTravelRequest
- type Timestamp
- type UniqueID
Constants ¶
const ( // StartOfUserFieldID id of user defined field begin from here StartOfUserFieldID = common.StartOfUserFieldID // RowIDField id of row ID field RowIDField = common.RowIDField // TimeStampField id of timestamp field TimeStampField = common.TimeStampField // RowIDFieldName name of row ID field RowIDFieldName = common.RowIDFieldName // TimeStampFieldName name of the timestamp field TimeStampFieldName = common.TimeStampFieldName // MetaFieldName name of the dynamic schema field MetaFieldName = common.MetaFieldName )
const ( GetMetricsTimeout = 10 * time.Second SetRatesTimeout = 10 * time.Second )
const Inf = ratelimitutil.Inf
const InvalidCollectionID = UniqueID(0)
Variables ¶
var DefaultRateAllocateStrategy = Average
var Params *paramtable.ComponentParam = paramtable.Get()
Functions ¶
func CheckMsgType ¶
func CheckTimeTickLagExceeded ¶
func CheckTimeTickLagExceeded(ctx context.Context, queryCoord types.QueryCoordClient, dataCoord types.DataCoordClient, maxDelay time.Duration) error
func DecodeMsgPositions ¶
func DecodeMsgPositions(str string, msgPositions *[]*msgstream.MsgPosition) error
DecodeMsgPositions deserialize string to []*MsgPosition
func EncodeMsgPositions ¶
func EncodeMsgPositions(msgPositions []*msgstream.MsgPosition) (string, error)
EncodeMsgPositions serialize []*MsgPosition into string
func EqualKeyPairArray ¶
func EqualKeyPairArray(p1 []*commonpb.KeyValuePair, p2 []*commonpb.KeyValuePair) bool
EqualKeyPairArray check whether 2 KeyValuePairs are equal
func FormatCollectionKey ¶
func GetEarliestLimiter ¶
func GetEarliestLimiter() *ratelimitutil.Limiter
func GetInfLimiter ¶
func GetInfLimiter(_ internalpb.RateType) *ratelimitutil.Limiter
func Int64TupleMapToSlice ¶
func Int64TupleMapToSlice(s map[int]common.Int64Tuple) []common.Int64Tuple
func Int64TupleSliceToMap ¶
func Int64TupleSliceToMap(s []common.Int64Tuple) map[int]common.Int64Tuple
func NewSimpleStep ¶
func SplitCollectionKey ¶
Types ¶
type AlterCollectionStep ¶
type AlterCollectionStep struct {
// contains filtered or unexported fields
}
func (*AlterCollectionStep) Desc ¶
func (a *AlterCollectionStep) Desc() string
type AlterDatabaseStep ¶
type AlterDatabaseStep struct {
// contains filtered or unexported fields
}
func (*AlterDatabaseStep) Desc ¶
func (a *AlterDatabaseStep) Desc() string
type BroadcastAlteredCollectionStep ¶
type BroadcastAlteredCollectionStep struct {
// contains filtered or unexported fields
}
func (*BroadcastAlteredCollectionStep) Desc ¶
func (b *BroadcastAlteredCollectionStep) Desc() string
type Broker ¶
type Broker interface { ReleaseCollection(ctx context.Context, collectionID UniqueID) error ReleasePartitions(ctx context.Context, collectionID UniqueID, partitionIDs ...UniqueID) error SyncNewCreatedPartition(ctx context.Context, collectionID UniqueID, partitionID UniqueID) error GetQuerySegmentInfo(ctx context.Context, collectionID int64, segIDs []int64) (retResp *querypb.GetSegmentInfoResponse, retErr error) WatchChannels(ctx context.Context, info *watchInfo) error UnwatchChannels(ctx context.Context, info *watchInfo) error GetSegmentStates(context.Context, *datapb.GetSegmentStatesRequest) (*datapb.GetSegmentStatesResponse, error) GcConfirm(ctx context.Context, collectionID, partitionID UniqueID) bool DropCollectionIndex(ctx context.Context, collID UniqueID, partIDs []UniqueID) error // notify observer to clean their meta cache BroadcastAlteredCollection(ctx context.Context, req *milvuspb.AlterCollectionRequest) error }
Broker communicates with other components.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core root coordinator core
func (*Core) AllocID ¶
func (c *Core) AllocID(ctx context.Context, in *rootcoordpb.AllocIDRequest) (*rootcoordpb.AllocIDResponse, error)
AllocID alloc ids
func (*Core) AllocTimestamp ¶
func (c *Core) AllocTimestamp(ctx context.Context, in *rootcoordpb.AllocTimestampRequest) (*rootcoordpb.AllocTimestampResponse, error)
AllocTimestamp alloc timestamp
func (*Core) AlterAlias ¶
func (c *Core) AlterAlias(ctx context.Context, in *milvuspb.AlterAliasRequest) (*commonpb.Status, error)
AlterAlias alter collection alias
func (*Core) AlterCollection ¶
func (*Core) AlterDatabase ¶
func (c *Core) AlterDatabase(ctx context.Context, in *rootcoordpb.AlterDatabaseRequest) (*commonpb.Status, error)
func (*Core) CheckHealth ¶
func (c *Core) CheckHealth(ctx context.Context, in *milvuspb.CheckHealthRequest) (*milvuspb.CheckHealthResponse, error)
func (*Core) CreateAlias ¶
func (c *Core) CreateAlias(ctx context.Context, in *milvuspb.CreateAliasRequest) (*commonpb.Status, error)
CreateAlias create collection alias
func (*Core) CreateCollection ¶
func (c *Core) CreateCollection(ctx context.Context, in *milvuspb.CreateCollectionRequest) (*commonpb.Status, error)
CreateCollection create collection
func (*Core) CreateCredential ¶
func (c *Core) CreateCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) (*commonpb.Status, error)
CreateCredential create new user and password
- decode ciphertext password to raw password
- encrypt raw password
- save in to etcd
func (*Core) CreateDatabase ¶
func (*Core) CreatePartition ¶
func (c *Core) CreatePartition(ctx context.Context, in *milvuspb.CreatePartitionRequest) (*commonpb.Status, error)
CreatePartition create partition
func (*Core) CreateRole ¶
func (c *Core) CreateRole(ctx context.Context, in *milvuspb.CreateRoleRequest) (*commonpb.Status, error)
CreateRole create role - check the node health - check if the role is existed - check if the role num has reached the limit - create the role by the meta api
func (*Core) DeleteCredential ¶
func (c *Core) DeleteCredential(ctx context.Context, in *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error)
DeleteCredential delete a user
func (*Core) DescribeAlias ¶
func (c *Core) DescribeAlias(ctx context.Context, in *milvuspb.DescribeAliasRequest) (*milvuspb.DescribeAliasResponse, error)
DescribeAlias describe collection alias
func (*Core) DescribeCollection ¶
func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)
DescribeCollection return collection info
func (*Core) DescribeCollectionInternal ¶
func (c *Core) DescribeCollectionInternal(ctx context.Context, in *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)
DescribeCollectionInternal same to DescribeCollection, but will return unavailable collections and only used in internal RPC. When query cluster tried to do recovery, it'll be healthy until all collections' targets were recovered, so during this time, releasing request generated by rootcoord's recovery won't succeed. So in theory, rootcoord goes to be healthy, querycoord recovers all collections' targets, and then querycoord serves the releasing request sent by rootcoord, eventually, the dropping collections will be released.
func (*Core) DescribeDatabase ¶
func (c *Core) DescribeDatabase(ctx context.Context, req *rootcoordpb.DescribeDatabaseRequest) (*rootcoordpb.DescribeDatabaseResponse, error)
func (*Core) DropAlias ¶
func (c *Core) DropAlias(ctx context.Context, in *milvuspb.DropAliasRequest) (*commonpb.Status, error)
DropAlias drop collection alias
func (*Core) DropCollection ¶
func (c *Core) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRequest) (*commonpb.Status, error)
DropCollection drop collection
func (*Core) DropDatabase ¶
func (*Core) DropPartition ¶
func (c *Core) DropPartition(ctx context.Context, in *milvuspb.DropPartitionRequest) (*commonpb.Status, error)
DropPartition drop partition
func (*Core) DropRole ¶
func (c *Core) DropRole(ctx context.Context, in *milvuspb.DropRoleRequest) (*commonpb.Status, error)
DropRole drop role - check the node health - check if the role name is existed - check if the role has some grant info - get all role mapping of this role - drop these role mappings - drop the role by the meta api
func (*Core) ExpireCredCache ¶
ExpireCredCache will call invalidate credential cache
func (*Core) ExpireMetaCache ¶
func (c *Core) ExpireMetaCache(ctx context.Context, dbName string, collNames []string, collectionID UniqueID, partitionName string, ts typeutil.Timestamp, opts ...proxyutil.ExpireCacheOpt) error
ExpireMetaCache will call invalidate collection meta cache
func (*Core) GetComponentStates ¶
func (c *Core) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)
GetComponentStates get states of components
func (*Core) GetCredential ¶
func (c *Core) GetCredential(ctx context.Context, in *rootcoordpb.GetCredentialRequest) (*rootcoordpb.GetCredentialResponse, error)
GetCredential get credential by username
func (*Core) GetMetrics ¶
func (c *Core) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
GetMetrics get metrics
func (*Core) GetPChannelInfo ¶
func (c *Core) GetPChannelInfo(ctx context.Context, in *rootcoordpb.GetPChannelInfoRequest) (*rootcoordpb.GetPChannelInfoResponse, error)
GetPChannelInfo get pchannel info.
func (*Core) GetStateCode ¶
func (*Core) GetStatisticsChannel ¶
func (c *Core) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)
GetStatisticsChannel get statistics channel name
func (*Core) GetTimeTickChannel ¶
func (c *Core) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error)
GetTimeTickChannel get timetick channel name
func (*Core) HasCollection ¶
func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error)
HasCollection check collection existence
func (*Core) HasPartition ¶
func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error)
HasPartition check partition existence
func (*Core) InvalidateCollectionMetaCache ¶
func (c *Core) InvalidateCollectionMetaCache(ctx context.Context, in *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error)
InvalidateCollectionMetaCache notifies RootCoord to release the collection cache in Proxies.
func (*Core) ListAliases ¶
func (c *Core) ListAliases(ctx context.Context, in *milvuspb.ListAliasesRequest) (*milvuspb.ListAliasesResponse, error)
ListAliases list aliases
func (*Core) ListCredUsers ¶
func (c *Core) ListCredUsers(ctx context.Context, in *milvuspb.ListCredUsersRequest) (*milvuspb.ListCredUsersResponse, error)
ListCredUsers list all usernames
func (*Core) ListDatabases ¶
func (c *Core) ListDatabases(ctx context.Context, in *milvuspb.ListDatabasesRequest) (*milvuspb.ListDatabasesResponse, error)
func (*Core) ListPolicy ¶
func (c *Core) ListPolicy(ctx context.Context, in *internalpb.ListPolicyRequest) (*internalpb.ListPolicyResponse, error)
func (*Core) OperatePrivilege ¶
func (c *Core) OperatePrivilege(ctx context.Context, in *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error)
OperatePrivilege operate the privilege, including grant and revoke - check the node health - check if the operating type is valid - check if the entity is nil - check if the params, including the resource entity, the principal entity, the grantor entity, is valid - operate the privilege by the meta api - update the policy cache
func (*Core) OperateUserRole ¶
func (c *Core) OperateUserRole(ctx context.Context, in *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error)
OperateUserRole operate the relationship between a user and a role - check the node health - check if the role is valid - check if the user is valid - operate the user-role by the meta api - update the policy cache
func (*Core) RenameCollection ¶
func (*Core) SelectGrant ¶
func (c *Core) SelectGrant(ctx context.Context, in *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error)
SelectGrant select grant - check the node health - check if the principal entity is valid - check if the resource entity which is provided by the user is valid - select grant by the meta api
func (*Core) SelectRole ¶
func (c *Core) SelectRole(ctx context.Context, in *milvuspb.SelectRoleRequest) (*milvuspb.SelectRoleResponse, error)
SelectRole select role - check the node health - check if the role is valid when this param is provided - select role by the meta api
func (*Core) SelectUser ¶
func (c *Core) SelectUser(ctx context.Context, in *milvuspb.SelectUserRequest) (*milvuspb.SelectUserResponse, error)
SelectUser select user - check the node health - check if the user is valid when this param is provided - select user by the meta api
func (*Core) SetAddress ¶
func (*Core) SetDataCoordClient ¶
func (c *Core) SetDataCoordClient(s types.DataCoordClient) error
func (*Core) SetEtcdClient ¶
SetEtcdClient sets the etcdCli of Core
func (*Core) SetProxyCreator ¶
func (*Core) SetQueryCoordClient ¶
func (c *Core) SetQueryCoordClient(s types.QueryCoordClient) error
func (*Core) SetTiKVClient ¶
SetTiKVClient sets the tikvCli of Core
func (*Core) ShowCollections ¶
func (c *Core) ShowCollections(ctx context.Context, in *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error)
ShowCollections list all collection names
func (*Core) ShowConfigurations ¶
func (c *Core) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error)
ShowConfigurations returns the configurations of RootCoord matching req.Pattern
func (*Core) ShowPartitions ¶
func (c *Core) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)
ShowPartitions list all partition names
func (*Core) ShowPartitionsInternal ¶
func (c *Core) ShowPartitionsInternal(ctx context.Context, in *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)
ShowPartitionsInternal same to ShowPartitions, only used in internal RPC.
func (*Core) ShowSegments ¶
func (c *Core) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentsRequest) (*milvuspb.ShowSegmentsResponse, error)
ShowSegments list all segments
func (*Core) UpdateChannelTimeTick ¶
func (c *Core) UpdateChannelTimeTick(ctx context.Context, in *internalpb.ChannelTimeTickMsg) (*commonpb.Status, error)
UpdateChannelTimeTick used to handle ChannelTimeTickMsg
func (*Core) UpdateCredCache ¶
func (c *Core) UpdateCredCache(ctx context.Context, credInfo *internalpb.CredentialInfo) error
UpdateCredCache will call update credential cache
func (*Core) UpdateCredential ¶
func (c *Core) UpdateCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) (*commonpb.Status, error)
UpdateCredential update password for a user
func (*Core) UpdateStateCode ¶
UpdateStateCode update state code
type DdlTsLockManager ¶
type GarbageCollector ¶
type GarbageCollector interface { ReDropCollection(collMeta *model.Collection, ts Timestamp) RemoveCreatingCollection(collMeta *model.Collection) ReDropPartition(dbID int64, pChannels, vchannels []string, partition *model.Partition, ts Timestamp) RemoveCreatingPartition(dbID int64, partition *model.Partition, ts Timestamp) GcCollectionData(ctx context.Context, coll *model.Collection) (ddlTs Timestamp, err error) GcPartitionData(ctx context.Context, pChannels, vchannels []string, partition *model.Partition) (ddlTs Timestamp, err error) }
type IMetaTable ¶
type IMetaTable interface { GetDatabaseByID(ctx context.Context, dbID int64, ts Timestamp) (*model.Database, error) GetDatabaseByName(ctx context.Context, dbName string, ts Timestamp) (*model.Database, error) CreateDatabase(ctx context.Context, db *model.Database, ts typeutil.Timestamp) error DropDatabase(ctx context.Context, dbName string, ts typeutil.Timestamp) error ListDatabases(ctx context.Context, ts typeutil.Timestamp) ([]*model.Database, error) AlterDatabase(ctx context.Context, oldDB *model.Database, newDB *model.Database, ts typeutil.Timestamp) error AddCollection(ctx context.Context, coll *model.Collection) error ChangeCollectionState(ctx context.Context, collectionID UniqueID, state pb.CollectionState, ts Timestamp) error RemoveCollection(ctx context.Context, collectionID UniqueID, ts Timestamp) error GetCollectionByName(ctx context.Context, dbName string, collectionName string, ts Timestamp) (*model.Collection, error) GetCollectionByID(ctx context.Context, dbName string, collectionID UniqueID, ts Timestamp, allowUnavailable bool) (*model.Collection, error) GetCollectionByIDWithMaxTs(ctx context.Context, collectionID UniqueID) (*model.Collection, error) ListCollections(ctx context.Context, dbName string, ts Timestamp, onlyAvail bool) ([]*model.Collection, error) ListAllAvailCollections(ctx context.Context) map[int64][]int64 ListCollectionPhysicalChannels() map[typeutil.UniqueID][]string GetCollectionVirtualChannels(colID int64) []string GetPChannelInfo(pchannel string) *rootcoordpb.GetPChannelInfoResponse AddPartition(ctx context.Context, partition *model.Partition) error ChangePartitionState(ctx context.Context, collectionID UniqueID, partitionID UniqueID, state pb.PartitionState, ts Timestamp) error RemovePartition(ctx context.Context, dbID int64, collectionID UniqueID, partitionID UniqueID, ts Timestamp) error CreateAlias(ctx context.Context, dbName string, alias string, collectionName string, ts Timestamp) error DropAlias(ctx context.Context, dbName string, alias string, ts Timestamp) error AlterAlias(ctx context.Context, dbName string, alias string, collectionName string, ts Timestamp) error DescribeAlias(ctx context.Context, dbName string, alias string, ts Timestamp) (string, error) ListAliases(ctx context.Context, dbName string, collectionName string, ts Timestamp) ([]string, error) AlterCollection(ctx context.Context, oldColl *model.Collection, newColl *model.Collection, ts Timestamp) error RenameCollection(ctx context.Context, dbName string, oldName string, newDBName string, newName string, ts Timestamp) error // TODO: it'll be a big cost if we handle the time travel logic, since we should always list all aliases in catalog. IsAlias(db, name string) bool ListAliasesByID(collID UniqueID) []string // TODO: better to accept ctx. AddCredential(credInfo *internalpb.CredentialInfo) error GetCredential(username string) (*internalpb.CredentialInfo, error) DeleteCredential(username string) error AlterCredential(credInfo *internalpb.CredentialInfo) error ListCredentialUsernames() (*milvuspb.ListCredUsersResponse, error) // TODO: better to accept ctx. CreateRole(tenant string, entity *milvuspb.RoleEntity) error DropRole(tenant string, roleName string) error OperateUserRole(tenant string, userEntity *milvuspb.UserEntity, roleEntity *milvuspb.RoleEntity, operateType milvuspb.OperateUserRoleType) error SelectRole(tenant string, entity *milvuspb.RoleEntity, includeUserInfo bool) ([]*milvuspb.RoleResult, error) SelectUser(tenant string, entity *milvuspb.UserEntity, includeRoleInfo bool) ([]*milvuspb.UserResult, error) OperatePrivilege(tenant string, entity *milvuspb.GrantEntity, operateType milvuspb.OperatePrivilegeType) error SelectGrant(tenant string, entity *milvuspb.GrantEntity) ([]*milvuspb.GrantEntity, error) DropGrant(tenant string, role *milvuspb.RoleEntity) error ListPolicy(tenant string) ([]string, error) ListUserRole(tenant string) ([]string, error) }
type IScheduler ¶
type Limit ¶
type Limit = ratelimitutil.Limit
type MetaTable ¶
type MetaTable struct {
// contains filtered or unexported fields
}
MetaTable is a persistent meta set of all databases, collections and partitions.
func NewMetaTable ¶
func NewMetaTable(ctx context.Context, catalog metastore.RootCoordCatalog, tsoAllocator tso.Allocator) (*MetaTable, error)
NewMetaTable creates a new MetaTable with specified catalog and allocator.
func (*MetaTable) AddCollection ¶
func (*MetaTable) AddCredential ¶
func (mt *MetaTable) AddCredential(credInfo *internalpb.CredentialInfo) error
AddCredential add credential
func (*MetaTable) AddPartition ¶
func (*MetaTable) AlterAlias ¶
func (*MetaTable) AlterCollection ¶
func (mt *MetaTable) AlterCollection(ctx context.Context, oldColl *model.Collection, newColl *model.Collection, ts Timestamp) error
func (*MetaTable) AlterCredential ¶
func (mt *MetaTable) AlterCredential(credInfo *internalpb.CredentialInfo) error
AlterCredential update credential
func (*MetaTable) AlterDatabase ¶
func (*MetaTable) ChangeCollectionState ¶
func (*MetaTable) ChangePartitionState ¶
func (*MetaTable) CreateAlias ¶
func (*MetaTable) CreateDatabase ¶
func (*MetaTable) CreateRole ¶
func (mt *MetaTable) CreateRole(tenant string, entity *milvuspb.RoleEntity) error
CreateRole create role
func (*MetaTable) DeleteCredential ¶
DeleteCredential delete credential
func (*MetaTable) DescribeAlias ¶
func (*MetaTable) DropDatabase ¶
func (*MetaTable) DropGrant ¶
func (mt *MetaTable) DropGrant(tenant string, role *milvuspb.RoleEntity) error
func (*MetaTable) GetCollectionByID ¶
func (*MetaTable) GetCollectionByIDWithMaxTs ¶
func (mt *MetaTable) GetCollectionByIDWithMaxTs(ctx context.Context, collectionID UniqueID) (*model.Collection, error)
GetCollectionByIDWithMaxTs get collection, dbName can be ignored if ts is max timestamps
func (*MetaTable) GetCollectionByName ¶
func (*MetaTable) GetCollectionVirtualChannels ¶
GetCollectionVirtualChannels returns virtual channels of a given collection.
func (*MetaTable) GetCredential ¶
func (mt *MetaTable) GetCredential(username string) (*internalpb.CredentialInfo, error)
GetCredential get credential by username
func (*MetaTable) GetDatabaseByID ¶
func (*MetaTable) GetDatabaseByName ¶
func (*MetaTable) GetPChannelInfo ¶
func (mt *MetaTable) GetPChannelInfo(pchannel string) *rootcoordpb.GetPChannelInfoResponse
GetPChannelInfo returns infos on pchannel.
func (*MetaTable) ListAliases ¶
func (*MetaTable) ListAliasesByID ¶
func (*MetaTable) ListAllAvailCollections ¶
func (*MetaTable) ListCollectionPhysicalChannels ¶
ListCollectionPhysicalChannels list physical channels of all collections.
func (*MetaTable) ListCollections ¶
func (*MetaTable) ListCredentialUsernames ¶
func (mt *MetaTable) ListCredentialUsernames() (*milvuspb.ListCredUsersResponse, error)
ListCredentialUsernames list credential usernames
func (*MetaTable) ListDatabases ¶
func (*MetaTable) OperatePrivilege ¶
func (mt *MetaTable) OperatePrivilege(tenant string, entity *milvuspb.GrantEntity, operateType milvuspb.OperatePrivilegeType) error
OperatePrivilege grant or revoke privilege by setting the operateType param
func (*MetaTable) OperateUserRole ¶
func (mt *MetaTable) OperateUserRole(tenant string, userEntity *milvuspb.UserEntity, roleEntity *milvuspb.RoleEntity, operateType milvuspb.OperateUserRoleType) error
OperateUserRole operate the relationship between a user and a role, including adding a user to a role and removing a user from a role
func (*MetaTable) RemoveCollection ¶
func (*MetaTable) RemovePartition ¶
func (*MetaTable) RenameCollection ¶
func (*MetaTable) SelectGrant ¶
func (mt *MetaTable) SelectGrant(tenant string, entity *milvuspb.GrantEntity) ([]*milvuspb.GrantEntity, error)
SelectGrant select grant The principal entity MUST be not empty in the grant entity The resource entity and the resource name are optional, and the two params should be not empty together when you select some grants about the resource kind.
func (*MetaTable) SelectRole ¶
func (mt *MetaTable) SelectRole(tenant string, entity *milvuspb.RoleEntity, includeUserInfo bool) ([]*milvuspb.RoleResult, error)
SelectRole select role. Enter the role condition by the entity param. And this param is nil, which means selecting all roles. Get all users that are added to the role by setting the includeUserInfo param to true.
func (*MetaTable) SelectUser ¶
func (mt *MetaTable) SelectUser(tenant string, entity *milvuspb.UserEntity, includeRoleInfo bool) ([]*milvuspb.UserResult, error)
SelectUser select user. Enter the user condition by the entity param. And this param is nil, which means selecting all users. Get all roles that are added the user to by setting the includeRoleInfo param to true.
type QuotaCenter ¶
type QuotaCenter struct {
// contains filtered or unexported fields
}
QuotaCenter manages the quota and limitations of the whole cluster, it receives metrics info from DataNodes, QueryNodes and Proxies, and notifies Proxies to limit rate of requests from clients or reject all requests when the cluster met resources issues. Limitations:
- DML throughput limitation;
- DDL, DQL qps/rps limitation;
Protections:
- TT protection -> dqlRate = maxDQLRate * (maxDelay - ttDelay) / maxDelay
- Memory protection -> dmlRate = maxDMLRate * (highMem - curMem) / (highMem - lowMem)
- Disk quota protection -> force deny writing if exceeded
- DQL Queue length protection -> dqlRate = curDQLRate * CoolOffSpeed
- DQL queue latency protection -> dqlRate = curDQLRate * CoolOffSpeed
- Search result protection -> searchRate = curSearchRate * CoolOffSpeed
- GrowingSegsSize protection -> dmlRate = maxDMLRate * (high - cur) / (high - low)
If necessary, user can also manually force to deny RW requests.
func NewQuotaCenter ¶
func NewQuotaCenter(proxies proxyutil.ProxyClientManagerInterface, queryCoord types.QueryCoordClient, dataCoord types.DataCoordClient, tsoAllocator tso.Allocator, meta IMetaTable, ) *QuotaCenter
NewQuotaCenter returns a new QuotaCenter.
func (*QuotaCenter) Start ¶
func (q *QuotaCenter) Start()
type RateAllocateStrategy ¶
type RateAllocateStrategy int32
const ( Average RateAllocateStrategy = 0 ByRateWeight RateAllocateStrategy = 1 )
type ServerBroker ¶
type ServerBroker struct {
// contains filtered or unexported fields
}
func (*ServerBroker) BroadcastAlteredCollection ¶
func (b *ServerBroker) BroadcastAlteredCollection(ctx context.Context, req *milvuspb.AlterCollectionRequest) error
func (*ServerBroker) DropCollectionIndex ¶
func (*ServerBroker) GcConfirm ¶
func (b *ServerBroker) GcConfirm(ctx context.Context, collectionID, partitionID UniqueID) bool
func (*ServerBroker) GetQuerySegmentInfo ¶
func (b *ServerBroker) GetQuerySegmentInfo(ctx context.Context, collectionID int64, segIDs []int64) (retResp *querypb.GetSegmentInfoResponse, retErr error)
func (*ServerBroker) GetSegmentIndexState ¶
func (b *ServerBroker) GetSegmentIndexState(ctx context.Context, collID UniqueID, indexName string, segIDs []UniqueID) ([]*indexpb.SegmentIndexState, error)
func (*ServerBroker) GetSegmentStates ¶
func (b *ServerBroker) GetSegmentStates(ctx context.Context, req *datapb.GetSegmentStatesRequest) (*datapb.GetSegmentStatesResponse, error)
func (*ServerBroker) ReleaseCollection ¶
func (b *ServerBroker) ReleaseCollection(ctx context.Context, collectionID UniqueID) error
func (*ServerBroker) ReleasePartitions ¶
func (*ServerBroker) SyncNewCreatedPartition ¶
func (*ServerBroker) UnwatchChannels ¶
func (b *ServerBroker) UnwatchChannels(ctx context.Context, info *watchInfo) error
func (*ServerBroker) WatchChannels ¶
func (b *ServerBroker) WatchChannels(ctx context.Context, info *watchInfo) error
type StepExecutor ¶
type StepExecutor interface { Start() Stop() AddSteps(s *stepStack) }
type TimeTravelRequest ¶
Source Files ¶
- alter_alias_task.go
- alter_collection_task.go
- alter_database_task.go
- broker.go
- constrant.go
- create_alias_task.go
- create_collection_task.go
- create_db_task.go
- create_partition_task.go
- ddl_ts_lock_manager.go
- describe_collection_task.go
- describe_db_task.go
- dml_channels.go
- drop_alias_task.go
- drop_collection_task.go
- drop_db_task.go
- drop_partition_task.go
- expire_cache.go
- field_id.go
- garbage_collector.go
- has_collection_task.go
- has_partition_task.go
- list_db_task.go
- meta_table.go
- metrics_info.go
- name_db.go
- quota_center.go
- redo.go
- rename_collection_task.go
- root_coord.go
- scheduler.go
- show_collection_task.go
- show_partition_task.go
- step.go
- step_executor.go
- task.go
- timeticksync.go
- undo.go
- util.go