[skip ci] Add Comments for exported items in proxy/service.go (#12376)

Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>
This commit is contained in:
shaoyue 2021-11-29 19:57:57 +08:00 committed by GitHub
parent ee2239152e
commit 8bd7365172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}