2021-04-19 10:09:43 +08:00
|
|
|
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
|
|
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
|
|
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
package grpcproxynode
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-02-26 17:44:24 +08:00
|
|
|
"fmt"
|
2021-02-23 09:58:06 +08:00
|
|
|
"io"
|
2021-03-08 15:49:42 +08:00
|
|
|
"math"
|
2021-01-22 09:36:18 +08:00
|
|
|
"net"
|
|
|
|
"strconv"
|
|
|
|
"sync"
|
2021-01-28 20:51:44 +08:00
|
|
|
"time"
|
|
|
|
|
2021-03-10 09:56:09 +08:00
|
|
|
"go.uber.org/zap"
|
2021-02-23 11:40:30 +08:00
|
|
|
"google.golang.org/grpc"
|
|
|
|
|
2021-04-22 14:45:57 +08:00
|
|
|
grpcdataserviceclient "github.com/milvus-io/milvus/internal/distributed/dataservice/client"
|
|
|
|
grpcindexserviceclient "github.com/milvus-io/milvus/internal/distributed/indexservice/client"
|
|
|
|
grpcmasterserviceclient "github.com/milvus-io/milvus/internal/distributed/masterservice/client"
|
|
|
|
grpcqueryserviceclient "github.com/milvus-io/milvus/internal/distributed/queryservice/client"
|
2021-02-23 11:40:30 +08:00
|
|
|
|
2021-06-17 14:17:56 +08:00
|
|
|
grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
2021-04-22 14:45:57 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/log"
|
|
|
|
"github.com/milvus-io/milvus/internal/msgstream"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/commonpb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/milvuspb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/proxypb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proxynode"
|
|
|
|
"github.com/milvus-io/milvus/internal/util/funcutil"
|
|
|
|
"github.com/milvus-io/milvus/internal/util/trace"
|
2021-02-23 11:40:30 +08:00
|
|
|
"github.com/opentracing/opentracing-go"
|
2021-01-22 09:36:18 +08:00
|
|
|
)
|
|
|
|
|
2021-03-05 11:16:23 +08:00
|
|
|
const (
|
|
|
|
GRPCMaxMagSize = 2 << 30
|
|
|
|
)
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
type Server struct {
|
2021-01-29 09:27:26 +08:00
|
|
|
ctx context.Context
|
|
|
|
wg sync.WaitGroup
|
2021-03-12 14:22:09 +08:00
|
|
|
proxynode *proxynode.ProxyNode
|
2021-01-29 09:27:26 +08:00
|
|
|
grpcServer *grpc.Server
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
grpcErrChan chan error
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-02-23 11:40:30 +08:00
|
|
|
masterServiceClient *grpcmasterserviceclient.GrpcClient
|
|
|
|
dataServiceClient *grpcdataserviceclient.Client
|
2021-01-29 09:27:26 +08:00
|
|
|
queryServiceClient *grpcqueryserviceclient.Client
|
|
|
|
indexServiceClient *grpcindexserviceclient.Client
|
2021-02-23 09:58:06 +08:00
|
|
|
|
|
|
|
tracer opentracing.Tracer
|
|
|
|
closer io.Closer
|
2021-01-29 09:27:26 +08:00
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-02-08 14:30:54 +08:00
|
|
|
func NewServer(ctx context.Context, factory msgstream.Factory) (*Server, error) {
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-02-23 09:58:06 +08:00
|
|
|
var err error
|
2021-01-29 09:27:26 +08:00
|
|
|
server := &Server{
|
2021-01-29 17:08:31 +08:00
|
|
|
ctx: ctx,
|
2021-01-29 09:27:26 +08:00
|
|
|
grpcErrChan: make(chan error),
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
server.proxynode, err = proxynode.NewProxyNode(server.ctx, factory)
|
2021-01-28 20:51:44 +08:00
|
|
|
if err != nil {
|
2021-01-29 09:27:26 +08:00
|
|
|
return nil, err
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
2021-01-29 09:27:26 +08:00
|
|
|
return server, err
|
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) startGrpcLoop(grpcPort int) {
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
defer s.wg.Done()
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("proxynode", zap.Int("network port", grpcPort))
|
2021-01-29 09:27:26 +08:00
|
|
|
lis, err := net.Listen("tcp", ":"+strconv.Itoa(grpcPort))
|
2021-01-28 20:51:44 +08:00
|
|
|
if err != nil {
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Warn("proxynode", zap.String("Server:failed to listen:", err.Error()))
|
2021-01-29 09:27:26 +08:00
|
|
|
s.grpcErrChan <- err
|
|
|
|
return
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
ctx, cancel := context.WithCancel(s.ctx)
|
|
|
|
defer cancel()
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-06-17 14:17:56 +08:00
|
|
|
opts := trace.GetInterceptorOpts()
|
2021-03-08 15:49:42 +08:00
|
|
|
s.grpcServer = grpc.NewServer(
|
|
|
|
grpc.MaxRecvMsgSize(math.MaxInt32),
|
|
|
|
grpc.MaxSendMsgSize(math.MaxInt32),
|
2021-06-17 14:17:56 +08:00
|
|
|
grpc.MaxRecvMsgSize(GRPCMaxMagSize),
|
2021-03-08 15:49:42 +08:00
|
|
|
grpc.UnaryInterceptor(
|
2021-06-17 14:17:56 +08:00
|
|
|
grpc_opentracing.UnaryServerInterceptor(opts...)),
|
2021-02-26 17:44:24 +08:00
|
|
|
grpc.StreamInterceptor(
|
2021-06-17 14:17:56 +08:00
|
|
|
grpc_opentracing.StreamServerInterceptor(opts...)))
|
2021-01-29 09:27:26 +08:00
|
|
|
proxypb.RegisterProxyNodeServiceServer(s.grpcServer, s)
|
|
|
|
milvuspb.RegisterMilvusServiceServer(s.grpcServer, s)
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
go funcutil.CheckGrpcReady(ctx, s.grpcErrChan)
|
|
|
|
if err := s.grpcServer.Serve(lis); err != nil {
|
|
|
|
s.grpcErrChan <- err
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
}
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) Run() error {
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
if err := s.init(); err != nil {
|
2021-01-29 17:29:31 +08:00
|
|
|
return err
|
2021-01-28 20:51:44 +08:00
|
|
|
}
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("proxy node init done ...")
|
2021-01-28 20:51:44 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
if err := s.start(); err != nil {
|
2021-01-28 20:51:44 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("proxy node start done ...")
|
2021-01-28 20:51:44 +08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) init() error {
|
|
|
|
var err error
|
2021-01-28 20:51:44 +08:00
|
|
|
Params.Init()
|
2021-02-23 18:08:17 +08:00
|
|
|
if !funcutil.CheckPortAvailable(Params.Port) {
|
|
|
|
Params.Port = funcutil.GetAvailablePort()
|
2021-03-30 20:19:30 +08:00
|
|
|
log.Warn("ProxyNode init", zap.Any("Port", Params.Port))
|
2021-02-23 18:08:17 +08:00
|
|
|
}
|
2021-02-20 10:15:37 +08:00
|
|
|
Params.LoadFromEnv()
|
|
|
|
Params.LoadFromArgs()
|
2021-01-29 09:27:26 +08:00
|
|
|
Params.Address = Params.IP + ":" + strconv.FormatInt(int64(Params.Port), 10)
|
2021-01-22 12:57:23 +08:00
|
|
|
|
2021-03-23 01:49:50 +08:00
|
|
|
proxynode.Params.Init()
|
|
|
|
log.Debug("init params done ...")
|
|
|
|
proxynode.Params.NetworkPort = Params.Port
|
|
|
|
proxynode.Params.IP = Params.IP
|
|
|
|
proxynode.Params.NetworkAddress = Params.Address
|
|
|
|
// for purpose of ID Allocator
|
|
|
|
proxynode.Params.MasterAddress = Params.MasterAddress
|
2021-01-29 17:29:31 +08:00
|
|
|
|
2021-03-26 15:13:33 +08:00
|
|
|
closer := trace.InitTracing(fmt.Sprintf("proxy_node ip: %s, port: %d", Params.IP, Params.Port))
|
2021-02-26 17:44:24 +08:00
|
|
|
s.closer = closer
|
|
|
|
|
2021-03-23 01:49:50 +08:00
|
|
|
log.Debug("proxynode", zap.String("proxy host", Params.IP))
|
|
|
|
log.Debug("proxynode", zap.Int("proxy port", Params.Port))
|
|
|
|
log.Debug("proxynode", zap.String("proxy address", Params.Address))
|
|
|
|
|
2021-05-25 15:06:05 +08:00
|
|
|
err = s.proxynode.Register()
|
|
|
|
if err != nil {
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode Register etcd failed ", zap.Error(err))
|
2021-05-25 15:06:05 +08:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
s.wg.Add(1)
|
2021-01-29 17:08:31 +08:00
|
|
|
go s.startGrpcLoop(Params.Port)
|
2021-01-29 09:27:26 +08:00
|
|
|
// wait for grpc server loop start
|
|
|
|
err = <-s.grpcErrChan
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("create grpc server ...")
|
2021-01-29 09:27:26 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
2021-01-22 12:57:23 +08:00
|
|
|
}
|
2021-01-29 09:27:26 +08:00
|
|
|
|
|
|
|
masterServiceAddr := Params.MasterAddress
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode", zap.String("master address", masterServiceAddr))
|
2021-01-29 09:27:26 +08:00
|
|
|
timeout := 3 * time.Second
|
2021-06-16 18:35:59 +08:00
|
|
|
s.masterServiceClient, err = grpcmasterserviceclient.NewClient(s.ctx, proxynode.Params.MetaRootPath, proxynode.Params.EtcdEndpoints, timeout)
|
2021-01-29 09:27:26 +08:00
|
|
|
if err != nil {
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode new masterServiceClient failed ", zap.Error(err))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
2021-01-22 12:57:23 +08:00
|
|
|
}
|
2021-01-29 09:27:26 +08:00
|
|
|
err = s.masterServiceClient.Init()
|
2021-01-22 12:57:23 +08:00
|
|
|
if err != nil {
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode new masterServiceClient Init ", zap.Error(err))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
2021-01-22 12:57:23 +08:00
|
|
|
}
|
2021-06-16 18:35:59 +08:00
|
|
|
err = funcutil.WaitForComponentHealthy(s.ctx, s.masterServiceClient, "MasterService", 1000000, time.Millisecond*200)
|
2021-03-04 22:27:12 +08:00
|
|
|
|
|
|
|
if err != nil {
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode WaitForComponentHealthy master service failed ", zap.Error(err))
|
2021-03-04 22:27:12 +08:00
|
|
|
panic(err)
|
|
|
|
}
|
2021-03-12 14:22:09 +08:00
|
|
|
s.proxynode.SetMasterClient(s.masterServiceClient)
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("set master client ...")
|
2021-01-22 12:57:23 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
dataServiceAddr := Params.DataServiceAddress
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode", zap.String("data service address", dataServiceAddr))
|
2021-06-11 22:04:41 +08:00
|
|
|
s.dataServiceClient = grpcdataserviceclient.NewClient(proxynode.Params.MetaRootPath, proxynode.Params.EtcdEndpoints, timeout)
|
2021-01-29 09:27:26 +08:00
|
|
|
err = s.dataServiceClient.Init()
|
|
|
|
if err != nil {
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode dataServiceClient init failed ", zap.Error(err))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-03-12 14:22:09 +08:00
|
|
|
s.proxynode.SetDataServiceClient(s.dataServiceClient)
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("set data service address ...")
|
2021-01-29 09:27:26 +08:00
|
|
|
|
|
|
|
indexServiceAddr := Params.IndexServerAddress
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode", zap.String("index server address", indexServiceAddr))
|
2021-06-11 22:04:41 +08:00
|
|
|
s.indexServiceClient = grpcindexserviceclient.NewClient(proxynode.Params.MetaRootPath, proxynode.Params.EtcdEndpoints, timeout)
|
2021-01-29 09:27:26 +08:00
|
|
|
err = s.indexServiceClient.Init()
|
2021-01-22 09:36:18 +08:00
|
|
|
if err != nil {
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode indexServiceClient init failed ", zap.Error(err))
|
2021-01-22 09:36:18 +08:00
|
|
|
return err
|
|
|
|
}
|
2021-03-12 14:22:09 +08:00
|
|
|
s.proxynode.SetIndexServiceClient(s.indexServiceClient)
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("set index service client ...")
|
2021-01-29 17:29:31 +08:00
|
|
|
|
2021-02-05 10:29:14 +08:00
|
|
|
queryServiceAddr := Params.QueryServiceAddress
|
2021-06-03 14:58:34 +08:00
|
|
|
log.Debug("ProxyNode", zap.String("query server address", queryServiceAddr))
|
2021-06-11 22:04:41 +08:00
|
|
|
s.queryServiceClient, err = grpcqueryserviceclient.NewClient(proxynode.Params.MetaRootPath, proxynode.Params.EtcdEndpoints, timeout)
|
2021-02-05 10:29:14 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
err = s.queryServiceClient.Init()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-03-12 14:22:09 +08:00
|
|
|
s.proxynode.SetQueryServiceClient(s.queryServiceClient)
|
2021-03-10 09:56:09 +08:00
|
|
|
log.Debug("set query service client ...")
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
s.proxynode.UpdateStateCode(internalpb.StateCode_Initializing)
|
2021-06-03 19:01:33 +08:00
|
|
|
log.Debug("proxynode",
|
|
|
|
zap.Any("state of proxynode", internalpb.StateCode_Initializing))
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
if err := s.proxynode.Init(); err != nil {
|
2021-06-03 19:01:33 +08:00
|
|
|
log.Debug("proxynode", zap.String("proxynode init error", err.Error()))
|
2021-01-29 09:27:26 +08:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2021-01-22 09:36:18 +08:00
|
|
|
|
2021-01-29 09:27:26 +08:00
|
|
|
func (s *Server) start() error {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.Start()
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) Stop() error {
|
|
|
|
var err error
|
2021-03-26 15:13:33 +08:00
|
|
|
if s.closer != nil {
|
|
|
|
if err = s.closer.Close(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2021-01-22 09:36:18 +08:00
|
|
|
|
|
|
|
if s.grpcServer != nil {
|
|
|
|
s.grpcServer.GracefulStop()
|
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
err = s.proxynode.Stop()
|
2021-01-22 09:36:18 +08:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
s.wg.Wait()
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetComponentStates(ctx context.Context, request *internalpb.GetComponentStatesRequest) (*internalpb.ComponentStates, error) {
|
|
|
|
return s.proxynode.GetComponentStates(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) GetStatisticsChannel(ctx context.Context, request *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error) {
|
|
|
|
return s.proxynode.GetStatisticsChannel(ctx)
|
|
|
|
}
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) InvalidateCollectionMetaCache(ctx context.Context, request *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.InvalidateCollectionMetaCache(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-06-17 17:45:56 +08:00
|
|
|
func (s *Server) ReleaseDQLMessageStream(ctx context.Context, in *proxypb.ReleaseDQLMessageStreamRequest) (*commonpb.Status, error) {
|
|
|
|
panic("not implement")
|
|
|
|
}
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) CreateCollection(ctx context.Context, request *milvuspb.CreateCollectionRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.CreateCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) DropCollection(ctx context.Context, request *milvuspb.DropCollectionRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.DropCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) HasCollection(ctx context.Context, request *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.HasCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) LoadCollection(ctx context.Context, request *milvuspb.LoadCollectionRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.LoadCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) ReleaseCollection(ctx context.Context, request *milvuspb.ReleaseCollectionRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.ReleaseCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) DescribeCollection(ctx context.Context, request *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.DescribeCollection(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetCollectionStatistics(ctx context.Context, request *milvuspb.GetCollectionStatisticsRequest) (*milvuspb.GetCollectionStatisticsResponse, error) {
|
|
|
|
return s.proxynode.GetCollectionStatistics(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) ShowCollections(ctx context.Context, request *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error) {
|
|
|
|
return s.proxynode.ShowCollections(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) CreatePartition(ctx context.Context, request *milvuspb.CreatePartitionRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.CreatePartition(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) DropPartition(ctx context.Context, request *milvuspb.DropPartitionRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.DropPartition(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) HasPartition(ctx context.Context, request *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.HasPartition(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) LoadPartitions(ctx context.Context, request *milvuspb.LoadPartitionsRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxynode.LoadPartitions(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) ReleasePartitions(ctx context.Context, request *milvuspb.ReleasePartitionsRequest) (*commonpb.Status, error) {
|
|
|
|
return s.proxynode.ReleasePartitions(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetPartitionStatistics(ctx context.Context, request *milvuspb.GetPartitionStatisticsRequest) (*milvuspb.GetPartitionStatisticsResponse, error) {
|
|
|
|
return s.proxynode.GetPartitionStatistics(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) ShowPartitions(ctx context.Context, request *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error) {
|
|
|
|
return s.proxynode.ShowPartitions(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) CreateIndex(ctx context.Context, request *milvuspb.CreateIndexRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.CreateIndex(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-02-20 18:30:37 +08:00
|
|
|
func (s *Server) DropIndex(ctx context.Context, request *milvuspb.DropIndexRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.DropIndex(ctx, request)
|
2021-02-20 18:30:37 +08:00
|
|
|
}
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) DescribeIndex(ctx context.Context, request *milvuspb.DescribeIndexRequest) (*milvuspb.DescribeIndexResponse, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.DescribeIndex(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-04-27 15:46:45 +08:00
|
|
|
// GetIndexBuildProgress gets index build progress with filed_name and index_name.
|
|
|
|
// IndexRows is the num of indexed rows. And TotalRows is the total number of segment rows.
|
|
|
|
func (s *Server) GetIndexBuildProgress(ctx context.Context, request *milvuspb.GetIndexBuildProgressRequest) (*milvuspb.GetIndexBuildProgressResponse, error) {
|
|
|
|
return s.proxynode.GetIndexBuildProgress(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetIndexState(ctx context.Context, request *milvuspb.GetIndexStateRequest) (*milvuspb.GetIndexStateResponse, error) {
|
|
|
|
return s.proxynode.GetIndexState(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) Insert(ctx context.Context, request *milvuspb.InsertRequest) (*milvuspb.InsertResponse, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.Insert(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) Search(ctx context.Context, request *milvuspb.SearchRequest) (*milvuspb.SearchResults, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.Search(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-05-19 18:45:15 +08:00
|
|
|
func (s *Server) Retrieve(ctx context.Context, request *milvuspb.RetrieveRequest) (*milvuspb.RetrieveResults, error) {
|
|
|
|
return s.proxynode.Retrieve(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-01-22 09:36:18 +08:00
|
|
|
func (s *Server) Flush(ctx context.Context, request *milvuspb.FlushRequest) (*commonpb.Status, error) {
|
2021-03-12 14:22:09 +08:00
|
|
|
return s.proxynode.Flush(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
|
|
|
|
2021-06-04 12:02:34 +08:00
|
|
|
func (s *Server) Query(ctx context.Context, request *milvuspb.QueryRequest) (*milvuspb.QueryResults, error) {
|
|
|
|
return s.proxynode.Query(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetDdChannel(ctx context.Context, request *internalpb.GetDdChannelRequest) (*milvuspb.StringResponse, error) {
|
|
|
|
return s.proxynode.GetDdChannel(ctx, request)
|
2021-01-22 09:36:18 +08:00
|
|
|
}
|
2021-02-03 18:55:00 +08:00
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetPersistentSegmentInfo(ctx context.Context, request *milvuspb.GetPersistentSegmentInfoRequest) (*milvuspb.GetPersistentSegmentInfoResponse, error) {
|
|
|
|
return s.proxynode.GetPersistentSegmentInfo(ctx, request)
|
2021-02-03 18:55:00 +08:00
|
|
|
}
|
2021-02-04 14:37:12 +08:00
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) GetQuerySegmentInfo(ctx context.Context, request *milvuspb.GetQuerySegmentInfoRequest) (*milvuspb.GetQuerySegmentInfoResponse, error) {
|
|
|
|
return s.proxynode.GetQuerySegmentInfo(ctx, request)
|
2021-02-04 14:37:12 +08:00
|
|
|
|
|
|
|
}
|
2021-03-04 22:27:12 +08:00
|
|
|
|
2021-05-25 14:44:43 +08:00
|
|
|
func (s *Server) Dummy(ctx context.Context, request *milvuspb.DummyRequest) (*milvuspb.DummyResponse, error) {
|
|
|
|
return s.proxynode.Dummy(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-03-12 14:22:09 +08:00
|
|
|
func (s *Server) RegisterLink(ctx context.Context, request *milvuspb.RegisterLinkRequest) (*milvuspb.RegisterLinkResponse, error) {
|
|
|
|
return s.proxynode.RegisterLink(ctx, request)
|
2021-03-04 22:27:12 +08:00
|
|
|
}
|