mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +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"
|
"github.com/milvus-io/milvus/internal/util/paramtable"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ParamTable is used to record configuration items.
|
||||||
type ParamTable struct {
|
type ParamTable struct {
|
||||||
paramtable.BaseTable
|
paramtable.BaseTable
|
||||||
|
|
||||||
@ -32,9 +33,11 @@ type ParamTable struct {
|
|||||||
ServerMaxRecvSize int
|
ServerMaxRecvSize int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Params is an alias for ParamTable.
|
||||||
var Params ParamTable
|
var Params ParamTable
|
||||||
var once sync.Once
|
var once sync.Once
|
||||||
|
|
||||||
|
// Init is used to initialize configuration items.
|
||||||
func (pt *ParamTable) Init() {
|
func (pt *ParamTable) Init() {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
pt.BaseTable.Init()
|
pt.BaseTable.Init()
|
||||||
|
@ -52,7 +52,7 @@ type Server struct {
|
|||||||
closer io.Closer
|
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 {
|
func (s *Server) Run() error {
|
||||||
|
|
||||||
if err := s.init(); err != nil {
|
if err := s.init(); err != nil {
|
||||||
@ -65,7 +65,7 @@ func (s *Server) Run() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Server.init initializes IndexCoord's grpc service.
|
// init initializes IndexCoord's grpc service.
|
||||||
func (s *Server) init() error {
|
func (s *Server) init() error {
|
||||||
Params.Init()
|
Params.Init()
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ func (s *Server) init() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Server.start starts IndexCoord's grpc service.
|
// start starts IndexCoord's grpc service.
|
||||||
func (s *Server) start() error {
|
func (s *Server) start() error {
|
||||||
if err := s.indexcoord.Start(); err != nil {
|
if err := s.indexcoord.Start(); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -104,7 +104,7 @@ func (s *Server) start() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Server.Stop stops IndexCoord's grpc service.
|
// Stop stops IndexCoord's grpc service.
|
||||||
func (s *Server) Stop() error {
|
func (s *Server) Stop() error {
|
||||||
if s.closer != nil {
|
if s.closer != nil {
|
||||||
if err := s.closer.Close(); err != nil {
|
if err := s.closer.Close(); err != nil {
|
||||||
@ -124,48 +124,48 @@ func (s *Server) Stop() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Server.SetClient set the IndexCoord's instance.
|
// SetClient sets the IndexCoord's instance.
|
||||||
func (s *Server) SetClient(indexCoordClient types.IndexCoord) error {
|
func (s *Server) SetClient(indexCoordClient types.IndexCoord) error {
|
||||||
s.indexcoord = indexCoordClient
|
s.indexcoord = indexCoordClient
|
||||||
return nil
|
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) {
|
func (s *Server) GetComponentStates(ctx context.Context, req *internalpb.GetComponentStatesRequest) (*internalpb.ComponentStates, error) {
|
||||||
return s.indexcoord.GetComponentStates(ctx)
|
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) {
|
func (s *Server) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error) {
|
||||||
return s.indexcoord.GetTimeTickChannel(ctx)
|
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) {
|
func (s *Server) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error) {
|
||||||
return s.indexcoord.GetStatisticsChannel(ctx)
|
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) {
|
func (s *Server) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequest) (*indexpb.BuildIndexResponse, error) {
|
||||||
return s.indexcoord.BuildIndex(ctx, req)
|
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) {
|
func (s *Server) GetIndexStates(ctx context.Context, req *indexpb.GetIndexStatesRequest) (*indexpb.GetIndexStatesResponse, error) {
|
||||||
return s.indexcoord.GetIndexStates(ctx, req)
|
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) {
|
func (s *Server) DropIndex(ctx context.Context, request *indexpb.DropIndexRequest) (*commonpb.Status, error) {
|
||||||
return s.indexcoord.DropIndex(ctx, request)
|
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) {
|
func (s *Server) GetIndexFilePaths(ctx context.Context, req *indexpb.GetIndexFilePathsRequest) (*indexpb.GetIndexFilePathsResponse, error) {
|
||||||
return s.indexcoord.GetIndexFilePaths(ctx, req)
|
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) {
|
func (s *Server) GetMetrics(ctx context.Context, request *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
|
||||||
return s.indexcoord.GetMetrics(ctx, request)
|
return s.indexcoord.GetMetrics(ctx, request)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user