From 6777d24c657909d7784bdfc8708dcb3831642cf8 Mon Sep 17 00:00:00 2001 From: shaoyue Date: Fri, 19 Nov 2021 18:05:25 +0800 Subject: [PATCH] [skip ci] Add comment for exported items (#12126) Signed-off-by: shaoyue.chen --- internal/datacoord/handler.go | 1 + internal/datacoord/policy.go | 2 ++ internal/datacoord/services.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/internal/datacoord/handler.go b/internal/datacoord/handler.go index d34f3aa2c1..9ff6733fcc 100644 --- a/internal/datacoord/handler.go +++ b/internal/datacoord/handler.go @@ -11,6 +11,7 @@ import ( "go.uber.org/zap" ) +// Handler handles some channel method for ChannelManager type Handler interface { GetVChanPositions(channel string, collectionID UniqueID, partitionID UniqueID) *datapb.VchannelInfo CheckShouldDropChannel(channel string) bool diff --git a/internal/datacoord/policy.go b/internal/datacoord/policy.go index 1ddcdd7769..dfda7b220c 100644 --- a/internal/datacoord/policy.go +++ b/internal/datacoord/policy.go @@ -429,10 +429,12 @@ func AverageReassignPolicy(store ROChannelStore, reassigns []*NodeChannelInfo) C // ChannelBGChecker check nodes' channels and return the channels needed to be reallocated. type ChannelBGChecker func(channels []*NodeChannelInfo, ts time.Time) ([]*NodeChannelInfo, error) +// EmptyBgChecker does nothing func EmptyBgChecker(channels []*NodeChannelInfo, ts time.Time) ([]*NodeChannelInfo, error) { return nil, nil } +// BgCheckWithMaxWatchDuration returns a ChannelBGChecker with the maxWatchDuration func BgCheckWithMaxWatchDuration(kv kv.TxnKV) ChannelBGChecker { return func(channels []*NodeChannelInfo, ts time.Time) ([]*NodeChannelInfo, error) { reallocations := make([]*NodeChannelInfo, 0, len(channels)) diff --git a/internal/datacoord/services.go b/internal/datacoord/services.go index ac41055ded..40943dc13d 100644 --- a/internal/datacoord/services.go +++ b/internal/datacoord/services.go @@ -747,6 +747,7 @@ func (s *Server) GetCompactionState(ctx context.Context, req *milvuspb.GetCompac return resp, nil } +// GetCompactionStateWithPlans returns the compaction state of given plan func (s *Server) GetCompactionStateWithPlans(ctx context.Context, req *milvuspb.GetCompactionPlansRequest) (*milvuspb.GetCompactionPlansResponse, error) { log.Debug("received GetCompactionStateWithPlans request", zap.Int64("compactionID", req.GetCompactionID())) @@ -815,6 +816,7 @@ func getCompactionState(tasks []*compactionTask) (state commonpb.CompactionState return } +// WatchChannels starts watch channels by give request func (s *Server) WatchChannels(ctx context.Context, req *datapb.WatchChannelsRequest) (*datapb.WatchChannelsResponse, error) { log.Debug("receive watch channels request", zap.Any("channels", req.GetChannelNames())) resp := &datapb.WatchChannelsResponse{