From 8bd7365172e9b0af90ae1586f38aa1e10a310222 Mon Sep 17 00:00:00 2001 From: shaoyue Date: Mon, 29 Nov 2021 19:57:57 +0800 Subject: [PATCH] [skip ci] Add Comments for exported items in proxy/service.go (#12376) Signed-off-by: shaoyue.chen --- internal/distributed/proxy/service.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/distributed/proxy/service.go b/internal/distributed/proxy/service.go index 857a4f7a36..baecd450f8 100644 --- a/internal/distributed/proxy/service.go +++ b/internal/distributed/proxy/service.go @@ -49,9 +49,11 @@ import ( ) const ( + // GRPCMaxMagSize is the max size of grpc message. GRPCMaxMagSize = 2 << 30 ) +// Server is the Proxy Server type Server struct { ctx context.Context wg sync.WaitGroup @@ -131,6 +133,7 @@ func (s *Server) startGrpcLoop(grpcPort int) { } +// Start start the Proxy Server func (s *Server) Run() error { if err := s.init(); err != nil { @@ -264,6 +267,7 @@ func (s *Server) start() error { return s.proxy.Start() } +// Stop stop the Proxy Server func (s *Server) Stop() error { var err error if s.closer != nil { @@ -286,34 +290,42 @@ func (s *Server) Stop() error { return nil } +// GetComponentStates get the component states func (s *Server) GetComponentStates(ctx context.Context, request *internalpb.GetComponentStatesRequest) (*internalpb.ComponentStates, error) { return s.proxy.GetComponentStates(ctx) } +// GetStatisticsChannel get the statistics channel func (s *Server) GetStatisticsChannel(ctx context.Context, request *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error) { return s.proxy.GetStatisticsChannel(ctx) } +// InvalidateCollectionMetaCache notifies Proxy to clear all the meta cache of specific collection. func (s *Server) InvalidateCollectionMetaCache(ctx context.Context, request *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error) { return s.proxy.InvalidateCollectionMetaCache(ctx, request) } +// ReleaseDQLMessageStream notifies Proxy to release and close the search message stream of specific collection. func (s *Server) ReleaseDQLMessageStream(ctx context.Context, request *proxypb.ReleaseDQLMessageStreamRequest) (*commonpb.Status, error) { return s.proxy.ReleaseDQLMessageStream(ctx, request) } +// CreateCollection notifies Proxy to create a collection func (s *Server) CreateCollection(ctx context.Context, request *milvuspb.CreateCollectionRequest) (*commonpb.Status, error) { return s.proxy.CreateCollection(ctx, request) } +// DropCollection notifies Proxy to drop a collection func (s *Server) DropCollection(ctx context.Context, request *milvuspb.DropCollectionRequest) (*commonpb.Status, error) { return s.proxy.DropCollection(ctx, request) } +// HasCollection notifies Proxy to check a collection's existence at specified timestamp func (s *Server) HasCollection(ctx context.Context, request *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) { return s.proxy.HasCollection(ctx, request) } +// LoadCollection notifies Proxy to load a collection's data func (s *Server) LoadCollection(ctx context.Context, request *milvuspb.LoadCollectionRequest) (*commonpb.Status, error) { return s.proxy.LoadCollection(ctx, request) } @@ -322,10 +334,12 @@ func (s *Server) ReleaseCollection(ctx context.Context, request *milvuspb.Releas return s.proxy.ReleaseCollection(ctx, request) } +// ReleaseCollection notifies Proxy to release a collection's data func (s *Server) DescribeCollection(ctx context.Context, request *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error) { return s.proxy.DescribeCollection(ctx, request) } +// ReleaseCollection notifies Proxy to release a collection's data func (s *Server) GetCollectionStatistics(ctx context.Context, request *milvuspb.GetCollectionStatisticsRequest) (*milvuspb.GetCollectionStatisticsResponse, error) { return s.proxy.GetCollectionStatistics(ctx, request) }