Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
3ef18e86
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3ef18e86
编写于
3月 06, 2021
作者:
N
neza2017
提交者:
yefu.chen
3月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add 0331 tag for test_partition
Signed-off-by:
N
neza2017
<
yefu.chen@zilliz.com
>
上级
efa7306e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
62 addition
and
112 deletion
+62
-112
internal/distributed/masterservice/masterservice_test.go
internal/distributed/masterservice/masterservice_test.go
+3
-3
internal/distributed/masterservice/server.go
internal/distributed/masterservice/server.go
+39
-37
internal/masterservice/master_service.go
internal/masterservice/master_service.go
+11
-69
internal/masterservice/master_service_test.go
internal/masterservice/master_service_test.go
+5
-0
internal/masterservice/meta_table.go
internal/masterservice/meta_table.go
+2
-1
internal/masterservice/meta_table_test.go
internal/masterservice/meta_table_test.go
+1
-2
tests/python_test/test_partition.py
tests/python_test/test_partition.py
+1
-0
未找到文件。
internal/distributed/masterservice/masterservice_test.go
浏览文件 @
3ef18e86
...
...
@@ -64,9 +64,9 @@ func TestGrpcService(t *testing.T) {
err
=
svr
.
startGrpc
()
assert
.
Nil
(
t
,
err
)
svr
.
cor
e
.
UpdateStateCode
(
internalpb2
.
StateCode_INITIALIZING
)
svr
.
masterServic
e
.
UpdateStateCode
(
internalpb2
.
StateCode_INITIALIZING
)
core
:=
svr
.
cor
e
core
:=
svr
.
masterServic
e
err
=
core
.
Init
()
assert
.
Nil
(
t
,
err
)
...
...
@@ -144,7 +144,7 @@ func TestGrpcService(t *testing.T) {
err
=
svr
.
start
()
assert
.
Nil
(
t
,
err
)
svr
.
cor
e
.
UpdateStateCode
(
internalpb2
.
StateCode_HEALTHY
)
svr
.
masterServic
e
.
UpdateStateCode
(
internalpb2
.
StateCode_HEALTHY
)
cli
,
err
:=
grpcmasterserviceclient
.
NewClient
(
Params
.
Address
,
3
*
time
.
Second
)
assert
.
Nil
(
t
,
err
)
...
...
internal/distributed/masterservice/server.go
浏览文件 @
3ef18e86
...
...
@@ -22,6 +22,8 @@ import (
"github.com/zilliztech/milvus-distributed/internal/log"
cms
"github.com/zilliztech/milvus-distributed/internal/masterservice"
"github.com/zilliztech/milvus-distributed/internal/msgstream"
"github.com/zilliztech/milvus-distributed/internal/types"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
"github.com/zilliztech/milvus-distributed/internal/proto/masterpb"
...
...
@@ -31,19 +33,19 @@ import (
// grpc wrapper
type
Server
struct
{
core
*
cms
.
Core
grpcServer
*
grpc
.
Server
grpcErrChan
chan
error
masterService
*
cms
.
Core
grpcServer
*
grpc
.
Server
grpcErrChan
chan
error
wg
sync
.
WaitGroup
ctx
context
.
Context
cancel
context
.
CancelFunc
proxyService
*
psc
.
Client
dataService
*
dsc
.
Client
indexService
*
isc
.
Client
queryService
*
qsc
.
Client
proxyService
types
.
ProxyService
dataService
types
.
DataService
indexService
types
.
IndexService
queryService
types
.
QueryService
connectProxyService
bool
connectDataService
bool
...
...
@@ -82,7 +84,7 @@ func NewServer(ctx context.Context, factory msgstream.Factory) (*Server, error)
opentracing
.
SetGlobalTracer
(
tracer
)
s
.
closer
=
closer
s
.
cor
e
,
err
=
cms
.
NewCore
(
s
.
ctx
,
factory
)
s
.
masterServic
e
,
err
=
cms
.
NewCore
(
s
.
ctx
,
factory
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -111,7 +113,7 @@ func (s *Server) init() error {
return
err
}
s
.
cor
e
.
UpdateStateCode
(
internalpb2
.
StateCode_INITIALIZING
)
s
.
masterServic
e
.
UpdateStateCode
(
internalpb2
.
StateCode_INITIALIZING
)
if
s
.
connectProxyService
{
log
.
Debug
(
"proxy service"
,
zap
.
String
(
"address"
,
Params
.
ProxyServiceAddress
))
...
...
@@ -125,7 +127,7 @@ func (s *Server) init() error {
panic
(
err
)
}
if
err
=
s
.
cor
e
.
SetProxyService
(
ctx
,
proxyService
);
err
!=
nil
{
if
err
=
s
.
masterServic
e
.
SetProxyService
(
ctx
,
proxyService
);
err
!=
nil
{
panic
(
err
)
}
}
...
...
@@ -143,7 +145,7 @@ func (s *Server) init() error {
panic
(
err
)
}
if
err
=
s
.
cor
e
.
SetDataService
(
ctx
,
dataService
);
err
!=
nil
{
if
err
=
s
.
masterServic
e
.
SetDataService
(
ctx
,
dataService
);
err
!=
nil
{
panic
(
err
)
}
}
...
...
@@ -154,7 +156,7 @@ func (s *Server) init() error {
panic
(
err
)
}
if
err
:=
s
.
cor
e
.
SetIndexService
(
ctx
,
indexService
);
err
!=
nil
{
if
err
:=
s
.
masterServic
e
.
SetIndexService
(
ctx
,
indexService
);
err
!=
nil
{
panic
(
err
)
}
...
...
@@ -170,14 +172,14 @@ func (s *Server) init() error {
if
err
=
queryService
.
Start
();
err
!=
nil
{
panic
(
err
)
}
if
err
=
s
.
cor
e
.
SetQueryService
(
ctx
,
queryService
);
err
!=
nil
{
if
err
=
s
.
masterServic
e
.
SetQueryService
(
ctx
,
queryService
);
err
!=
nil
{
panic
(
err
)
}
}
cms
.
Params
.
Init
()
log
.
Debug
(
"grpc init done ..."
)
if
err
:=
s
.
cor
e
.
Init
();
err
!=
nil
{
if
err
:=
s
.
masterServic
e
.
Init
();
err
!=
nil
{
return
err
}
return
nil
...
...
@@ -222,7 +224,7 @@ func (s *Server) startGrpcLoop(grpcPort int) {
func
(
s
*
Server
)
start
()
error
{
log
.
Debug
(
"Master Core start ..."
)
if
err
:=
s
.
cor
e
.
Start
();
err
!=
nil
{
if
err
:=
s
.
masterServic
e
.
Start
();
err
!=
nil
{
return
err
}
return
nil
...
...
@@ -244,8 +246,8 @@ func (s *Server) Stop() error {
if
s
.
queryService
!=
nil
{
_
=
s
.
queryService
.
Stop
()
}
if
s
.
cor
e
!=
nil
{
return
s
.
cor
e
.
Stop
()
if
s
.
masterServic
e
!=
nil
{
return
s
.
masterServic
e
.
Stop
()
}
s
.
cancel
()
if
s
.
grpcServer
!=
nil
{
...
...
@@ -256,87 +258,87 @@ func (s *Server) Stop() error {
}
func
(
s
*
Server
)
GetComponentStatesRPC
(
ctx
context
.
Context
,
empty
*
commonpb
.
Empty
)
(
*
internalpb2
.
ComponentStates
,
error
)
{
return
s
.
cor
e
.
GetComponentStates
(
ctx
)
return
s
.
masterServic
e
.
GetComponentStates
(
ctx
)
}
//DDL request
func
(
s
*
Server
)
CreateCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
CreateCollectionRequest
)
(
*
commonpb
.
Status
,
error
)
{
return
s
.
cor
e
.
CreateCollection
(
ctx
,
in
)
return
s
.
masterServic
e
.
CreateCollection
(
ctx
,
in
)
}
func
(
s
*
Server
)
DropCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
DropCollectionRequest
)
(
*
commonpb
.
Status
,
error
)
{
return
s
.
cor
e
.
DropCollection
(
ctx
,
in
)
return
s
.
masterServic
e
.
DropCollection
(
ctx
,
in
)
}
func
(
s
*
Server
)
HasCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
HasCollectionRequest
)
(
*
milvuspb
.
BoolResponse
,
error
)
{
return
s
.
cor
e
.
HasCollection
(
ctx
,
in
)
return
s
.
masterServic
e
.
HasCollection
(
ctx
,
in
)
}
func
(
s
*
Server
)
DescribeCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
DescribeCollectionRequest
)
(
*
milvuspb
.
DescribeCollectionResponse
,
error
)
{
return
s
.
cor
e
.
DescribeCollection
(
ctx
,
in
)
return
s
.
masterServic
e
.
DescribeCollection
(
ctx
,
in
)
}
func
(
s
*
Server
)
ShowCollections
(
ctx
context
.
Context
,
in
*
milvuspb
.
ShowCollectionRequest
)
(
*
milvuspb
.
ShowCollectionResponse
,
error
)
{
return
s
.
cor
e
.
ShowCollections
(
ctx
,
in
)
return
s
.
masterServic
e
.
ShowCollections
(
ctx
,
in
)
}
func
(
s
*
Server
)
CreatePartition
(
ctx
context
.
Context
,
in
*
milvuspb
.
CreatePartitionRequest
)
(
*
commonpb
.
Status
,
error
)
{
return
s
.
cor
e
.
CreatePartition
(
ctx
,
in
)
return
s
.
masterServic
e
.
CreatePartition
(
ctx
,
in
)
}
func
(
s
*
Server
)
DropPartition
(
ctx
context
.
Context
,
in
*
milvuspb
.
DropPartitionRequest
)
(
*
commonpb
.
Status
,
error
)
{
return
s
.
cor
e
.
DropPartition
(
ctx
,
in
)
return
s
.
masterServic
e
.
DropPartition
(
ctx
,
in
)
}
func
(
s
*
Server
)
HasPartition
(
ctx
context
.
Context
,
in
*
milvuspb
.
HasPartitionRequest
)
(
*
milvuspb
.
BoolResponse
,
error
)
{
return
s
.
cor
e
.
HasPartition
(
ctx
,
in
)
return
s
.
masterServic
e
.
HasPartition
(
ctx
,
in
)
}
func
(
s
*
Server
)
ShowPartitions
(
ctx
context
.
Context
,
in
*
milvuspb
.
ShowPartitionRequest
)
(
*
milvuspb
.
ShowPartitionResponse
,
error
)
{
return
s
.
cor
e
.
ShowPartitions
(
ctx
,
in
)
return
s
.
masterServic
e
.
ShowPartitions
(
ctx
,
in
)
}
//index builder service
func
(
s
*
Server
)
CreateIndex
(
ctx
context
.
Context
,
in
*
milvuspb
.
CreateIndexRequest
)
(
*
commonpb
.
Status
,
error
)
{
return
s
.
cor
e
.
CreateIndex
(
ctx
,
in
)
return
s
.
masterServic
e
.
CreateIndex
(
ctx
,
in
)
}
func
(
s
*
Server
)
DropIndex
(
ctx
context
.
Context
,
in
*
milvuspb
.
DropIndexRequest
)
(
*
commonpb
.
Status
,
error
)
{
return
s
.
cor
e
.
DropIndex
(
ctx
,
in
)
return
s
.
masterServic
e
.
DropIndex
(
ctx
,
in
)
}
func
(
s
*
Server
)
DescribeIndex
(
ctx
context
.
Context
,
in
*
milvuspb
.
DescribeIndexRequest
)
(
*
milvuspb
.
DescribeIndexResponse
,
error
)
{
return
s
.
cor
e
.
DescribeIndex
(
ctx
,
in
)
return
s
.
masterServic
e
.
DescribeIndex
(
ctx
,
in
)
}
//global timestamp allocator
func
(
s
*
Server
)
AllocTimestamp
(
ctx
context
.
Context
,
in
*
masterpb
.
TsoRequest
)
(
*
masterpb
.
TsoResponse
,
error
)
{
return
s
.
cor
e
.
AllocTimestamp
(
ctx
,
in
)
return
s
.
masterServic
e
.
AllocTimestamp
(
ctx
,
in
)
}
func
(
s
*
Server
)
AllocID
(
ctx
context
.
Context
,
in
*
masterpb
.
IDRequest
)
(
*
masterpb
.
IDResponse
,
error
)
{
return
s
.
cor
e
.
AllocID
(
ctx
,
in
)
return
s
.
masterServic
e
.
AllocID
(
ctx
,
in
)
}
//receiver time tick from proxy service, and put it into this channel
func
(
s
*
Server
)
GetTimeTickChannelRPC
(
ctx
context
.
Context
,
empty
*
commonpb
.
Empty
)
(
*
milvuspb
.
StringResponse
,
error
)
{
return
s
.
cor
e
.
GetTimeTickChannel
(
ctx
)
return
s
.
masterServic
e
.
GetTimeTickChannel
(
ctx
)
}
//receive ddl from rpc and time tick from proxy service, and put them into this channel
func
(
s
*
Server
)
GetDdChannelRPC
(
ctx
context
.
Context
,
in
*
commonpb
.
Empty
)
(
*
milvuspb
.
StringResponse
,
error
)
{
return
s
.
cor
e
.
GetDdChannel
(
ctx
)
return
s
.
masterServic
e
.
GetDdChannel
(
ctx
)
}
//just define a channel, not used currently
func
(
s
*
Server
)
GetStatisticsChannelRPC
(
ctx
context
.
Context
,
empty
*
commonpb
.
Empty
)
(
*
milvuspb
.
StringResponse
,
error
)
{
return
s
.
cor
e
.
GetStatisticsChannel
(
ctx
)
return
s
.
masterServic
e
.
GetStatisticsChannel
(
ctx
)
}
func
(
s
*
Server
)
DescribeSegment
(
ctx
context
.
Context
,
in
*
milvuspb
.
DescribeSegmentRequest
)
(
*
milvuspb
.
DescribeSegmentResponse
,
error
)
{
return
s
.
cor
e
.
DescribeSegment
(
ctx
,
in
)
return
s
.
masterServic
e
.
DescribeSegment
(
ctx
,
in
)
}
func
(
s
*
Server
)
ShowSegments
(
ctx
context
.
Context
,
in
*
milvuspb
.
ShowSegmentRequest
)
(
*
milvuspb
.
ShowSegmentResponse
,
error
)
{
return
s
.
cor
e
.
ShowSegments
(
ctx
,
in
)
return
s
.
masterServic
e
.
ShowSegments
(
ctx
,
in
)
}
internal/masterservice/master_service.go
浏览文件 @
3ef18e86
...
...
@@ -2,6 +2,7 @@ package masterservice
import
(
"context"
"errors"
"fmt"
"math/rand"
"sync"
...
...
@@ -11,12 +12,16 @@ import (
"go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
"errors"
"github.com/zilliztech/milvus-distributed/internal/allocator"
etcdkv
"github.com/zilliztech/milvus-distributed/internal/kv/etcd"
"github.com/zilliztech/milvus-distributed/internal/log"
ms
"github.com/zilliztech/milvus-distributed/internal/msgstream"
"github.com/zilliztech/milvus-distributed/internal/tso"
"github.com/zilliztech/milvus-distributed/internal/types"
"github.com/zilliztech/milvus-distributed/internal/util/retry"
"github.com/zilliztech/milvus-distributed/internal/util/tsoutil"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/datapb"
"github.com/zilliztech/milvus-distributed/internal/proto/indexpb"
...
...
@@ -25,10 +30,6 @@ import (
"github.com/zilliztech/milvus-distributed/internal/proto/milvuspb"
"github.com/zilliztech/milvus-distributed/internal/proto/proxypb"
"github.com/zilliztech/milvus-distributed/internal/proto/querypb"
"github.com/zilliztech/milvus-distributed/internal/tso"
"github.com/zilliztech/milvus-distributed/internal/util/retry"
"github.com/zilliztech/milvus-distributed/internal/util/tsoutil"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
)
// internalpb2 -> internalpb
...
...
@@ -39,65 +40,6 @@ import (
// milvuspb -> milvuspb
// masterpb2 -> masterpb (master_service)
type
ProxyServiceInterface
interface
{
GetTimeTickChannel
(
ctx
context
.
Context
)
(
*
milvuspb
.
StringResponse
,
error
)
InvalidateCollectionMetaCache
(
ctx
context
.
Context
,
request
*
proxypb
.
InvalidateCollMetaCacheRequest
)
(
*
commonpb
.
Status
,
error
)
}
type
DataServiceInterface
interface
{
GetInsertBinlogPaths
(
ctx
context
.
Context
,
req
*
datapb
.
InsertBinlogPathRequest
)
(
*
datapb
.
InsertBinlogPathsResponse
,
error
)
GetSegmentInfoChannel
(
ctx
context
.
Context
)
(
*
milvuspb
.
StringResponse
,
error
)
}
type
IndexServiceInterface
interface
{
BuildIndex
(
ctx
context
.
Context
,
req
*
indexpb
.
BuildIndexRequest
)
(
*
indexpb
.
BuildIndexResponse
,
error
)
DropIndex
(
ctx
context
.
Context
,
req
*
indexpb
.
DropIndexRequest
)
(
*
commonpb
.
Status
,
error
)
}
type
QueryServiceInterface
interface
{
ReleaseCollection
(
ctx
context
.
Context
,
req
*
querypb
.
ReleaseCollectionRequest
)
(
*
commonpb
.
Status
,
error
)
}
type
Interface
interface
{
//service
typeutil
.
Component
//DDL request
CreateCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
CreateCollectionRequest
)
(
*
commonpb
.
Status
,
error
)
DropCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
DropCollectionRequest
)
(
*
commonpb
.
Status
,
error
)
HasCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
HasCollectionRequest
)
(
*
milvuspb
.
BoolResponse
,
error
)
DescribeCollection
(
ctx
context
.
Context
,
in
*
milvuspb
.
DescribeCollectionRequest
)
(
*
milvuspb
.
DescribeCollectionResponse
,
error
)
ShowCollections
(
ctx
context
.
Context
,
in
*
milvuspb
.
ShowCollectionRequest
)
(
*
milvuspb
.
ShowCollectionResponse
,
error
)
CreatePartition
(
ctx
context
.
Context
,
in
*
milvuspb
.
CreatePartitionRequest
)
(
*
commonpb
.
Status
,
error
)
DropPartition
(
ctx
context
.
Context
,
in
*
milvuspb
.
DropPartitionRequest
)
(
*
commonpb
.
Status
,
error
)
HasPartition
(
ctx
context
.
Context
,
in
*
milvuspb
.
HasPartitionRequest
)
(
*
milvuspb
.
BoolResponse
,
error
)
ShowPartitions
(
ctx
context
.
Context
,
in
*
milvuspb
.
ShowPartitionRequest
)
(
*
milvuspb
.
ShowPartitionResponse
,
error
)
//index builder service
CreateIndex
(
ctx
context
.
Context
,
in
*
milvuspb
.
CreateIndexRequest
)
(
*
commonpb
.
Status
,
error
)
DescribeIndex
(
ctx
context
.
Context
,
in
*
milvuspb
.
DescribeIndexRequest
)
(
*
milvuspb
.
DescribeIndexResponse
,
error
)
DropIndex
(
ctx
context
.
Context
,
in
*
milvuspb
.
DropIndexRequest
)
(
*
commonpb
.
Status
,
error
)
//global timestamp allocator
AllocTimestamp
(
ctx
context
.
Context
,
in
*
masterpb
.
TsoRequest
)
(
*
masterpb
.
TsoResponse
,
error
)
AllocID
(
ctx
context
.
Context
,
in
*
masterpb
.
IDRequest
)
(
*
masterpb
.
IDResponse
,
error
)
//TODO, master load these channel form config file ?
//receiver time tick from proxy service, and put it into this channel
GetTimeTickChannel
(
ctx
context
.
Context
)
(
*
milvuspb
.
StringResponse
,
error
)
//receive ddl from rpc and time tick from proxy service, and put them into this channel
GetDdChannel
(
ctx
context
.
Context
)
(
*
milvuspb
.
StringResponse
,
error
)
//just define a channel, not used currently
GetStatisticsChannel
(
ctx
context
.
Context
)
(
*
milvuspb
.
StringResponse
,
error
)
//segment
DescribeSegment
(
ctx
context
.
Context
,
in
*
milvuspb
.
DescribeSegmentRequest
)
(
*
milvuspb
.
DescribeSegmentResponse
,
error
)
ShowSegments
(
ctx
context
.
Context
,
in
*
milvuspb
.
ShowSegmentRequest
)
(
*
milvuspb
.
ShowSegmentResponse
,
error
)
}
// ------------------ struct -----------------------
// master core
...
...
@@ -642,7 +584,7 @@ func (c *Core) setMsgStreams() error {
return
nil
}
func
(
c
*
Core
)
SetProxyService
(
ctx
context
.
Context
,
s
ProxyServiceInterfa
ce
)
error
{
func
(
c
*
Core
)
SetProxyService
(
ctx
context
.
Context
,
s
types
.
ProxyServi
ce
)
error
{
rsp
,
err
:=
s
.
GetTimeTickChannel
(
ctx
)
if
err
!=
nil
{
return
err
...
...
@@ -672,7 +614,7 @@ func (c *Core) SetProxyService(ctx context.Context, s ProxyServiceInterface) err
return
nil
}
func
(
c
*
Core
)
SetDataService
(
ctx
context
.
Context
,
s
DataServiceInterfa
ce
)
error
{
func
(
c
*
Core
)
SetDataService
(
ctx
context
.
Context
,
s
types
.
DataServi
ce
)
error
{
rsp
,
err
:=
s
.
GetSegmentInfoChannel
(
ctx
)
if
err
!=
nil
{
return
err
...
...
@@ -710,7 +652,7 @@ func (c *Core) SetDataService(ctx context.Context, s DataServiceInterface) error
return
nil
}
func
(
c
*
Core
)
SetIndexService
(
ctx
context
.
Context
,
s
IndexServiceInterfa
ce
)
error
{
func
(
c
*
Core
)
SetIndexService
(
ctx
context
.
Context
,
s
types
.
IndexServi
ce
)
error
{
c
.
BuildIndexReq
=
func
(
binlog
[]
string
,
typeParams
[]
*
commonpb
.
KeyValuePair
,
indexParams
[]
*
commonpb
.
KeyValuePair
,
indexID
typeutil
.
UniqueID
,
indexName
string
)
(
typeutil
.
UniqueID
,
error
)
{
rsp
,
err
:=
s
.
BuildIndex
(
ctx
,
&
indexpb
.
BuildIndexRequest
{
DataPaths
:
binlog
,
...
...
@@ -744,7 +686,7 @@ func (c *Core) SetIndexService(ctx context.Context, s IndexServiceInterface) err
return
nil
}
func
(
c
*
Core
)
SetQueryService
(
ctx
context
.
Context
,
s
QueryServiceInterfa
ce
)
error
{
func
(
c
*
Core
)
SetQueryService
(
ctx
context
.
Context
,
s
types
.
QueryServi
ce
)
error
{
c
.
ReleaseCollection
=
func
(
ts
typeutil
.
Timestamp
,
dbID
typeutil
.
UniqueID
,
collectionID
typeutil
.
UniqueID
)
error
{
req
:=
&
querypb
.
ReleaseCollectionRequest
{
Base
:
&
commonpb
.
MsgBase
{
...
...
internal/masterservice/master_service_test.go
浏览文件 @
3ef18e86
...
...
@@ -20,10 +20,12 @@ import (
"github.com/zilliztech/milvus-distributed/internal/proto/proxypb"
"github.com/zilliztech/milvus-distributed/internal/proto/querypb"
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
"github.com/zilliztech/milvus-distributed/internal/types"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
)
type
proxyMock
struct
{
types
.
ProxyService
randVal
int
collArray
[]
string
mutex
sync
.
Mutex
...
...
@@ -54,6 +56,7 @@ func (p *proxyMock) GetCollArray() []string {
}
type
dataMock
struct
{
types
.
DataService
randVal
int
}
...
...
@@ -81,6 +84,7 @@ func (d *dataMock) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertB
}
type
queryMock
struct
{
types
.
QueryService
collID
[]
typeutil
.
UniqueID
mutex
sync
.
Mutex
}
...
...
@@ -105,6 +109,7 @@ func (d *dataMock) GetSegmentInfoChannel(ctx context.Context) (*milvuspb.StringR
}
type
indexMock
struct
{
types
.
IndexService
fileArray
[]
string
idxBuildID
[]
int64
idxID
[]
int64
...
...
internal/masterservice/meta_table.go
浏览文件 @
3ef18e86
...
...
@@ -13,11 +13,12 @@ import (
"github.com/zilliztech/milvus-distributed/internal/kv"
"github.com/zilliztech/milvus-distributed/internal/log"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/datapb"
pb
"github.com/zilliztech/milvus-distributed/internal/proto/etcdpb"
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
)
const
(
...
...
internal/masterservice/meta_table_test.go
浏览文件 @
3ef18e86
...
...
@@ -164,8 +164,7 @@ func TestMetaTable(t *testing.T) {
IndexParams
:
params
,
}
ids
,
_
,
err
:=
mt
.
GetNotIndexedSegments
(
"collTest"
,
"field110"
,
idxInfo
)
assert
.
Nil
(
t
,
ids
)
_
,
_
,
err
:=
mt
.
GetNotIndexedSegments
(
"collTest"
,
"field110"
,
idxInfo
)
assert
.
NotNil
(
t
,
err
)
seg
,
field
,
err
:=
mt
.
GetNotIndexedSegments
(
"testColl"
,
"field110"
,
idxInfo
)
assert
.
Nil
(
t
,
err
)
...
...
tests/python_test/test_partition.py
浏览文件 @
3ef18e86
...
...
@@ -28,6 +28,7 @@ class TestCreateBase:
connect
.
create_partition
(
collection
,
default_tag
)
# TODO: enable
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
600
)
def
test_create_partition_limit
(
self
,
connect
,
collection
,
args
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录