mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
[skip ci] Add comments for exported things in policy.go (#11876)
Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>
This commit is contained in:
parent
887f9e010f
commit
6322eb31e7
@ -315,6 +315,7 @@ func AvgAssignUnregisteredChannels(store ROChannelStore, nodeID int64) ChannelOp
|
|||||||
return opSet
|
return opSet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConsistentHashDeregisterPolicy return a DeregisterPolicy that uses consistent hash
|
||||||
func ConsistentHashDeregisterPolicy(hashring *consistent.Consistent) DeregisterPolicy {
|
func ConsistentHashDeregisterPolicy(hashring *consistent.Consistent) DeregisterPolicy {
|
||||||
return func(store ROChannelStore, nodeID int64) ChannelOpSet {
|
return func(store ROChannelStore, nodeID int64) ChannelOpSet {
|
||||||
hashring.Set(formatNodeIDsWithFilter(store.GetNodes(), nodeID))
|
hashring.Set(formatNodeIDsWithFilter(store.GetNodes(), nodeID))
|
||||||
@ -365,12 +366,15 @@ func ConsistentHashDeregisterPolicy(hashring *consistent.Consistent) DeregisterP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChannelReassignPolicy is a policy for reassigning channels
|
||||||
type ChannelReassignPolicy func(store ROChannelStore, reassigns []*NodeChannelInfo) ChannelOpSet
|
type ChannelReassignPolicy func(store ROChannelStore, reassigns []*NodeChannelInfo) ChannelOpSet
|
||||||
|
|
||||||
|
// EmptyReassignPolicy is a dummy reassign policy
|
||||||
func EmptyReassignPolicy(store ROChannelStore, reassigns []*NodeChannelInfo) ChannelOpSet {
|
func EmptyReassignPolicy(store ROChannelStore, reassigns []*NodeChannelInfo) ChannelOpSet {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AverageReassignPolicy is a reassign policy that evenly assign channels
|
||||||
func AverageReassignPolicy(store ROChannelStore, reassigns []*NodeChannelInfo) ChannelOpSet {
|
func AverageReassignPolicy(store ROChannelStore, reassigns []*NodeChannelInfo) ChannelOpSet {
|
||||||
channels := store.GetNodesChannels()
|
channels := store.GetNodesChannels()
|
||||||
filterMap := make(map[int64]struct{})
|
filterMap := make(map[int64]struct{})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user