2021-04-19 03:12:56 +00: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-06-18 13:30:08 +00:00
|
|
|
package grpcrootcoord
|
2021-01-19 06:44:03 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-02-24 01:48:17 +00:00
|
|
|
"io"
|
2021-01-19 06:44:03 +00:00
|
|
|
"net"
|
2021-02-27 02:11:52 +00:00
|
|
|
"strconv"
|
2021-01-19 06:44:03 +00:00
|
|
|
"sync"
|
|
|
|
|
2021-02-27 02:11:52 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
|
2021-06-18 13:30:08 +00:00
|
|
|
grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
2021-06-22 02:42:07 +00:00
|
|
|
dsc "github.com/milvus-io/milvus/internal/distributed/datacoord/client"
|
2021-06-21 09:28:03 +00:00
|
|
|
isc "github.com/milvus-io/milvus/internal/distributed/indexcoord/client"
|
2021-06-22 06:40:07 +00:00
|
|
|
pnc "github.com/milvus-io/milvus/internal/distributed/proxy/client"
|
2021-06-22 08:44:09 +00:00
|
|
|
qsc "github.com/milvus-io/milvus/internal/distributed/querycoord/client"
|
2021-04-22 06:45:57 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/log"
|
|
|
|
"github.com/milvus-io/milvus/internal/msgstream"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/commonpb"
|
2021-07-01 06:58:17 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/datapb"
|
2021-04-22 06:45:57 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/milvuspb"
|
2021-06-17 09:45:56 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/proxypb"
|
2021-06-22 08:14:09 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
|
2021-06-18 13:30:08 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/rootcoord"
|
|
|
|
"github.com/milvus-io/milvus/internal/types"
|
2021-04-22 06:45:57 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/util/funcutil"
|
2021-05-26 12:14:30 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/util/sessionutil"
|
2021-06-18 13:30:08 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/util/trace"
|
2021-01-19 06:44:03 +00:00
|
|
|
)
|
|
|
|
|
2021-06-04 08:29:35 +00:00
|
|
|
// Server grpc wrapper
|
2021-02-23 03:40:30 +00:00
|
|
|
type Server struct {
|
2021-06-21 09:28:03 +00:00
|
|
|
rootCoord types.RootCoordComponent
|
2021-06-17 08:47:57 +00:00
|
|
|
grpcServer *grpc.Server
|
|
|
|
grpcErrChan chan error
|
2021-02-23 03:40:30 +00:00
|
|
|
|
|
|
|
wg sync.WaitGroup
|
2021-01-19 06:44:03 +00:00
|
|
|
|
|
|
|
ctx context.Context
|
|
|
|
cancel context.CancelFunc
|
2021-02-23 03:40:30 +00:00
|
|
|
|
2021-06-21 10:22:13 +00:00
|
|
|
dataCoord types.DataCoord
|
2021-06-21 09:28:03 +00:00
|
|
|
indexCoord types.IndexCoord
|
2021-06-22 08:44:09 +00:00
|
|
|
queryCoord types.QueryCoord
|
2021-02-23 03:40:30 +00:00
|
|
|
|
2021-06-24 11:05:06 +00:00
|
|
|
newIndexCoordClient func(string, []string) types.IndexCoord
|
|
|
|
newDataCoordClient func(string, []string) types.DataCoord
|
|
|
|
newQueryCoordClient func(string, []string) types.QueryCoord
|
2021-04-24 09:23:35 +00:00
|
|
|
|
2021-02-24 01:48:17 +00:00
|
|
|
closer io.Closer
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-09-18 03:13:51 +00:00
|
|
|
func (s *Server) CreateAlias(ctx context.Context, request *milvuspb.CreateAliasRequest) (*commonpb.Status, error) {
|
|
|
|
return s.rootCoord.CreateAlias(ctx, request)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) DropAlias(ctx context.Context, request *milvuspb.DropAliasRequest) (*commonpb.Status, error) {
|
|
|
|
return s.rootCoord.DropAlias(ctx, request)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) AlterAlias(ctx context.Context, request *milvuspb.AlterAliasRequest) (*commonpb.Status, error) {
|
|
|
|
return s.rootCoord.AlterAlias(ctx, request)
|
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func NewServer(ctx context.Context, factory msgstream.Factory) (*Server, error) {
|
|
|
|
ctx1, cancel := context.WithCancel(ctx)
|
|
|
|
s := &Server{
|
2021-05-25 06:03:06 +00:00
|
|
|
ctx: ctx1,
|
|
|
|
cancel: cancel,
|
|
|
|
grpcErrChan: make(chan error),
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-04-24 09:23:35 +00:00
|
|
|
s.setClient()
|
2021-03-22 17:49:50 +00:00
|
|
|
var err error
|
2021-06-18 13:30:08 +00:00
|
|
|
s.rootCoord, err = rootcoord.NewCore(s.ctx, factory)
|
2021-02-23 03:40:30 +00:00
|
|
|
if err != nil {
|
2021-01-19 06:44:03 +00:00
|
|
|
return nil, err
|
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
return s, err
|
|
|
|
}
|
2021-02-08 06:30:54 +00:00
|
|
|
|
2021-04-24 09:23:35 +00:00
|
|
|
func (s *Server) setClient() {
|
2021-06-24 11:05:06 +00:00
|
|
|
s.newDataCoordClient = func(etcdMetaRoot string, etcdEndpoints []string) types.DataCoord {
|
|
|
|
dsClient, err := dsc.NewClient(s.ctx, etcdMetaRoot, etcdEndpoints)
|
2021-06-23 01:24:10 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2021-05-25 06:03:06 +00:00
|
|
|
return dsClient
|
2021-04-24 09:23:35 +00:00
|
|
|
}
|
2021-06-24 11:05:06 +00:00
|
|
|
s.newIndexCoordClient = func(metaRootPath string, etcdEndpoints []string) types.IndexCoord {
|
|
|
|
isClient, err := isc.NewClient(s.ctx, metaRootPath, etcdEndpoints)
|
2021-06-23 01:24:10 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2021-05-25 06:03:06 +00:00
|
|
|
return isClient
|
2021-04-24 09:23:35 +00:00
|
|
|
}
|
2021-06-24 11:05:06 +00:00
|
|
|
s.newQueryCoordClient = func(metaRootPath string, etcdEndpoints []string) types.QueryCoord {
|
|
|
|
qsClient, err := qsc.NewClient(s.ctx, metaRootPath, etcdEndpoints)
|
2021-05-25 06:03:06 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2021-06-03 11:01:33 +00:00
|
|
|
return qsClient
|
2021-04-24 09:23:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) Run() error {
|
|
|
|
if err := s.init(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := s.start(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) init() error {
|
|
|
|
Params.Init()
|
2021-03-22 17:49:50 +00:00
|
|
|
|
2021-06-18 13:30:08 +00:00
|
|
|
rootcoord.Params.Init()
|
|
|
|
rootcoord.Params.Address = Params.Address
|
|
|
|
rootcoord.Params.Port = Params.Port
|
2021-03-22 17:49:50 +00:00
|
|
|
log.Debug("grpc init done ...")
|
|
|
|
|
2021-06-17 08:47:57 +00:00
|
|
|
closer := trace.InitTracing("root_coord")
|
2021-03-22 17:49:50 +00:00
|
|
|
s.closer = closer
|
|
|
|
|
2021-02-27 02:11:52 +00:00
|
|
|
log.Debug("init params done")
|
2021-02-23 03:40:30 +00:00
|
|
|
|
2021-06-17 08:47:57 +00:00
|
|
|
err := s.rootCoord.Register()
|
2021-05-25 07:06:05 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = s.startGrpc()
|
|
|
|
if err != nil {
|
2021-02-23 03:40:30 +00:00
|
|
|
return err
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
|
2021-06-17 08:47:57 +00:00
|
|
|
s.rootCoord.UpdateStateCode(internalpb.StateCode_Initializing)
|
2021-06-18 13:30:08 +00:00
|
|
|
log.Debug("RootCoord", zap.Any("State", internalpb.StateCode_Initializing))
|
2021-06-17 08:47:57 +00:00
|
|
|
s.rootCoord.SetNewProxyClient(
|
2021-06-23 03:18:05 +00:00
|
|
|
func(se *sessionutil.Session) (types.Proxy, error) {
|
2021-06-24 11:05:06 +00:00
|
|
|
cli, err := pnc.NewClient(s.ctx, se.Address)
|
2021-06-23 01:24:10 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2021-05-26 12:14:30 +00:00
|
|
|
if err := cli.Init(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if err := cli.Start(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return cli, nil
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2021-06-17 08:47:57 +00:00
|
|
|
if s.newDataCoordClient != nil {
|
2021-06-18 13:30:08 +00:00
|
|
|
log.Debug("RootCoord start to create DataCoord client")
|
2021-06-24 11:05:06 +00:00
|
|
|
dataCoord := s.newDataCoordClient(rootcoord.Params.MetaRootPath, rootcoord.Params.EtcdEndpoints)
|
2021-06-23 03:18:05 +00:00
|
|
|
if err := s.rootCoord.SetDataCoord(s.ctx, dataCoord); err != nil {
|
2021-02-23 03:40:30 +00:00
|
|
|
panic(err)
|
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
s.dataCoord = dataCoord
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-06-17 08:47:57 +00:00
|
|
|
if s.newIndexCoordClient != nil {
|
2021-06-18 13:30:08 +00:00
|
|
|
log.Debug("RootCoord start to create IndexCoord client")
|
2021-06-24 11:05:06 +00:00
|
|
|
indexCoord := s.newIndexCoordClient(rootcoord.Params.MetaRootPath, rootcoord.Params.EtcdEndpoints)
|
2021-06-18 13:30:08 +00:00
|
|
|
if err := s.rootCoord.SetIndexCoord(indexCoord); err != nil {
|
2021-02-23 03:40:30 +00:00
|
|
|
panic(err)
|
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
s.indexCoord = indexCoord
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-06-17 08:47:57 +00:00
|
|
|
if s.newQueryCoordClient != nil {
|
2021-06-18 13:30:08 +00:00
|
|
|
log.Debug("RootCoord start to create QueryCoord client")
|
2021-06-24 11:05:06 +00:00
|
|
|
queryCoord := s.newQueryCoordClient(rootcoord.Params.MetaRootPath, rootcoord.Params.EtcdEndpoints)
|
2021-06-18 13:30:08 +00:00
|
|
|
if err := s.rootCoord.SetQueryCoord(queryCoord); err != nil {
|
2021-02-23 03:40:30 +00:00
|
|
|
panic(err)
|
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
s.queryCoord = queryCoord
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-05-25 06:03:06 +00:00
|
|
|
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.Init()
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) startGrpc() error {
|
|
|
|
s.wg.Add(1)
|
|
|
|
go s.startGrpcLoop(Params.Port)
|
|
|
|
// wait for grpc server loop start
|
|
|
|
err := <-s.grpcErrChan
|
2021-01-19 06:44:03 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) startGrpcLoop(grpcPort int) {
|
|
|
|
defer s.wg.Done()
|
|
|
|
|
2021-02-27 02:11:52 +00:00
|
|
|
log.Debug("start grpc ", zap.Int("port", grpcPort))
|
2021-02-23 03:40:30 +00:00
|
|
|
lis, err := net.Listen("tcp", ":"+strconv.Itoa(grpcPort))
|
|
|
|
if err != nil {
|
2021-02-27 02:11:52 +00:00
|
|
|
log.Error("GrpcServer:failed to listen", zap.String("error", err.Error()))
|
2021-02-23 03:40:30 +00:00
|
|
|
s.grpcErrChan <- err
|
|
|
|
return
|
2021-01-25 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
ctx, cancel := context.WithCancel(s.ctx)
|
|
|
|
defer cancel()
|
|
|
|
|
2021-06-17 06:17:56 +00:00
|
|
|
opts := trace.GetInterceptorOpts()
|
2021-03-08 07:49:42 +00:00
|
|
|
s.grpcServer = grpc.NewServer(
|
2021-08-04 05:03:24 +00:00
|
|
|
grpc.MaxRecvMsgSize(Params.ServerMaxRecvSize),
|
|
|
|
grpc.MaxSendMsgSize(Params.ServerMaxSendSize),
|
2021-06-22 08:14:09 +00:00
|
|
|
grpc.UnaryInterceptor(grpc_opentracing.UnaryServerInterceptor(opts...)),
|
|
|
|
grpc.StreamInterceptor(grpc_opentracing.StreamServerInterceptor(opts...)))
|
|
|
|
rootcoordpb.RegisterRootCoordServer(s.grpcServer, s)
|
2021-02-23 03:40:30 +00:00
|
|
|
|
|
|
|
go funcutil.CheckGrpcReady(ctx, s.grpcErrChan)
|
|
|
|
if err := s.grpcServer.Serve(lis); err != nil {
|
|
|
|
s.grpcErrChan <- err
|
2021-01-25 10:33:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) start() error {
|
2021-06-23 08:14:08 +00:00
|
|
|
log.Debug("RootCoord Core start ...")
|
2021-06-17 08:47:57 +00:00
|
|
|
if err := s.rootCoord.Start(); err != nil {
|
2021-02-23 03:40:30 +00:00
|
|
|
return err
|
2021-01-25 10:33:10 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
return nil
|
2021-01-25 10:33:10 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) Stop() error {
|
2021-03-22 17:49:50 +00:00
|
|
|
if s.closer != nil {
|
|
|
|
if err := s.closer.Close(); err != nil {
|
2021-03-30 02:52:42 +00:00
|
|
|
log.Error("close opentracing", zap.Error(err))
|
2021-03-22 17:49:50 +00:00
|
|
|
}
|
2021-02-24 01:48:17 +00:00
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
if s.indexCoord != nil {
|
|
|
|
if err := s.indexCoord.Stop(); err != nil {
|
|
|
|
log.Debug("close indexCoord client", zap.Error(err))
|
2021-03-29 01:50:52 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
if s.dataCoord != nil {
|
|
|
|
if err := s.dataCoord.Stop(); err != nil {
|
|
|
|
log.Debug("close dataCoord client", zap.Error(err))
|
2021-03-29 01:50:52 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
if s.queryCoord != nil {
|
|
|
|
if err := s.queryCoord.Stop(); err != nil {
|
|
|
|
log.Debug("close queryCoord client", zap.Error(err))
|
2021-03-29 01:50:52 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
2021-06-17 08:47:57 +00:00
|
|
|
if s.rootCoord != nil {
|
|
|
|
if err := s.rootCoord.Stop(); err != nil {
|
|
|
|
log.Debug("close rootCoord", zap.Error(err))
|
2021-03-29 01:50:52 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
}
|
|
|
|
s.cancel()
|
|
|
|
if s.grpcServer != nil {
|
|
|
|
s.grpcServer.GracefulStop()
|
2021-02-05 06:09:55 +00:00
|
|
|
}
|
2021-02-23 03:40:30 +00:00
|
|
|
s.wg.Wait()
|
|
|
|
return nil
|
2021-02-05 06:09:55 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
func (s *Server) GetComponentStates(ctx context.Context, req *internalpb.GetComponentStatesRequest) (*internalpb.ComponentStates, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.GetComponentStates(ctx)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-06-04 08:29:35 +00:00
|
|
|
// GetTimeTickChannel receiver time tick from proxy service, and put it into this channel
|
2021-03-12 06:22:09 +00:00
|
|
|
func (s *Server) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.GetTimeTickChannel(ctx)
|
2021-03-12 06:22:09 +00:00
|
|
|
}
|
|
|
|
|
2021-06-04 08:29:35 +00:00
|
|
|
// GetStatisticsChannel just define a channel, not used currently
|
2021-03-12 06:22:09 +00:00
|
|
|
func (s *Server) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.GetStatisticsChannel(ctx)
|
2021-03-12 06:22:09 +00:00
|
|
|
}
|
|
|
|
|
2021-06-04 07:00:34 +00:00
|
|
|
//DDL request
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) CreateCollection(ctx context.Context, in *milvuspb.CreateCollectionRequest) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.CreateCollection(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRequest) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.DropCollection(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-09-18 08:27:51 +00:00
|
|
|
// HasCollection checks whether a collection is created
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.HasCollection(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-09-18 08:46:01 +00:00
|
|
|
// DescribeCollection gets meta info of a collection
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) DescribeCollection(ctx context.Context, in *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.DescribeCollection(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-09-17 03:15:53 +00:00
|
|
|
// ShowCollections gets all collections
|
2021-03-12 06:22:09 +00:00
|
|
|
func (s *Server) ShowCollections(ctx context.Context, in *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.ShowCollections(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-09-17 09:35:53 +00:00
|
|
|
// CreatePartition creates a partition in a collection
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) CreatePartition(ctx context.Context, in *milvuspb.CreatePartitionRequest) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.CreatePartition(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) DropPartition(ctx context.Context, in *milvuspb.DropPartitionRequest) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.DropPartition(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) HasPartition(ctx context.Context, in *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.HasPartition(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
func (s *Server) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.ShowPartitions(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-06-04 08:29:35 +00:00
|
|
|
// CreateIndex index builder service
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) CreateIndex(ctx context.Context, in *milvuspb.CreateIndexRequest) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.CreateIndex(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) DropIndex(ctx context.Context, in *milvuspb.DropIndexRequest) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.DropIndex(ctx, in)
|
2021-02-20 07:38:44 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) DescribeIndex(ctx context.Context, in *milvuspb.DescribeIndexRequest) (*milvuspb.DescribeIndexResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.DescribeIndex(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-06-04 08:29:35 +00:00
|
|
|
// AllocTimestamp global timestamp allocator
|
2021-06-22 08:14:09 +00:00
|
|
|
func (s *Server) AllocTimestamp(ctx context.Context, in *rootcoordpb.AllocTimestampRequest) (*rootcoordpb.AllocTimestampResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.AllocTimestamp(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-06-22 08:14:09 +00:00
|
|
|
func (s *Server) AllocID(ctx context.Context, in *rootcoordpb.AllocIDRequest) (*rootcoordpb.AllocIDResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.AllocID(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-05-21 08:08:12 +00:00
|
|
|
// UpdateChannelTimeTick used to handle ChannelTimeTickMsg
|
|
|
|
func (s *Server) UpdateChannelTimeTick(ctx context.Context, in *internalpb.ChannelTimeTickMsg) (*commonpb.Status, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.UpdateChannelTimeTick(ctx, in)
|
2021-05-21 08:08:12 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 03:40:30 +00:00
|
|
|
func (s *Server) DescribeSegment(ctx context.Context, in *milvuspb.DescribeSegmentRequest) (*milvuspb.DescribeSegmentResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.DescribeSegment(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
|
|
|
|
2021-03-12 06:22:09 +00:00
|
|
|
func (s *Server) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentsRequest) (*milvuspb.ShowSegmentsResponse, error) {
|
2021-06-17 08:47:57 +00:00
|
|
|
return s.rootCoord.ShowSegments(ctx, in)
|
2021-01-19 06:44:03 +00:00
|
|
|
}
|
2021-06-18 13:30:08 +00:00
|
|
|
|
2021-06-17 09:45:56 +00:00
|
|
|
func (s *Server) ReleaseDQLMessageStream(ctx context.Context, in *proxypb.ReleaseDQLMessageStreamRequest) (*commonpb.Status, error) {
|
|
|
|
return s.rootCoord.ReleaseDQLMessageStream(ctx, in)
|
|
|
|
}
|
2021-07-02 03:16:20 +00:00
|
|
|
func (s *Server) SegmentFlushCompleted(ctx context.Context, in *datapb.SegmentFlushCompletedMsg) (*commonpb.Status, error) {
|
2021-07-01 06:58:17 +00:00
|
|
|
return s.rootCoord.SegmentFlushCompleted(ctx, in)
|
|
|
|
}
|
2021-08-31 03:45:59 +00:00
|
|
|
|
|
|
|
func (s *Server) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
|
|
|
|
return s.rootCoord.GetMetrics(ctx, in)
|
|
|
|
}
|