mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
Remove factory in querycoord (#21659)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
This commit is contained in:
parent
ae435768f2
commit
9fccbbb92b
@ -72,7 +72,7 @@ type Server struct {
|
||||
// NewServer create a new QueryCoord grpc server.
|
||||
func NewServer(ctx context.Context, factory dependency.Factory) (*Server, error) {
|
||||
ctx1, cancel := context.WithCancel(ctx)
|
||||
svr, err := qc.NewQueryCoord(ctx1, factory)
|
||||
svr, err := qc.NewQueryCoord(ctx1)
|
||||
if err != nil {
|
||||
cancel()
|
||||
return nil, err
|
||||
|
||||
@ -47,7 +47,6 @@ import (
|
||||
"github.com/milvus-io/milvus/internal/querycoordv2/session"
|
||||
"github.com/milvus-io/milvus/internal/querycoordv2/task"
|
||||
"github.com/milvus-io/milvus/internal/types"
|
||||
"github.com/milvus-io/milvus/internal/util/dependency"
|
||||
"github.com/milvus-io/milvus/internal/util/metricsinfo"
|
||||
"github.com/milvus-io/milvus/internal/util/sessionutil"
|
||||
"github.com/milvus-io/milvus/internal/util/tsoutil"
|
||||
@ -72,7 +71,6 @@ type Server struct {
|
||||
session *sessionutil.Session
|
||||
kv kv.MetaKv
|
||||
idAllocator func() (int64, error)
|
||||
factory dependency.Factory
|
||||
metricsCacheManager *metricsinfo.MetricsCacheManager
|
||||
|
||||
// Coordinators
|
||||
@ -112,12 +110,11 @@ type Server struct {
|
||||
activateFunc func()
|
||||
}
|
||||
|
||||
func NewQueryCoord(ctx context.Context, factory dependency.Factory) (*Server, error) {
|
||||
func NewQueryCoord(ctx context.Context) (*Server, error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
server := &Server{
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
factory: factory,
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
}
|
||||
server.UpdateStateCode(commonpb.StateCode_Abnormal)
|
||||
return server, nil
|
||||
@ -156,7 +153,6 @@ func (s *Server) Init() error {
|
||||
s.session.Init(typeutil.QueryCoordRole, s.address, true, true)
|
||||
s.enableActiveStandBy = Params.QueryCoordCfg.EnableActiveStandby.GetAsBool()
|
||||
s.session.SetEnableActiveStandBy(s.enableActiveStandBy)
|
||||
s.factory.Init(Params)
|
||||
|
||||
// Init KV
|
||||
etcdKV := etcdkv.NewEtcdKV(s.etcdCli, Params.EtcdCfg.MetaRootPath.GetValue())
|
||||
|
||||
@ -37,7 +37,6 @@ import (
|
||||
"github.com/milvus-io/milvus/internal/querycoordv2/mocks"
|
||||
"github.com/milvus-io/milvus/internal/querycoordv2/params"
|
||||
"github.com/milvus-io/milvus/internal/querycoordv2/task"
|
||||
"github.com/milvus-io/milvus/internal/util/dependency"
|
||||
"github.com/milvus-io/milvus/internal/util/etcd"
|
||||
"github.com/milvus-io/milvus/internal/util/paramtable"
|
||||
)
|
||||
@ -413,7 +412,7 @@ func (suite *ServerSuite) hackServer() {
|
||||
}
|
||||
|
||||
func newQueryCoord() (*Server, error) {
|
||||
server, err := NewQueryCoord(context.Background(), dependency.NewDefaultFactory(true))
|
||||
server, err := NewQueryCoord(context.Background())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user