From 459174d78a80e96b8aeae1ba28dbb05bacff2f37 Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Fri, 24 Sep 2021 20:39:56 +0800 Subject: [PATCH] Fix golint for distributed indexcoord (#8496) Signed-off-by: cai.zhang --- internal/distributed/indexcoord/paramtable.go | 3 +++ internal/distributed/indexcoord/service.go | 26 +++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/internal/distributed/indexcoord/paramtable.go b/internal/distributed/indexcoord/paramtable.go index 37557cfe39..ca6baec977 100644 --- a/internal/distributed/indexcoord/paramtable.go +++ b/internal/distributed/indexcoord/paramtable.go @@ -22,6 +22,7 @@ import ( "github.com/milvus-io/milvus/internal/util/paramtable" ) +// ParamTable is used to record configuration items. type ParamTable struct { paramtable.BaseTable @@ -32,9 +33,11 @@ type ParamTable struct { ServerMaxRecvSize int } +// Params is an alias for ParamTable. var Params ParamTable var once sync.Once +// Init is used to initialize configuration items. func (pt *ParamTable) Init() { once.Do(func() { pt.BaseTable.Init() diff --git a/internal/distributed/indexcoord/service.go b/internal/distributed/indexcoord/service.go index 0761a17115..e9a155b4da 100644 --- a/internal/distributed/indexcoord/service.go +++ b/internal/distributed/indexcoord/service.go @@ -52,7 +52,7 @@ type Server struct { closer io.Closer } -// Server.Run initializes and starts IndexCoord's grpc service. +// Run initializes and starts IndexCoord's grpc service. func (s *Server) Run() error { if err := s.init(); err != nil { @@ -65,7 +65,7 @@ func (s *Server) Run() error { return nil } -//Server.init initializes IndexCoord's grpc service. +// init initializes IndexCoord's grpc service. func (s *Server) init() error { Params.Init() @@ -95,7 +95,7 @@ func (s *Server) init() error { return nil } -//Server.start starts IndexCoord's grpc service. +// start starts IndexCoord's grpc service. func (s *Server) start() error { if err := s.indexcoord.Start(); err != nil { return err @@ -104,7 +104,7 @@ func (s *Server) start() error { return nil } -//Server.Stop stops IndexCoord's grpc service. +// Stop stops IndexCoord's grpc service. func (s *Server) Stop() error { if s.closer != nil { if err := s.closer.Close(); err != nil { @@ -124,48 +124,48 @@ func (s *Server) Stop() error { return nil } -//Server.SetClient set the IndexCoord's instance. +// SetClient sets the IndexCoord's instance. func (s *Server) SetClient(indexCoordClient types.IndexCoord) error { s.indexcoord = indexCoordClient return nil } -//Server.GetComponentStates gets the component states of IndexCoord. +// GetComponentStates gets the component states of IndexCoord. func (s *Server) GetComponentStates(ctx context.Context, req *internalpb.GetComponentStatesRequest) (*internalpb.ComponentStates, error) { return s.indexcoord.GetComponentStates(ctx) } -//Server.GetTimeTickChannel gets the time tick channel of IndexCoord. +// GetTimeTickChannel gets the time tick channel of IndexCoord. func (s *Server) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error) { return s.indexcoord.GetTimeTickChannel(ctx) } -//Server.GetStatisticsChannel gets the statistics channel of IndexCoord. +// GetStatisticsChannel gets the statistics channel of IndexCoord. func (s *Server) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error) { return s.indexcoord.GetStatisticsChannel(ctx) } -//Server.BuildIndex sends the build index request to IndexCoord. +// BuildIndex sends the build index request to IndexCoord. func (s *Server) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequest) (*indexpb.BuildIndexResponse, error) { return s.indexcoord.BuildIndex(ctx, req) } -//Server.GetIndexStates gets the index states from IndexCoord. +// GetIndexStates gets the index states from IndexCoord. func (s *Server) GetIndexStates(ctx context.Context, req *indexpb.GetIndexStatesRequest) (*indexpb.GetIndexStatesResponse, error) { return s.indexcoord.GetIndexStates(ctx, req) } -//Server.DropIndex sends the drop index request to IndexCoord. +// DropIndex sends the drop index request to IndexCoord. func (s *Server) DropIndex(ctx context.Context, request *indexpb.DropIndexRequest) (*commonpb.Status, error) { return s.indexcoord.DropIndex(ctx, request) } -//Server.GetIndexFilePaths gets the index file paths from IndexCoord. +// GetIndexFilePaths gets the index file paths from IndexCoord. func (s *Server) GetIndexFilePaths(ctx context.Context, req *indexpb.GetIndexFilePathsRequest) (*indexpb.GetIndexFilePathsResponse, error) { return s.indexcoord.GetIndexFilePaths(ctx, req) } -//Server.GetMetrics gets the metrics info of IndexCoord. +// GetMetrics gets the metrics info of IndexCoord. func (s *Server) GetMetrics(ctx context.Context, request *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) { return s.indexcoord.GetMetrics(ctx, request) }