mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 03:18:29 +08:00
Fix golint for distributed indexcoord (#8496)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
93c912e681
commit
459174d78a
@ -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()
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user