Documentation ¶
Index ¶
- Constants
- func AssignReplica(ctx context.Context, m *meta.Meta, resourceGroups []string, ...) (map[string]int, error)
- func CheckCollectionsQueryable(ctx context.Context, m *meta.Meta, targetMgr meta.TargetManagerInterface, ...) error
- func CheckDelegatorDataReady(nodeMgr *session.NodeManager, targetMgr meta.TargetManagerInterface, ...) error
- func CheckNodeAvailable(nodeID int64, info *session.NodeInfo) error
- func CreateTestChannel(collection, node, version int64, channel string) *meta.DmChannel
- func CreateTestCollection(collection int64, replica int32) *meta.Collection
- func CreateTestLeaderView(id, collection int64, channel string, segments map[int64]int64, ...) *meta.LeaderView
- func CreateTestPartition(collection int64, partitionID int64) *meta.Partition
- func CreateTestReplica(id, collectionID int64, nodes []int64) *meta.Replica
- func CreateTestSchema() *schemapb.CollectionSchema
- func CreateTestSegment(collection, partition, segment, node, version int64, channel string) *meta.Segment
- func CreateTestSegmentInfo(collection, partition, segment int64, channel string) *datapb.SegmentInfo
- func FilterReleased[E interface{ ... }](elems []E, collections []int64) []E
- func FindMaxVersionSegments(segments []*meta.Segment) []*meta.Segment
- func GetPartitions(ctx context.Context, collectionMgr *meta.CollectionManager, collectionID int64) ([]int64, error)
- func GetShardLeaders(ctx context.Context, m *meta.Meta, targetMgr meta.TargetManagerInterface, ...) ([]*querypb.ShardLeadersList, error)
- func GetShardLeadersWithChannels(ctx context.Context, m *meta.Meta, targetMgr meta.TargetManagerInterface, ...) ([]*querypb.ShardLeadersList, error)
- func GroupNodesByReplica(ctx context.Context, replicaMgr *meta.ReplicaManager, collectionID int64, ...) map[int64][]int64
- func GroupPartitionsByCollection(partitions []*meta.Partition) map[int64][]*meta.Partition
- func GroupSegmentsByReplica(ctx context.Context, replicaMgr *meta.ReplicaManager, collectionID int64, ...) map[int64][]*meta.Segment
- func MergeDmChannelInfo(infos []*datapb.VchannelInfo) *meta.DmChannel
- func MergeMetaSegmentIntoSegmentInfo(info *querypb.SegmentInfo, segments ...*meta.Segment)
- func PackSegmentLoadInfo(segment *datapb.SegmentInfo, channelCheckpoint *msgpb.MsgPosition, ...) *querypb.SegmentLoadInfo
- func ReassignReplicaToRG(ctx context.Context, m *meta.Meta, collectionID int64, newReplicaNumber int32, ...) (map[string]int, map[string][]*meta.Replica, []int64, error)
- func RecoverAllCollection(m *meta.Meta)
- func RecoverReplicaOfCollection(ctx context.Context, m *meta.Meta, collectionID typeutil.UniqueID)
- func SpawnReplicasWithRG(ctx context.Context, m *meta.Meta, collection int64, resourceGroups []string, ...) ([]*meta.Replica, error)
- type CheckerType
Constants ¶
const ( SegmentCheckerName = "segment_checker" ChannelCheckerName = "channel_checker" BalanceCheckerName = "balance_checker" IndexCheckerName = "index_checker" LeaderCheckerName = "leader_checker" ManualBalanceName = "manual_balance" )
Variables ¶
This section is empty.
Functions ¶
func AssignReplica ¶
func CheckCollectionsQueryable ¶
func CheckCollectionsQueryable(ctx context.Context, m *meta.Meta, targetMgr meta.TargetManagerInterface, dist *meta.DistributionManager, nodeMgr *session.NodeManager) error
CheckCollectionsQueryable check all channels are watched and all segments are loaded for this collection
func CheckDelegatorDataReady ¶
func CheckDelegatorDataReady(nodeMgr *session.NodeManager, targetMgr meta.TargetManagerInterface, leader *meta.LeaderView, scope int32) error
In a replica, a shard is available, if and only if: 1. The leader is online 2. All QueryNodes in the distribution are online 3. The last heartbeat response time is within HeartbeatAvailableInterval for all QueryNodes(include leader) in the distribution 4. All segments of the shard in target should be in the distribution
func CreateTestChannel ¶
func CreateTestCollection ¶
func CreateTestCollection(collection int64, replica int32) *meta.Collection
func CreateTestLeaderView ¶
func CreateTestPartition ¶
func CreateTestReplica ¶
func CreateTestSchema ¶
func CreateTestSchema() *schemapb.CollectionSchema
func CreateTestSegment ¶
func CreateTestSegmentInfo ¶
func CreateTestSegmentInfo(collection, partition, segment int64, channel string) *datapb.SegmentInfo
func FilterReleased ¶
func GetPartitions ¶
func GetShardLeaders ¶
func GetShardLeaders(ctx context.Context, m *meta.Meta, targetMgr meta.TargetManagerInterface, dist *meta.DistributionManager, nodeMgr *session.NodeManager, collectionID int64) ([]*querypb.ShardLeadersList, error)
func GetShardLeadersWithChannels ¶
func GetShardLeadersWithChannels(ctx context.Context, m *meta.Meta, targetMgr meta.TargetManagerInterface, dist *meta.DistributionManager, nodeMgr *session.NodeManager, collectionID int64, channels map[string]*meta.DmChannel, ) ([]*querypb.ShardLeadersList, error)
func GroupNodesByReplica ¶
func GroupNodesByReplica(ctx context.Context, replicaMgr *meta.ReplicaManager, collectionID int64, nodes []int64) map[int64][]int64
GroupNodesByReplica groups nodes by replica, returns ReplicaID -> NodeIDs
func GroupPartitionsByCollection ¶
GroupPartitionsByCollection groups partitions by collection, returns CollectionID -> Partitions
func GroupSegmentsByReplica ¶
func GroupSegmentsByReplica(ctx context.Context, replicaMgr *meta.ReplicaManager, collectionID int64, segments []*meta.Segment) map[int64][]*meta.Segment
GroupSegmentsByReplica groups segments by replica, returns ReplicaID -> Segments
func MergeDmChannelInfo ¶
func MergeDmChannelInfo(infos []*datapb.VchannelInfo) *meta.DmChannel
func MergeMetaSegmentIntoSegmentInfo ¶
func MergeMetaSegmentIntoSegmentInfo(info *querypb.SegmentInfo, segments ...*meta.Segment)
func PackSegmentLoadInfo ¶
func PackSegmentLoadInfo(segment *datapb.SegmentInfo, channelCheckpoint *msgpb.MsgPosition, indexes []*querypb.FieldIndexInfo) *querypb.SegmentLoadInfo
packSegmentLoadInfo packs SegmentLoadInfo for given segment, packs with index if withIndex is true, this fetch indexes from IndexCoord
func ReassignReplicaToRG ¶
func RecoverAllCollection ¶
RecoverAllCollectionrecovers all replica of all collection in resource group.
func RecoverReplicaOfCollection ¶
RecoverReplicaOfCollection recovers all replica of collection with latest resource group.
Types ¶
type CheckerType ¶
type CheckerType int32
const ( ChannelChecker CheckerType = iota + 1 SegmentChecker BalanceChecker IndexChecker LeaderChecker ManualBalance )
func (CheckerType) String ¶
func (s CheckerType) String() string