Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
0b478b61
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
260
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,体验更适合开发者的 AI 搜索 >>
提交
0b478b61
编写于
11月 13, 2020
作者:
C
cai.zhang
提交者:
yefu.chen
11月 13, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change Id to ID in go files according to golint check
Signed-off-by:
N
cai.zhang
<
cai.zhang@zilliz.com
>
上级
e541041b
变更
55
展开全部
隐藏空白更改
内联
并排
Showing
55 changed file
with
1219 addition
and
1222 deletion
+1219
-1222
.golangci.yml
.golangci.yml
+0
-2
internal/allocator/id_allocator.go
internal/allocator/id_allocator.go
+4
-4
internal/allocator/timestamp_allocator.go
internal/allocator/timestamp_allocator.go
+1
-1
internal/core/src/pb/etcd_meta.pb.cc
internal/core/src/pb/etcd_meta.pb.cc
+176
-176
internal/core/src/pb/etcd_meta.pb.h
internal/core/src/pb/etcd_meta.pb.h
+242
-242
internal/core/src/pb/schema.pb.cc
internal/core/src/pb/schema.pb.cc
+30
-30
internal/core/src/pb/schema.pb.h
internal/core/src/pb/schema.pb.h
+15
-15
internal/core/src/pb/service_msg.pb.cc
internal/core/src/pb/service_msg.pb.cc
+6
-6
internal/core/src/pb/service_msg.pb.h
internal/core/src/pb/service_msg.pb.h
+8
-8
internal/master/collection/collection.go
internal/master/collection/collection.go
+2
-2
internal/master/collection_task.go
internal/master/collection_task.go
+3
-3
internal/master/collection_task_test.go
internal/master/collection_task_test.go
+7
-7
internal/master/controller/segment.go
internal/master/controller/segment.go
+2
-2
internal/master/controller/segment_test.go
internal/master/controller/segment_test.go
+1
-1
internal/master/grpc_service.go
internal/master/grpc_service.go
+4
-4
internal/master/grpc_service_test.go
internal/master/grpc_service_test.go
+5
-5
internal/master/master.go
internal/master/master.go
+1
-1
internal/master/meta_table.go
internal/master/meta_table.go
+30
-30
internal/master/meta_table_test.go
internal/master/meta_table_test.go
+54
-54
internal/master/mock/grpc_service.go
internal/master/mock/grpc_service.go
+4
-4
internal/master/partition_task.go
internal/master/partition_task.go
+4
-4
internal/master/timesync/time_sync_producer.go
internal/master/timesync/time_sync_producer.go
+1
-1
internal/master/timesync/timesync.go
internal/master/timesync/timesync.go
+9
-9
internal/master/timesync/timesync_test.go
internal/master/timesync/timesync_test.go
+1
-1
internal/msgstream/msgstream.go
internal/msgstream/msgstream.go
+9
-9
internal/msgstream/msgstream_test.go
internal/msgstream/msgstream_test.go
+26
-26
internal/msgstream/task_test.go
internal/msgstream/task_test.go
+11
-11
internal/proto/etcd_meta.proto
internal/proto/etcd_meta.proto
+9
-9
internal/proto/etcdpb/etcd_meta.pb.go
internal/proto/etcdpb/etcd_meta.pb.go
+59
-59
internal/proto/internal_msg.proto
internal/proto/internal_msg.proto
+46
-46
internal/proto/internalpb/internal_msg.pb.go
internal/proto/internalpb/internal_msg.pb.go
+250
-250
internal/proto/master.proto
internal/proto/master.proto
+1
-1
internal/proto/masterpb/master.pb.go
internal/proto/masterpb/master.pb.go
+37
-37
internal/proto/schema.proto
internal/proto/schema.proto
+1
-1
internal/proto/schemapb/schema.pb.go
internal/proto/schemapb/schema.pb.go
+29
-30
internal/proto/service_msg.proto
internal/proto/service_msg.proto
+1
-1
internal/proto/servicepb/service_msg.pb.go
internal/proto/servicepb/service_msg.pb.go
+15
-15
internal/proxy/proxy.go
internal/proxy/proxy.go
+1
-1
internal/proxy/task.go
internal/proxy/task.go
+10
-10
internal/proxy/task_scheduler.go
internal/proxy/task_scheduler.go
+3
-3
internal/proxy/timetick.go
internal/proxy/timetick.go
+1
-1
internal/reader/col_seg_container_test.go
internal/reader/col_seg_container_test.go
+35
-35
internal/reader/collection.go
internal/reader/collection.go
+1
-1
internal/reader/collection_test.go
internal/reader/collection_test.go
+9
-9
internal/reader/data_sync_service_test.go
internal/reader/data_sync_service_test.go
+8
-8
internal/reader/flow_graph_insert_node.go
internal/reader/flow_graph_insert_node.go
+4
-4
internal/reader/flow_graph_key2seg_node.go
internal/reader/flow_graph_key2seg_node.go
+2
-2
internal/reader/meta_service.go
internal/reader/meta_service.go
+3
-3
internal/reader/partition_test.go
internal/reader/partition_test.go
+3
-3
internal/reader/search_service.go
internal/reader/search_service.go
+3
-3
internal/reader/search_service_test.go
internal/reader/search_service_test.go
+2
-2
internal/reader/segment_test.go
internal/reader/segment_test.go
+27
-27
internal/reader/stats_service.go
internal/reader/stats_service.go
+1
-1
internal/reader/util_functions_test.go
internal/reader/util_functions_test.go
+1
-1
test/insert_test.go
test/insert_test.go
+1
-1
未找到文件。
.golangci.yml
浏览文件 @
0b478b61
...
...
@@ -6,7 +6,6 @@ run:
-
docs
-
scripts
-
internal/core
-
internal/proto
linters-settings
:
golint
:
...
...
@@ -34,7 +33,6 @@ issues:
-
should be of the form
-
should not use dot imports
-
which can be annoying to use
-
AllocId
service
:
golangci-lint-version
:
1.27.0
# use the fixed version to not introduce new linters unexpectedly
internal/allocator/id_allocator.go
浏览文件 @
0b478b61
...
...
@@ -36,19 +36,19 @@ func NewIDAllocator(ctx context.Context) (*IDAllocator, error) {
func
(
ta
*
IDAllocator
)
syncID
()
{
fmt
.
Println
(
"syncID"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
req
:=
&
internalpb
.
I
d
Request
{
PeerI
d
:
1
,
req
:=
&
internalpb
.
I
D
Request
{
PeerI
D
:
1
,
Role
:
internalpb
.
PeerRole_Proxy
,
Count
:
ta
.
countPerRPC
,
}
resp
,
err
:=
ta
.
masterClient
.
AllocI
d
(
ctx
,
req
)
resp
,
err
:=
ta
.
masterClient
.
AllocI
D
(
ctx
,
req
)
cancel
()
if
err
!=
nil
{
log
.
Panic
(
"syncID Failed!!!!!"
)
return
}
ta
.
idStart
=
resp
.
GetI
d
()
ta
.
idStart
=
resp
.
GetI
D
()
ta
.
idEnd
=
ta
.
idStart
+
int64
(
resp
.
GetCount
())
}
...
...
internal/allocator/timestamp_allocator.go
浏览文件 @
0b478b61
...
...
@@ -44,7 +44,7 @@ func (ta *TimestampAllocator) syncTs() {
fmt
.
Println
(
"sync TS"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
req
:=
&
internalpb
.
TsoRequest
{
PeerI
d
:
1
,
PeerI
D
:
1
,
Role
:
internalpb
.
PeerRole_Proxy
,
Count
:
ta
.
countPerRPC
,
}
...
...
internal/core/src/pb/etcd_meta.pb.cc
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/core/src/pb/etcd_meta.pb.h
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/core/src/pb/schema.pb.cc
浏览文件 @
0b478b61
...
...
@@ -83,7 +83,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_schema_2eproto::offsets[] PROT
~
0u
,
// no _weak_field_map_
PROTOBUF_FIELD_OFFSET
(
::
milvus
::
proto
::
schema
::
CollectionSchema
,
name_
),
PROTOBUF_FIELD_OFFSET
(
::
milvus
::
proto
::
schema
::
CollectionSchema
,
description_
),
PROTOBUF_FIELD_OFFSET
(
::
milvus
::
proto
::
schema
::
CollectionSchema
,
auto
_
id_
),
PROTOBUF_FIELD_OFFSET
(
::
milvus
::
proto
::
schema
::
CollectionSchema
,
autoid_
),
PROTOBUF_FIELD_OFFSET
(
::
milvus
::
proto
::
schema
::
CollectionSchema
,
fields_
),
};
static
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
MigrationSchema
schemas
[]
PROTOBUF_SECTION_VARIABLE
(
protodesc_cold
)
=
{
...
...
@@ -103,16 +103,16 @@ const char descriptor_table_protodef_schema_2eproto[] PROTOBUF_SECTION_VARIABLE(
"
\035
.milvus.proto.schema.DataType
\022
6
\n\013
type_p"
"arams
\030\004
\003
(
\013
2!.milvus.proto.common.KeyVal"
"uePair
\022
7
\n\014
index_params
\030\005
\003
(
\013
2!.milvus.pr"
"oto.common.KeyValuePair
\"
x
\n\020
CollectionSch"
"ema
\022\014\n\004
name
\030\001
\001
(
\t\022\023\n\013
description
\030\002
\001
(
\t\022\01
7
"
"
\n\00
7
auto_id
\030\003
\001
(
\010\022
0
\n\006
fields
\030\004
\003
(
\013
2 .milvus
"
"
.proto.schema.FieldSchema*
\221\001\n\010
DataType
\022\010
"
"
\
n\004
NONE
\020\000\022\010\n\004
BOOL
\020\001\022\010\n\004
INT8
\020\002\022\t\n\005
INT16
\020\003\022
"
"
\
t\n\005
INT32
\020\004\022\t\n\005
INT64
\020\005\022\t\n\005
FLOAT
\020\n\022\n\n\006
DOUB
"
"
LE
\020\013\022\n\n\006
STRING
\020\024\022\021\n\r
VECTOR_BINARY
\020
d
\022\020\n\014
V
"
"
ECTOR_FLOAT
\020
eBBZ@github.com/zilliztech/m
"
"
ilvus-distributed/internal/proto/schemap
"
"b
b
\006
proto3"
"oto.common.KeyValuePair
\"
w
\n\020
CollectionSch"
"ema
\022\014\n\004
name
\030\001
\001
(
\t\022\023\n\013
description
\030\002
\001
(
\t\022\01
6
"
"
\n\00
6
autoID
\030\003
\001
(
\010\022
0
\n\006
fields
\030\004
\003
(
\013
2 .milvus.
"
"
proto.schema.FieldSchema*
\221\001\n\010
DataType
\022\010\n
"
"
\
004
NONE
\020\000\022\010\n\004
BOOL
\020\001\022\010\n\004
INT8
\020\002\022\t\n\005
INT16
\020\003\022\t
"
"
\
n\005
INT32
\020\004\022\t\n\005
INT64
\020\005\022\t\n\005
FLOAT
\020\n\022\n\n\006
DOUBL
"
"
E
\020\013\022\n\n\006
STRING
\020\024\022\021\n\r
VECTOR_BINARY
\020
d
\022\020\n\014
VE
"
"
CTOR_FLOAT
\020
eBBZ@github.com/zilliztech/mi
"
"
lvus-distributed/internal/proto/schemapb
"
"b
\006
proto3"
;
static
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
DescriptorTable
*
const
descriptor_table_schema_2eproto_deps
[
1
]
=
{
&::
descriptor_table_common_2eproto
,
...
...
@@ -124,7 +124,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_sch
static
::
PROTOBUF_NAMESPACE_ID
::
internal
::
once_flag
descriptor_table_schema_2eproto_once
;
static
bool
descriptor_table_schema_2eproto_initialized
=
false
;
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
DescriptorTable
descriptor_table_schema_2eproto
=
{
&
descriptor_table_schema_2eproto_initialized
,
descriptor_table_protodef_schema_2eproto
,
"schema.proto"
,
60
9
,
&
descriptor_table_schema_2eproto_initialized
,
descriptor_table_protodef_schema_2eproto
,
"schema.proto"
,
60
8
,
&
descriptor_table_schema_2eproto_once
,
descriptor_table_schema_2eproto_sccs
,
descriptor_table_schema_2eproto_deps
,
2
,
1
,
schemas
,
file_default_instances
,
TableStruct_schema_2eproto
::
offsets
,
file_level_metadata_schema_2eproto
,
2
,
file_level_enum_descriptors_schema_2eproto
,
file_level_service_descriptors_schema_2eproto
,
...
...
@@ -680,7 +680,7 @@ CollectionSchema::CollectionSchema(const CollectionSchema& from)
if
(
!
from
.
description
().
empty
())
{
description_
.
AssignWithDefault
(
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
description_
);
}
auto
_id_
=
from
.
auto_
id_
;
auto
id_
=
from
.
auto
id_
;
// @@protoc_insertion_point(copy_constructor:milvus.proto.schema.CollectionSchema)
}
...
...
@@ -688,7 +688,7 @@ void CollectionSchema::SharedCtor() {
::
PROTOBUF_NAMESPACE_ID
::
internal
::
InitSCC
(
&
scc_info_CollectionSchema_schema_2eproto
.
base
);
name_
.
UnsafeSetDefault
(
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
());
description_
.
UnsafeSetDefault
(
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
());
auto
_
id_
=
false
;
autoid_
=
false
;
}
CollectionSchema
::~
CollectionSchema
()
{
...
...
@@ -719,7 +719,7 @@ void CollectionSchema::Clear() {
fields_
.
Clear
();
name_
.
ClearToEmptyNoArena
(
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
());
description_
.
ClearToEmptyNoArena
(
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
());
auto
_
id_
=
false
;
autoid_
=
false
;
_internal_metadata_
.
Clear
();
}
...
...
@@ -745,10 +745,10 @@ const char* CollectionSchema::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA
CHK_
(
ptr
);
}
else
goto
handle_unusual
;
continue
;
// bool auto
_id
= 3;
// bool auto
ID
= 3;
case
3
:
if
(
PROTOBUF_PREDICT_TRUE
(
static_cast
<::
PROTOBUF_NAMESPACE_ID
::
uint8
>
(
tag
)
==
24
))
{
auto
_
id_
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
ReadVarint
(
&
ptr
);
autoid_
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
ReadVarint
(
&
ptr
);
CHK_
(
ptr
);
}
else
goto
handle_unusual
;
continue
;
...
...
@@ -824,13 +824,13 @@ bool CollectionSchema::MergePartialFromCodedStream(
break
;
}
// bool auto
_id
= 3;
// bool auto
ID
= 3;
case
3
:
{
if
(
static_cast
<
::
PROTOBUF_NAMESPACE_ID
::
uint8
>
(
tag
)
==
(
24
&
0xFF
))
{
DO_
((
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
ReadPrimitive
<
bool
,
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
TYPE_BOOL
>
(
input
,
&
auto
_
id_
)));
input
,
&
autoid_
)));
}
else
{
goto
handle_unusual
;
}
...
...
@@ -895,9 +895,9 @@ void CollectionSchema::SerializeWithCachedSizes(
2
,
this
->
description
(),
output
);
}
// bool auto
_id
= 3;
if
(
this
->
auto
_
id
()
!=
0
)
{
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WriteBool
(
3
,
this
->
auto
_
id
(),
output
);
// bool auto
ID
= 3;
if
(
this
->
autoid
()
!=
0
)
{
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WriteBool
(
3
,
this
->
autoid
(),
output
);
}
// repeated .milvus.proto.schema.FieldSchema fields = 4;
...
...
@@ -944,9 +944,9 @@ void CollectionSchema::SerializeWithCachedSizes(
2
,
this
->
description
(),
target
);
}
// bool auto
_id
= 3;
if
(
this
->
auto
_
id
()
!=
0
)
{
target
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WriteBoolToArray
(
3
,
this
->
auto
_
id
(),
target
);
// bool auto
ID
= 3;
if
(
this
->
autoid
()
!=
0
)
{
target
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WriteBoolToArray
(
3
,
this
->
autoid
(),
target
);
}
// repeated .milvus.proto.schema.FieldSchema fields = 4;
...
...
@@ -1003,8 +1003,8 @@ size_t CollectionSchema::ByteSizeLong() const {
this
->
description
());
}
// bool auto
_id
= 3;
if
(
this
->
auto
_
id
()
!=
0
)
{
// bool auto
ID
= 3;
if
(
this
->
autoid
()
!=
0
)
{
total_size
+=
1
+
1
;
}
...
...
@@ -1044,8 +1044,8 @@ void CollectionSchema::MergeFrom(const CollectionSchema& from) {
description_
.
AssignWithDefault
(
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
(),
from
.
description_
);
}
if
(
from
.
auto
_
id
()
!=
0
)
{
set_auto
_id
(
from
.
auto_
id
());
if
(
from
.
autoid
()
!=
0
)
{
set_auto
id
(
from
.
auto
id
());
}
}
...
...
@@ -1075,7 +1075,7 @@ void CollectionSchema::InternalSwap(CollectionSchema* other) {
GetArenaNoVirtual
());
description_
.
Swap
(
&
other
->
description_
,
&::
PROTOBUF_NAMESPACE_ID
::
internal
::
GetEmptyStringAlreadyInited
(),
GetArenaNoVirtual
());
swap
(
auto
_id_
,
other
->
auto_
id_
);
swap
(
auto
id_
,
other
->
auto
id_
);
}
::
PROTOBUF_NAMESPACE_ID
::
Metadata
CollectionSchema
::
GetMetadata
()
const
{
...
...
internal/core/src/pb/schema.pb.h
浏览文件 @
0b478b61
...
...
@@ -411,7 +411,7 @@ class CollectionSchema :
kFieldsFieldNumber
=
4
,
kNameFieldNumber
=
1
,
kDescriptionFieldNumber
=
2
,
kAutoI
d
FieldNumber
=
3
,
kAutoI
D
FieldNumber
=
3
,
};
// repeated .milvus.proto.schema.FieldSchema fields = 4;
int
fields_size
()
const
;
...
...
@@ -446,10 +446,10 @@ class CollectionSchema :
std
::
string
*
release_description
();
void
set_allocated_description
(
std
::
string
*
description
);
// bool auto
_id
= 3;
void
clear_auto
_
id
();
bool
auto
_
id
()
const
;
void
set_auto
_
id
(
bool
value
);
// bool auto
ID
= 3;
void
clear_autoid
();
bool
autoid
()
const
;
void
set_autoid
(
bool
value
);
// @@protoc_insertion_point(class_scope:milvus.proto.schema.CollectionSchema)
private:
...
...
@@ -459,7 +459,7 @@ class CollectionSchema :
::
PROTOBUF_NAMESPACE_ID
::
RepeatedPtrField
<
::
milvus
::
proto
::
schema
::
FieldSchema
>
fields_
;
::
PROTOBUF_NAMESPACE_ID
::
internal
::
ArenaStringPtr
name_
;
::
PROTOBUF_NAMESPACE_ID
::
internal
::
ArenaStringPtr
description_
;
bool
auto
_
id_
;
bool
autoid_
;
mutable
::
PROTOBUF_NAMESPACE_ID
::
internal
::
CachedSize
_cached_size_
;
friend
struct
::
TableStruct_schema_2eproto
;
};
...
...
@@ -750,18 +750,18 @@ inline void CollectionSchema::set_allocated_description(std::string* description
// @@protoc_insertion_point(field_set_allocated:milvus.proto.schema.CollectionSchema.description)
}
// bool auto
_id
= 3;
inline
void
CollectionSchema
::
clear_auto
_
id
()
{
auto
_
id_
=
false
;
// bool auto
ID
= 3;
inline
void
CollectionSchema
::
clear_autoid
()
{
autoid_
=
false
;
}
inline
bool
CollectionSchema
::
auto
_
id
()
const
{
// @@protoc_insertion_point(field_get:milvus.proto.schema.CollectionSchema.auto
_id
)
return
auto
_
id_
;
inline
bool
CollectionSchema
::
autoid
()
const
{
// @@protoc_insertion_point(field_get:milvus.proto.schema.CollectionSchema.auto
ID
)
return
autoid_
;
}
inline
void
CollectionSchema
::
set_auto
_
id
(
bool
value
)
{
inline
void
CollectionSchema
::
set_autoid
(
bool
value
)
{
auto
_
id_
=
value
;
// @@protoc_insertion_point(field_set:milvus.proto.schema.CollectionSchema.auto
_id
)
autoid_
=
value
;
// @@protoc_insertion_point(field_set:milvus.proto.schema.CollectionSchema.auto
ID
)
}
// repeated .milvus.proto.schema.FieldSchema fields = 4;
...
...
internal/core/src/pb/service_msg.pb.cc
浏览文件 @
0b478b61
...
...
@@ -532,7 +532,7 @@ const char descriptor_table_protodef_service_5fmsg_2eproto[] PROTOBUF_SECTION_VA
"us
\022
1
\n\004
name
\030\002
\001
(
\013
2#.milvus.proto.service."
"PartitionName
\022
5
\n\n
statistics
\030\003
\003
(
\013
2!.milv"
"us.proto.common.KeyValuePair
\"
$
\n\005
Score
\022\013\n
"
"
\003
tag
\030\001
\001
(
\t\022\016\n\006
values
\030\002
\003
(
\002\"
m
\n\004
Hits
\022\013\n\003
id
"
"
\003
tag
\030\001
\001
(
\t\022\016\n\006
values
\030\002
\003
(
\002\"
m
\n\004
Hits
\022\013\n\003
ID
"
"s
\030\001
\003
(
\003\022
+
\n\010
row_data
\030\002
\003
(
\013
2
\031
.milvus.proto"
".common.Blob
\022
+
\n\006
scores
\030\003
\003
(
\013
2
\033
.milvus.pr"
"oto.service.Score
\"
d
\n\013
QueryResult
\022
+
\n\006
stat"
...
...
@@ -5598,7 +5598,7 @@ const char* Hits::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::inter
ptr
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
ReadTag
(
ptr
,
&
tag
);
CHK_
(
ptr
);
switch
(
tag
>>
3
)
{
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
case
1
:
if
(
PROTOBUF_PREDICT_TRUE
(
static_cast
<::
PROTOBUF_NAMESPACE_ID
::
uint8
>
(
tag
)
==
10
))
{
ptr
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
PackedInt64Parser
(
mutable_ids
(),
ptr
,
ctx
);
...
...
@@ -5662,7 +5662,7 @@ bool Hits::MergePartialFromCodedStream(
tag
=
p
.
first
;
if
(
!
p
.
second
)
goto
handle_unusual
;
switch
(
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
GetTagFieldNumber
(
tag
))
{
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
case
1
:
{
if
(
static_cast
<
::
PROTOBUF_NAMESPACE_ID
::
uint8
>
(
tag
)
==
(
10
&
0xFF
))
{
DO_
((
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
ReadPackedPrimitive
<
...
...
@@ -5727,7 +5727,7 @@ void Hits::SerializeWithCachedSizes(
::
PROTOBUF_NAMESPACE_ID
::
uint32
cached_has_bits
=
0
;
(
void
)
cached_has_bits
;
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
if
(
this
->
ids_size
()
>
0
)
{
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WriteTag
(
1
,
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WIRETYPE_LENGTH_DELIMITED
,
output
);
output
->
WriteVarint32
(
_ids_cached_byte_size_
.
load
(
...
...
@@ -5769,7 +5769,7 @@ void Hits::SerializeWithCachedSizes(
::
PROTOBUF_NAMESPACE_ID
::
uint32
cached_has_bits
=
0
;
(
void
)
cached_has_bits
;
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
if
(
this
->
ids_size
()
>
0
)
{
target
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
WriteTagToArray
(
1
,
...
...
@@ -5819,7 +5819,7 @@ size_t Hits::ByteSizeLong() const {
// Prevent compiler warnings about cached_has_bits being unused
(
void
)
cached_has_bits
;
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
{
size_t
data_size
=
::
PROTOBUF_NAMESPACE_ID
::
internal
::
WireFormatLite
::
Int64Size
(
this
->
ids_
);
...
...
internal/core/src/pb/service_msg.pb.h
浏览文件 @
0b478b61
...
...
@@ -2422,11 +2422,11 @@ class Hits :
// accessors -------------------------------------------------------
enum
:
int
{
kI
d
sFieldNumber
=
1
,
kI
D
sFieldNumber
=
1
,
kRowDataFieldNumber
=
2
,
kScoresFieldNumber
=
3
,
};
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
int
ids_size
()
const
;
void
clear_ids
();
::
PROTOBUF_NAMESPACE_ID
::
int64
ids
(
int
index
)
const
;
...
...
@@ -4109,7 +4109,7 @@ Score::mutable_values() {
// Hits
// repeated int64
id
s = 1;
// repeated int64
ID
s = 1;
inline
int
Hits
::
ids_size
()
const
{
return
ids_
.
size
();
}
...
...
@@ -4117,25 +4117,25 @@ inline void Hits::clear_ids() {
ids_
.
Clear
();
}
inline
::
PROTOBUF_NAMESPACE_ID
::
int64
Hits
::
ids
(
int
index
)
const
{
// @@protoc_insertion_point(field_get:milvus.proto.service.Hits.
id
s)
// @@protoc_insertion_point(field_get:milvus.proto.service.Hits.
ID
s)
return
ids_
.
Get
(
index
);
}
inline
void
Hits
::
set_ids
(
int
index
,
::
PROTOBUF_NAMESPACE_ID
::
int64
value
)
{
ids_
.
Set
(
index
,
value
);
// @@protoc_insertion_point(field_set:milvus.proto.service.Hits.
id
s)
// @@protoc_insertion_point(field_set:milvus.proto.service.Hits.
ID
s)
}
inline
void
Hits
::
add_ids
(
::
PROTOBUF_NAMESPACE_ID
::
int64
value
)
{
ids_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:milvus.proto.service.Hits.
id
s)
// @@protoc_insertion_point(field_add:milvus.proto.service.Hits.
ID
s)
}
inline
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>&
Hits
::
ids
()
const
{
// @@protoc_insertion_point(field_list:milvus.proto.service.Hits.
id
s)
// @@protoc_insertion_point(field_list:milvus.proto.service.Hits.
ID
s)
return
ids_
;
}
inline
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>*
Hits
::
mutable_ids
()
{
// @@protoc_insertion_point(field_mutable_list:milvus.proto.service.Hits.
id
s)
// @@protoc_insertion_point(field_mutable_list:milvus.proto.service.Hits.
ID
s)
return
&
ids_
;
}
...
...
internal/master/collection/collection.go
浏览文件 @
0b478b61
...
...
@@ -50,10 +50,10 @@ func GrpcMarshal(c *Collection) *Collection {
}
pbSchema
.
Fields
=
schemaSlice
grpcCollection
:=
&
etcdpb
.
CollectionMeta
{
I
d
:
c
.
ID
,
I
D
:
c
.
ID
,
Schema
:
pbSchema
,
CreateTime
:
c
.
CreateTime
,
SegmentI
d
s
:
c
.
SegmentIDs
,
SegmentI
D
s
:
c
.
SegmentIDs
,
PartitionTags
:
c
.
PartitionTags
,
}
out
:=
proto
.
MarshalTextString
(
grpcCollection
)
...
...
internal/master/collection_task.go
浏览文件 @
0b478b61
...
...
@@ -84,11 +84,11 @@ func (t *createCollectionTask) Execute() error {
}
collection
:=
etcdpb
.
CollectionMeta
{
I
d
:
collectionID
,
I
D
:
collectionID
,
Schema
:
&
schema
,
CreateTime
:
ts
,
// TODO: initial segment?
SegmentI
d
s
:
make
([]
UniqueID
,
0
),
SegmentI
D
s
:
make
([]
UniqueID
,
0
),
// TODO: initial partition?
PartitionTags
:
make
([]
string
,
0
),
}
...
...
@@ -123,7 +123,7 @@ func (t *dropCollectionTask) Execute() error {
return
err
}
collectionID
:=
collectionMeta
.
I
d
collectionID
:=
collectionMeta
.
I
D
return
t
.
mt
.
DeleteCollection
(
collectionID
)
}
...
...
internal/master/collection_task_test.go
浏览文件 @
0b478b61
...
...
@@ -44,7 +44,7 @@ func TestMaster_CreateCollectionTask(t *testing.T) {
sch
:=
schemapb
.
CollectionSchema
{
Name
:
"col1"
,
Description
:
"test collection"
,
AutoI
d
:
false
,
AutoI
D
:
false
,
Fields
:
[]
*
schemapb
.
FieldSchema
{
{
Name
:
"col1_f1"
,
...
...
@@ -103,9 +103,9 @@ func TestMaster_CreateCollectionTask(t *testing.T) {
req
:=
internalpb
.
CreateCollectionRequest
{
MsgType
:
internalpb
.
MsgType_kCreateCollection
,
ReqI
d
:
1
,
ReqI
D
:
1
,
Timestamp
:
11
,
ProxyI
d
:
1
,
ProxyI
D
:
1
,
Schema
:
&
commonpb
.
Blob
{
Value
:
schemaBytes
},
}
log
.
Printf
(
"... [Create] collection col1
\n
"
)
...
...
@@ -115,10 +115,10 @@ func TestMaster_CreateCollectionTask(t *testing.T) {
collMeta
,
err
:=
svr
.
mt
.
GetCollectionByName
(
sch
.
Name
)
assert
.
Nil
(
t
,
err
)
t
.
Logf
(
"collection id = %d"
,
collMeta
.
I
d
)
t
.
Logf
(
"collection id = %d"
,
collMeta
.
I
D
)
assert
.
Equal
(
t
,
collMeta
.
CreateTime
,
uint64
(
11
))
assert
.
Equal
(
t
,
collMeta
.
Schema
.
Name
,
"col1"
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
AutoI
d
,
false
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
AutoI
D
,
false
)
assert
.
Equal
(
t
,
len
(
collMeta
.
Schema
.
Fields
),
2
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
Fields
[
0
]
.
Name
,
"col1_f1"
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
Fields
[
1
]
.
Name
,
"col1_f2"
)
...
...
@@ -157,9 +157,9 @@ func TestMaster_CreateCollectionTask(t *testing.T) {
reqDrop
:=
internalpb
.
DropCollectionRequest
{
MsgType
:
internalpb
.
MsgType_kDropCollection
,
ReqI
d
:
1
,
ReqI
D
:
1
,
Timestamp
:
11
,
ProxyI
d
:
1
,
ProxyI
D
:
1
,
CollectionName
:
&
ser
,
}
...
...
internal/master/controller/segment.go
浏览文件 @
0b478b61
...
...
@@ -23,7 +23,7 @@ func ComputeCloseTime(ss internalpb.SegmentStats, kvbase *kv.EtcdKV) error {
memRate
=
1
}
sec
:=
int
(
conf
.
Config
.
Master
.
SegmentThreshole
*
0.2
)
/
memRate
data
,
err
:=
kvbase
.
Load
(
"segment/"
+
strconv
.
Itoa
(
int
(
ss
.
SegmentI
d
)))
data
,
err
:=
kvbase
.
Load
(
"segment/"
+
strconv
.
Itoa
(
int
(
ss
.
SegmentI
D
)))
if
err
!=
nil
{
return
err
}
...
...
@@ -37,7 +37,7 @@ func ComputeCloseTime(ss internalpb.SegmentStats, kvbase *kv.EtcdKV) error {
if
err
!=
nil
{
return
err
}
kvbase
.
Save
(
"segment/"
+
strconv
.
Itoa
(
int
(
ss
.
SegmentI
d
)),
updateData
)
kvbase
.
Save
(
"segment/"
+
strconv
.
Itoa
(
int
(
ss
.
SegmentI
D
)),
updateData
)
//create new segment
newSegID
,
_
:=
id
.
AllocOne
()
newSeg
:=
segment
.
NewSegment
(
newSegID
,
seg
.
CollectionID
,
seg
.
CollectionName
,
"default"
,
seg
.
ChannelStart
,
seg
.
ChannelEnd
,
currentTime
,
time
.
Unix
(
1
<<
36
-
1
,
0
))
...
...
internal/master/controller/segment_test.go
浏览文件 @
0b478b61
...
...
@@ -29,7 +29,7 @@ func TestComputeClosetTime(t *testing.T) {
var
news
internalpb
.
SegmentStats
for
i
:=
0
;
i
<
10
;
i
++
{
news
=
internalpb
.
SegmentStats
{
SegmentI
d
:
UniqueID
(
6875940398055133887
),
SegmentI
D
:
UniqueID
(
6875940398055133887
),
MemorySize
:
int64
(
i
*
1000
),
}
ComputeCloseTime
(
news
,
kvbase
)
...
...
internal/master/grpc_service.go
浏览文件 @
0b478b61
...
...
@@ -347,19 +347,19 @@ func (s *Master) AllocTimestamp(ctx context.Context, request *internalpb.TsoRequ
return
response
,
nil
}
func
(
s
*
Master
)
AllocI
d
(
ctx
context
.
Context
,
request
*
internalpb
.
IdRequest
)
(
*
internalpb
.
Id
Response
,
error
)
{
func
(
s
*
Master
)
AllocI
D
(
ctx
context
.
Context
,
request
*
internalpb
.
IDRequest
)
(
*
internalpb
.
ID
Response
,
error
)
{
count
:=
request
.
GetCount
()
ts
,
err
:=
id
.
AllocOne
()
if
err
!=
nil
{
return
&
internalpb
.
I
d
Response
{
return
&
internalpb
.
I
D
Response
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_UNEXPECTED_ERROR
},
},
err
}
response
:=
&
internalpb
.
I
d
Response
{
response
:=
&
internalpb
.
I
D
Response
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_UNEXPECTED_ERROR
},
I
d
:
ts
,
I
D
:
ts
,
Count
:
count
,
}
...
...
internal/master/grpc_service_test.go
浏览文件 @
0b478b61
...
...
@@ -42,7 +42,7 @@ func TestMaster_CreateCollection(t *testing.T) {
sch
:=
schemapb
.
CollectionSchema
{
Name
:
"col1"
,
Description
:
"test collection"
,
AutoI
d
:
false
,
AutoI
D
:
false
,
Fields
:
[]
*
schemapb
.
FieldSchema
{
{
Name
:
"col1_f1"
,
...
...
@@ -101,9 +101,9 @@ func TestMaster_CreateCollection(t *testing.T) {
req
:=
internalpb
.
CreateCollectionRequest
{
MsgType
:
internalpb
.
MsgType_kCreateCollection
,
ReqI
d
:
1
,
ReqI
D
:
1
,
Timestamp
:
11
,
ProxyI
d
:
1
,
ProxyI
D
:
1
,
Schema
:
&
commonpb
.
Blob
{
Value
:
schemaBytes
},
}
st
,
err
:=
cli
.
CreateCollection
(
ctx
,
&
req
)
...
...
@@ -112,10 +112,10 @@ func TestMaster_CreateCollection(t *testing.T) {
collMeta
,
err
:=
svr
.
mt
.
GetCollectionByName
(
sch
.
Name
)
assert
.
Nil
(
t
,
err
)
t
.
Logf
(
"collection id = %d"
,
collMeta
.
I
d
)
t
.
Logf
(
"collection id = %d"
,
collMeta
.
I
D
)
assert
.
Equal
(
t
,
collMeta
.
CreateTime
,
uint64
(
11
))
assert
.
Equal
(
t
,
collMeta
.
Schema
.
Name
,
"col1"
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
AutoI
d
,
false
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
AutoI
D
,
false
)
assert
.
Equal
(
t
,
len
(
collMeta
.
Schema
.
Fields
),
2
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
Fields
[
0
]
.
Name
,
"col1_f1"
)
assert
.
Equal
(
t
,
collMeta
.
Schema
.
Fields
[
1
]
.
Name
,
"col1_f2"
)
...
...
internal/master/master.go
浏览文件 @
0b478b61
...
...
@@ -252,7 +252,7 @@ func (s *Master) pulsarLoop() {
var
m
internalpb
.
SegmentStats
proto
.
Unmarshal
(
msg
.
Payload
(),
&
m
)
fmt
.
Printf
(
"Received message msgId: %#v -- content: '%d'
\n
"
,
msg
.
ID
(),
m
.
SegmentI
d
)
msg
.
ID
(),
m
.
SegmentI
D
)
s
.
ssChan
<-
m
consumer
.
Ack
(
msg
)
case
<-
ctx
.
Done
()
:
...
...
internal/master/meta_table.go
浏览文件 @
0b478b61
...
...
@@ -60,7 +60,7 @@ func (mt *metaTable) reloadFromKV() error {
if
err
!=
nil
{
return
err
}
mt
.
tenantID2Meta
[
tenantMeta
.
I
d
]
=
tenantMeta
mt
.
tenantID2Meta
[
tenantMeta
.
I
D
]
=
tenantMeta
}
_
,
values
,
err
=
mt
.
client
.
LoadWithPrefix
(
"proxy"
)
...
...
@@ -74,7 +74,7 @@ func (mt *metaTable) reloadFromKV() error {
if
err
!=
nil
{
return
err
}
mt
.
proxyID2Meta
[
proxyMeta
.
I
d
]
=
proxyMeta
mt
.
proxyID2Meta
[
proxyMeta
.
I
D
]
=
proxyMeta
}
_
,
values
,
err
=
mt
.
client
.
LoadWithPrefix
(
"collection"
)
...
...
@@ -88,8 +88,8 @@ func (mt *metaTable) reloadFromKV() error {
if
err
!=
nil
{
return
err
}
mt
.
collID2Meta
[
collectionMeta
.
I
d
]
=
collectionMeta
mt
.
collName2ID
[
collectionMeta
.
Schema
.
Name
]
=
collectionMeta
.
I
d
mt
.
collID2Meta
[
collectionMeta
.
I
D
]
=
collectionMeta
mt
.
collName2ID
[
collectionMeta
.
Schema
.
Name
]
=
collectionMeta
.
I
D
}
_
,
values
,
err
=
mt
.
client
.
LoadWithPrefix
(
"segment"
)
...
...
@@ -103,7 +103,7 @@ func (mt *metaTable) reloadFromKV() error {
if
err
!=
nil
{
return
err
}
mt
.
segID2Meta
[
segmentMeta
.
SegmentI
d
]
=
segmentMeta
mt
.
segID2Meta
[
segmentMeta
.
SegmentI
D
]
=
segmentMeta
}
return
nil
...
...
@@ -115,9 +115,9 @@ func (mt *metaTable) saveCollectionMeta(coll *pb.CollectionMeta) error {
if
err
!=
nil
{
return
err
}
mt
.
collID2Meta
[
coll
.
I
d
]
=
*
coll
mt
.
collName2ID
[
coll
.
Schema
.
Name
]
=
coll
.
I
d
return
mt
.
client
.
Save
(
"/collection/"
+
strconv
.
FormatInt
(
coll
.
I
d
,
10
),
string
(
collBytes
))
mt
.
collID2Meta
[
coll
.
I
D
]
=
*
coll
mt
.
collName2ID
[
coll
.
Schema
.
Name
]
=
coll
.
I
D
return
mt
.
client
.
Save
(
"/collection/"
+
strconv
.
FormatInt
(
coll
.
I
D
,
10
),
string
(
collBytes
))
}
// mt.ddLock.Lock() before call this function
...
...
@@ -127,9 +127,9 @@ func (mt *metaTable) saveSegmentMeta(seg *pb.SegmentMeta) error {
return
err
}
mt
.
segID2Meta
[
seg
.
SegmentI
d
]
=
*
seg
mt
.
segID2Meta
[
seg
.
SegmentI
D
]
=
*
seg
return
mt
.
client
.
Save
(
"/segment/"
+
strconv
.
FormatInt
(
seg
.
SegmentI
d
,
10
),
string
(
segBytes
))
return
mt
.
client
.
Save
(
"/segment/"
+
strconv
.
FormatInt
(
seg
.
SegmentI
D
,
10
),
string
(
segBytes
))
}
// mt.ddLock.Lock() before call this function
...
...
@@ -156,7 +156,7 @@ func (mt *metaTable) saveCollectionAndDeleteSegmentsMeta(coll *pb.CollectionMeta
return
err
}
kvs
[
"/collection/"
+
strconv
.
FormatInt
(
coll
.
I
d
,
10
)]
=
string
(
collStrs
)
kvs
[
"/collection/"
+
strconv
.
FormatInt
(
coll
.
I
D
,
10
)]
=
string
(
collStrs
)
for
_
,
segID
:=
range
segIDs
{
_
,
ok
:=
mt
.
segID2Meta
[
segID
]
...
...
@@ -166,7 +166,7 @@ func (mt *metaTable) saveCollectionAndDeleteSegmentsMeta(coll *pb.CollectionMeta
}
}
mt
.
collID2Meta
[
coll
.
I
d
]
=
*
coll
mt
.
collID2Meta
[
coll
.
I
D
]
=
*
coll
return
mt
.
client
.
MultiSaveAndRemove
(
kvs
,
segIDStrs
)
}
...
...
@@ -178,18 +178,18 @@ func (mt *metaTable) saveCollectionsAndSegmentsMeta(coll *pb.CollectionMeta, seg
if
err
!=
nil
{
return
err
}
kvs
[
"/collection/"
+
strconv
.
FormatInt
(
coll
.
I
d
,
10
)]
=
string
(
collBytes
)
kvs
[
"/collection/"
+
strconv
.
FormatInt
(
coll
.
I
D
,
10
)]
=
string
(
collBytes
)
mt
.
collID2Meta
[
coll
.
I
d
]
=
*
coll
mt
.
collName2ID
[
coll
.
Schema
.
Name
]
=
coll
.
I
d
mt
.
collID2Meta
[
coll
.
I
D
]
=
*
coll
mt
.
collName2ID
[
coll
.
Schema
.
Name
]
=
coll
.
I
D
segBytes
,
err
:=
proto
.
Marshal
(
seg
)
if
err
!=
nil
{
return
err
}
kvs
[
"/segment/"
+
strconv
.
FormatInt
(
seg
.
SegmentI
d
,
10
)]
=
string
(
segBytes
)
kvs
[
"/segment/"
+
strconv
.
FormatInt
(
seg
.
SegmentI
D
,
10
)]
=
string
(
segBytes
)
mt
.
segID2Meta
[
seg
.
SegmentI
d
]
=
*
seg
mt
.
segID2Meta
[
seg
.
SegmentI
D
]
=
*
seg
return
mt
.
client
.
MultiSave
(
kvs
)
}
...
...
@@ -230,7 +230,7 @@ func (mt *metaTable) deleteCollectionsAndSegmentsMeta(collID UniqueID, segIDs []
func
(
mt
*
metaTable
)
AddCollection
(
coll
*
pb
.
CollectionMeta
)
error
{
mt
.
ddLock
.
Lock
()
defer
mt
.
ddLock
.
Unlock
()
if
len
(
coll
.
SegmentI
d
s
)
!=
0
{
if
len
(
coll
.
SegmentI
D
s
)
!=
0
{
return
errors
.
Errorf
(
"segment should be empty when creating collection"
)
}
if
len
(
coll
.
PartitionTags
)
!=
0
{
...
...
@@ -257,7 +257,7 @@ func (mt *metaTable) DeleteCollection(collID UniqueID) error {
return
errors
.
Errorf
(
"can't find collection. id = "
+
strconv
.
FormatInt
(
collID
,
10
))
}
err
:=
mt
.
deleteCollectionsAndSegmentsMeta
(
collID
,
collMeta
.
SegmentI
d
s
)
err
:=
mt
.
deleteCollectionsAndSegmentsMeta
(
collID
,
collMeta
.
SegmentI
D
s
)
if
err
!=
nil
{
_
=
mt
.
reloadFromKV
()
return
err
...
...
@@ -344,9 +344,9 @@ func (mt *metaTable) DeletePartition(collID UniqueID, tag string) error {
return
nil
}
toDeleteSeg
:=
make
([]
UniqueID
,
0
,
len
(
collMeta
.
SegmentI
d
s
))
seg
:=
make
([]
UniqueID
,
0
,
len
(
collMeta
.
SegmentI
d
s
))
for
_
,
s
:=
range
collMeta
.
SegmentI
d
s
{
toDeleteSeg
:=
make
([]
UniqueID
,
0
,
len
(
collMeta
.
SegmentI
D
s
))
seg
:=
make
([]
UniqueID
,
0
,
len
(
collMeta
.
SegmentI
D
s
))
for
_
,
s
:=
range
collMeta
.
SegmentI
D
s
{
sm
,
ok
:=
mt
.
segID2Meta
[
s
]
if
!
ok
{
return
errors
.
Errorf
(
"can't find segment id = %d"
,
s
)
...
...
@@ -358,7 +358,7 @@ func (mt *metaTable) DeletePartition(collID UniqueID, tag string) error {
}
}
collMeta
.
PartitionTags
=
pt
collMeta
.
SegmentI
d
s
=
seg
collMeta
.
SegmentI
D
s
=
seg
err
:=
mt
.
saveCollectionAndDeleteSegmentsMeta
(
&
collMeta
,
toDeleteSeg
)
if
err
!=
nil
{
...
...
@@ -371,9 +371,9 @@ func (mt *metaTable) DeletePartition(collID UniqueID, tag string) error {
func
(
mt
*
metaTable
)
AddSegment
(
seg
*
pb
.
SegmentMeta
)
error
{
mt
.
ddLock
.
Lock
()
defer
mt
.
ddLock
.
Unlock
()
collID
:=
seg
.
CollectionI
d
collID
:=
seg
.
CollectionI
D
collMeta
:=
mt
.
collID2Meta
[
collID
]
collMeta
.
SegmentI
ds
=
append
(
collMeta
.
SegmentIds
,
seg
.
SegmentId
)
collMeta
.
SegmentI
Ds
=
append
(
collMeta
.
SegmentIDs
,
seg
.
SegmentID
)
err
:=
mt
.
saveCollectionsAndSegmentsMeta
(
&
collMeta
,
seg
)
if
err
!=
nil
{
_
=
mt
.
reloadFromKV
()
...
...
@@ -402,14 +402,14 @@ func (mt *metaTable) DeleteSegment(segID UniqueID) error {
return
errors
.
Errorf
(
"can't find segment. id = "
+
strconv
.
FormatInt
(
segID
,
10
))
}
collMeta
,
ok
:=
mt
.
collID2Meta
[
segMeta
.
CollectionI
d
]
collMeta
,
ok
:=
mt
.
collID2Meta
[
segMeta
.
CollectionI
D
]
if
!
ok
{
return
errors
.
Errorf
(
"can't find collection. id = "
+
strconv
.
FormatInt
(
segMeta
.
CollectionI
d
,
10
))
return
errors
.
Errorf
(
"can't find collection. id = "
+
strconv
.
FormatInt
(
segMeta
.
CollectionI
D
,
10
))
}
for
i
:=
0
;
i
<
len
(
collMeta
.
SegmentI
d
s
);
i
++
{
if
collMeta
.
SegmentI
d
s
[
i
]
==
segID
{
collMeta
.
SegmentI
ds
=
append
(
collMeta
.
SegmentIds
[
:
i
],
collMeta
.
SegmentId
s
[
i
+
1
:
]
...
)
for
i
:=
0
;
i
<
len
(
collMeta
.
SegmentI
D
s
);
i
++
{
if
collMeta
.
SegmentI
D
s
[
i
]
==
segID
{
collMeta
.
SegmentI
Ds
=
append
(
collMeta
.
SegmentIDs
[
:
i
],
collMeta
.
SegmentID
s
[
i
+
1
:
]
...
)
}
}
...
...
internal/master/meta_table_test.go
浏览文件 @
0b478b61
...
...
@@ -28,63 +28,63 @@ func TestMetaTable_Collection(t *testing.T) {
defer
meta
.
client
.
Close
()
colMeta
:=
pb
.
CollectionMeta
{
I
d
:
100
,
I
D
:
100
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll1"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{},
SegmentI
D
s
:
[]
UniqueID
{},
PartitionTags
:
[]
string
{},
}
colMeta2
:=
pb
.
CollectionMeta
{
I
d
:
50
,
I
D
:
50
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll1"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{},
SegmentI
D
s
:
[]
UniqueID
{},
PartitionTags
:
[]
string
{},
}
colMeta3
:=
pb
.
CollectionMeta
{
I
d
:
30
,
I
D
:
30
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll2"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{},
SegmentI
D
s
:
[]
UniqueID
{},
PartitionTags
:
[]
string
{},
}
colMeta4
:=
pb
.
CollectionMeta
{
I
d
:
30
,
I
D
:
30
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll2"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{
1
},
SegmentI
D
s
:
[]
UniqueID
{
1
},
PartitionTags
:
[]
string
{},
}
colMeta5
:=
pb
.
CollectionMeta
{
I
d
:
30
,
I
D
:
30
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll2"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{
1
},
SegmentI
D
s
:
[]
UniqueID
{
1
},
PartitionTags
:
[]
string
{
"1"
},
}
segID1
:=
pb
.
SegmentMeta
{
SegmentI
d
:
200
,
CollectionI
d
:
100
,
SegmentI
D
:
200
,
CollectionI
D
:
100
,
PartitionTag
:
"p1"
,
}
segID2
:=
pb
.
SegmentMeta
{
SegmentI
d
:
300
,
CollectionI
d
:
100
,
SegmentI
D
:
300
,
CollectionI
D
:
100
,
PartitionTag
:
"p1"
,
}
segID3
:=
pb
.
SegmentMeta
{
SegmentI
d
:
400
,
CollectionI
d
:
100
,
SegmentI
D
:
400
,
CollectionI
D
:
100
,
PartitionTag
:
"p2"
,
}
err
=
meta
.
AddCollection
(
&
colMeta
)
...
...
@@ -97,11 +97,11 @@ func TestMetaTable_Collection(t *testing.T) {
assert
.
NotNil
(
t
,
err
)
err
=
meta
.
AddCollection
(
&
colMeta5
)
assert
.
NotNil
(
t
,
err
)
hasCollection
:=
meta
.
HasCollection
(
colMeta
.
I
d
)
hasCollection
:=
meta
.
HasCollection
(
colMeta
.
I
D
)
assert
.
True
(
t
,
hasCollection
)
err
=
meta
.
AddPartition
(
colMeta
.
I
d
,
"p1"
)
err
=
meta
.
AddPartition
(
colMeta
.
I
D
,
"p1"
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddPartition
(
colMeta
.
I
d
,
"p2"
)
err
=
meta
.
AddPartition
(
colMeta
.
I
D
,
"p2"
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddSegment
(
&
segID1
)
assert
.
Nil
(
t
,
err
)
...
...
@@ -111,16 +111,16 @@ func TestMetaTable_Collection(t *testing.T) {
assert
.
Nil
(
t
,
err
)
getColMeta
,
err
:=
meta
.
GetCollectionByName
(
colMeta
.
Schema
.
Name
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
3
,
len
(
getColMeta
.
SegmentI
d
s
))
err
=
meta
.
DeleteCollection
(
colMeta
.
I
d
)
assert
.
Equal
(
t
,
3
,
len
(
getColMeta
.
SegmentI
D
s
))
err
=
meta
.
DeleteCollection
(
colMeta
.
I
D
)
assert
.
Nil
(
t
,
err
)
hasCollection
=
meta
.
HasCollection
(
colMeta
.
I
d
)
hasCollection
=
meta
.
HasCollection
(
colMeta
.
I
D
)
assert
.
False
(
t
,
hasCollection
)
_
,
err
=
meta
.
GetSegmentByID
(
segID1
.
SegmentI
d
)
_
,
err
=
meta
.
GetSegmentByID
(
segID1
.
SegmentI
D
)
assert
.
NotNil
(
t
,
err
)
_
,
err
=
meta
.
GetSegmentByID
(
segID2
.
SegmentI
d
)
_
,
err
=
meta
.
GetSegmentByID
(
segID2
.
SegmentI
D
)
assert
.
NotNil
(
t
,
err
)
_
,
err
=
meta
.
GetSegmentByID
(
segID3
.
SegmentI
d
)
_
,
err
=
meta
.
GetSegmentByID
(
segID3
.
SegmentI
D
)
assert
.
NotNil
(
t
,
err
)
err
=
meta
.
reloadFromKV
()
...
...
@@ -132,7 +132,7 @@ func TestMetaTable_Collection(t *testing.T) {
assert
.
Equal
(
t
,
1
,
len
(
meta
.
collID2Meta
))
assert
.
Equal
(
t
,
0
,
len
(
meta
.
segID2Meta
))
err
=
meta
.
DeleteCollection
(
colMeta3
.
I
d
)
err
=
meta
.
DeleteCollection
(
colMeta3
.
I
D
)
assert
.
Nil
(
t
,
err
)
}
...
...
@@ -151,34 +151,34 @@ func TestMetaTable_DeletePartition(t *testing.T) {
defer
meta
.
client
.
Close
()
colMeta
:=
pb
.
CollectionMeta
{
I
d
:
100
,
I
D
:
100
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll1"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{},
SegmentI
D
s
:
[]
UniqueID
{},
PartitionTags
:
[]
string
{},
}
segID1
:=
pb
.
SegmentMeta
{
SegmentI
d
:
200
,
CollectionI
d
:
100
,
SegmentI
D
:
200
,
CollectionI
D
:
100
,
PartitionTag
:
"p1"
,
}
segID2
:=
pb
.
SegmentMeta
{
SegmentI
d
:
300
,
CollectionI
d
:
100
,
SegmentI
D
:
300
,
CollectionI
D
:
100
,
PartitionTag
:
"p1"
,
}
segID3
:=
pb
.
SegmentMeta
{
SegmentI
d
:
400
,
CollectionI
d
:
100
,
SegmentI
D
:
400
,
CollectionI
D
:
100
,
PartitionTag
:
"p2"
,
}
err
=
meta
.
AddCollection
(
&
colMeta
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddPartition
(
colMeta
.
I
d
,
"p1"
)
err
=
meta
.
AddPartition
(
colMeta
.
I
D
,
"p1"
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddPartition
(
colMeta
.
I
d
,
"p2"
)
err
=
meta
.
AddPartition
(
colMeta
.
I
D
,
"p2"
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddSegment
(
&
segID1
)
assert
.
Nil
(
t
,
err
)
...
...
@@ -189,22 +189,22 @@ func TestMetaTable_DeletePartition(t *testing.T) {
afterCollMeta
,
err
:=
meta
.
GetCollectionByName
(
"coll1"
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
2
,
len
(
afterCollMeta
.
PartitionTags
))
assert
.
Equal
(
t
,
3
,
len
(
afterCollMeta
.
SegmentI
d
s
))
assert
.
Equal
(
t
,
3
,
len
(
afterCollMeta
.
SegmentI
D
s
))
err
=
meta
.
DeletePartition
(
100
,
"p1"
)
assert
.
Nil
(
t
,
err
)
afterCollMeta
,
err
=
meta
.
GetCollectionByName
(
"coll1"
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
1
,
len
(
afterCollMeta
.
PartitionTags
))
assert
.
Equal
(
t
,
1
,
len
(
afterCollMeta
.
SegmentI
d
s
))
hasPartition
:=
meta
.
HasPartition
(
colMeta
.
I
d
,
"p1"
)
assert
.
Equal
(
t
,
1
,
len
(
afterCollMeta
.
SegmentI
D
s
))
hasPartition
:=
meta
.
HasPartition
(
colMeta
.
I
D
,
"p1"
)
assert
.
False
(
t
,
hasPartition
)
hasPartition
=
meta
.
HasPartition
(
colMeta
.
I
d
,
"p2"
)
hasPartition
=
meta
.
HasPartition
(
colMeta
.
I
D
,
"p2"
)
assert
.
True
(
t
,
hasPartition
)
_
,
err
=
meta
.
GetSegmentByID
(
segID1
.
SegmentI
d
)
_
,
err
=
meta
.
GetSegmentByID
(
segID1
.
SegmentI
D
)
assert
.
NotNil
(
t
,
err
)
_
,
err
=
meta
.
GetSegmentByID
(
segID2
.
SegmentI
d
)
_
,
err
=
meta
.
GetSegmentByID
(
segID2
.
SegmentI
D
)
assert
.
NotNil
(
t
,
err
)
_
,
err
=
meta
.
GetSegmentByID
(
segID3
.
SegmentI
d
)
_
,
err
=
meta
.
GetSegmentByID
(
segID3
.
SegmentI
D
)
assert
.
Nil
(
t
,
err
)
afterCollMeta
,
err
=
meta
.
GetCollectionByName
(
"coll1"
)
assert
.
Nil
(
t
,
err
)
...
...
@@ -239,42 +239,42 @@ func TestMetaTable_Segment(t *testing.T) {
assert
.
Nil
(
t
,
err
)
colMeta
:=
pb
.
CollectionMeta
{
I
d
:
100
,
I
D
:
100
,
Schema
:
&
schemapb
.
CollectionSchema
{
Name
:
"coll1"
,
},
CreateTime
:
0
,
SegmentI
d
s
:
[]
UniqueID
{},
SegmentI
D
s
:
[]
UniqueID
{},
PartitionTags
:
[]
string
{},
}
segMeta
:=
pb
.
SegmentMeta
{
SegmentI
d
:
200
,
CollectionI
d
:
100
,
SegmentI
D
:
200
,
CollectionI
D
:
100
,
PartitionTag
:
"p1"
,
}
err
=
meta
.
AddCollection
(
&
colMeta
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddPartition
(
colMeta
.
I
d
,
"p1"
)
err
=
meta
.
AddPartition
(
colMeta
.
I
D
,
"p1"
)
assert
.
Nil
(
t
,
err
)
err
=
meta
.
AddSegment
(
&
segMeta
)
assert
.
Nil
(
t
,
err
)
getSegMeta
,
err
:=
meta
.
GetSegmentByID
(
segMeta
.
SegmentI
d
)
getSegMeta
,
err
:=
meta
.
GetSegmentByID
(
segMeta
.
SegmentI
D
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
&
segMeta
,
getSegMeta
)
err
=
meta
.
CloseSegment
(
segMeta
.
SegmentI
d
,
Timestamp
(
11
),
111
)
err
=
meta
.
CloseSegment
(
segMeta
.
SegmentI
D
,
Timestamp
(
11
),
111
)
assert
.
Nil
(
t
,
err
)
getSegMeta
,
err
=
meta
.
GetSegmentByID
(
segMeta
.
SegmentI
d
)
getSegMeta
,
err
=
meta
.
GetSegmentByID
(
segMeta
.
SegmentI
D
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
getSegMeta
.
NumRows
,
int64
(
111
))
assert
.
Equal
(
t
,
getSegMeta
.
CloseTime
,
uint64
(
11
))
err
=
meta
.
DeleteSegment
(
segMeta
.
SegmentI
d
)
err
=
meta
.
DeleteSegment
(
segMeta
.
SegmentI
D
)
assert
.
Nil
(
t
,
err
)
getSegMeta
,
err
=
meta
.
GetSegmentByID
(
segMeta
.
SegmentI
d
)
getSegMeta
,
err
=
meta
.
GetSegmentByID
(
segMeta
.
SegmentI
D
)
assert
.
Nil
(
t
,
getSegMeta
)
assert
.
NotNil
(
t
,
err
)
getColMeta
,
err
:=
meta
.
GetCollectionByName
(
colMeta
.
Schema
.
Name
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
0
,
len
(
getColMeta
.
SegmentI
d
s
))
assert
.
Equal
(
t
,
0
,
len
(
getColMeta
.
SegmentI
D
s
))
meta
.
tenantID2Meta
=
make
(
map
[
UniqueID
]
pb
.
TenantMeta
)
meta
.
proxyID2Meta
=
make
(
map
[
UniqueID
]
pb
.
ProxyMeta
)
...
...
internal/master/mock/grpc_service.go
浏览文件 @
0b478b61
...
...
@@ -90,19 +90,19 @@ func (s *Master) AllocTimestamp(ctx context.Context, request *internalpb.TsoRequ
return
response
,
nil
}
func
(
s
*
Master
)
AllocI
d
(
ctx
context
.
Context
,
request
*
internalpb
.
IdRequest
)
(
*
internalpb
.
Id
Response
,
error
)
{
func
(
s
*
Master
)
AllocI
D
(
ctx
context
.
Context
,
request
*
internalpb
.
IDRequest
)
(
*
internalpb
.
ID
Response
,
error
)
{
count
:=
request
.
GetCount
()
ts
,
err
:=
id
.
AllocOne
()
if
err
!=
nil
{
return
&
internalpb
.
I
d
Response
{
return
&
internalpb
.
I
D
Response
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_UNEXPECTED_ERROR
},
},
err
}
response
:=
&
internalpb
.
I
d
Response
{
response
:=
&
internalpb
.
I
D
Response
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_UNEXPECTED_ERROR
},
I
d
:
ts
,
I
D
:
ts
,
Count
:
count
,
}
...
...
internal/master/partition_task.go
浏览文件 @
0b478b61
...
...
@@ -76,7 +76,7 @@ func (t *createPartitionTask) Execute() error {
return
err
}
collectionID
:=
collectionMeta
.
I
d
collectionID
:=
collectionMeta
.
I
D
err
=
(
*
t
.
kvBase
)
.
Save
(
partitionMetaPrefix
+
strconv
.
FormatInt
(
collectionID
,
10
),
string
(
collectionJSON
))
if
err
!=
nil
{
return
err
...
...
@@ -113,7 +113,7 @@ func (t *dropPartitionTask) Execute() error {
return
err
}
err
=
t
.
mt
.
DeletePartition
(
collectionMeta
.
I
d
,
partitionName
.
Tag
)
err
=
t
.
mt
.
DeletePartition
(
collectionMeta
.
I
D
,
partitionName
.
Tag
)
if
err
!=
nil
{
return
err
}
...
...
@@ -123,7 +123,7 @@ func (t *dropPartitionTask) Execute() error {
return
err
}
collectionID
:=
collectionMeta
.
I
d
collectionID
:=
collectionMeta
.
I
D
err
=
(
*
t
.
kvBase
)
.
Save
(
partitionMetaPrefix
+
strconv
.
FormatInt
(
collectionID
,
10
),
string
(
collectionJSON
))
if
err
!=
nil
{
return
err
...
...
@@ -160,7 +160,7 @@ func (t *hasPartitionTask) Execute() error {
return
err
}
t
.
hasPartition
=
t
.
mt
.
HasPartition
(
collectionMeta
.
I
d
,
partitionName
.
Tag
)
t
.
hasPartition
=
t
.
mt
.
HasPartition
(
collectionMeta
.
I
D
,
partitionName
.
Tag
)
return
nil
}
...
...
internal/master/timesync/time_sync_producer.go
浏览文件 @
0b478b61
...
...
@@ -64,7 +64,7 @@ func (syncMsgProducer *timeSyncMsgProducer) broadcastMsg(barrier TimeTickBarrier
}
timeTickResult
:=
internalPb
.
TimeTickMsg
{
MsgType
:
internalPb
.
MsgType_kTimeTick
,
PeerI
d
:
0
,
PeerI
D
:
0
,
Timestamp
:
timetick
,
}
timeTickMsg
:=
&
ms
.
TimeTickMsg
{
...
...
internal/master/timesync/timesync.go
浏览文件 @
0b478b61
...
...
@@ -72,16 +72,16 @@ func (ttBarrier *softTimeTickBarrier) Start() error {
if
len
(
ttmsgs
.
Msgs
)
>
0
{
for
_
,
timetickmsg
:=
range
ttmsgs
.
Msgs
{
ttmsg
:=
(
*
timetickmsg
)
.
(
*
ms
.
TimeTickMsg
)
oldT
,
ok
:=
ttBarrier
.
peer2LastTt
[
ttmsg
.
PeerI
d
]
log
.
Printf
(
"[softTimeTickBarrier] peer(%d)=%d
\n
"
,
ttmsg
.
PeerI
d
,
ttmsg
.
Timestamp
)
oldT
,
ok
:=
ttBarrier
.
peer2LastTt
[
ttmsg
.
PeerI
D
]
log
.
Printf
(
"[softTimeTickBarrier] peer(%d)=%d
\n
"
,
ttmsg
.
PeerI
D
,
ttmsg
.
Timestamp
)
if
!
ok
{
log
.
Printf
(
"[softTimeTickBarrier] Warning: peerID %d not exist
\n
"
,
ttmsg
.
PeerI
d
)
log
.
Printf
(
"[softTimeTickBarrier] Warning: peerID %d not exist
\n
"
,
ttmsg
.
PeerI
D
)
continue
}
if
ttmsg
.
Timestamp
>
oldT
{
ttBarrier
.
peer2LastTt
[
ttmsg
.
PeerI
d
]
=
ttmsg
.
Timestamp
ttBarrier
.
peer2LastTt
[
ttmsg
.
PeerI
D
]
=
ttmsg
.
Timestamp
// get a legal Timestamp
ts
:=
ttBarrier
.
minTimestamp
()
...
...
@@ -189,20 +189,20 @@ func (ttBarrier *hardTimeTickBarrier) Start() error {
// Suppose ttmsg.Timestamp from stream is always larger than the previous one,
// that `ttmsg.Timestamp > oldT`
ttmsg
:=
(
*
timetickmsg
)
.
(
*
ms
.
TimeTickMsg
)
log
.
Printf
(
"[hardTimeTickBarrier] peer(%d)=%d
\n
"
,
ttmsg
.
PeerI
d
,
ttmsg
.
Timestamp
)
log
.
Printf
(
"[hardTimeTickBarrier] peer(%d)=%d
\n
"
,
ttmsg
.
PeerI
D
,
ttmsg
.
Timestamp
)
oldT
,
ok
:=
ttBarrier
.
peer2Tt
[
ttmsg
.
PeerI
d
]
oldT
,
ok
:=
ttBarrier
.
peer2Tt
[
ttmsg
.
PeerI
D
]
if
!
ok
{
log
.
Printf
(
"[hardTimeTickBarrier] Warning: peerID %d not exist
\n
"
,
ttmsg
.
PeerI
d
)
log
.
Printf
(
"[hardTimeTickBarrier] Warning: peerID %d not exist
\n
"
,
ttmsg
.
PeerI
D
)
continue
}
if
oldT
>
state
{
log
.
Printf
(
"[hardTimeTickBarrier] Warning: peer(%d) timestamp(%d) ahead
\n
"
,
ttmsg
.
PeerI
d
,
ttmsg
.
Timestamp
)
ttmsg
.
PeerI
D
,
ttmsg
.
Timestamp
)
}
ttBarrier
.
peer2Tt
[
ttmsg
.
PeerI
d
]
=
ttmsg
.
Timestamp
ttBarrier
.
peer2Tt
[
ttmsg
.
PeerI
D
]
=
ttmsg
.
Timestamp
newState
:=
ttBarrier
.
minTimestamp
()
if
newState
>
state
{
...
...
internal/master/timesync/timesync_test.go
浏览文件 @
0b478b61
...
...
@@ -21,7 +21,7 @@ func getTtMsg(msgType internalPb.MsgType, peerID UniqueID, timeStamp uint64) *ms
}
timeTickResult
:=
internalPb
.
TimeTickMsg
{
MsgType
:
internalPb
.
MsgType_kTimeTick
,
PeerI
d
:
peerID
,
PeerI
D
:
peerID
,
Timestamp
:
timeStamp
,
}
timeTickMsg
:=
&
ms
.
TimeTickMsg
{
...
...
internal/msgstream/msgstream.go
浏览文件 @
0b478b61
...
...
@@ -395,7 +395,7 @@ func insertRepackFunc(tsMsgs []*TsMsg, hashKeys [][]int32) (map[int32]*MsgPack,
keys
:=
hashKeys
[
i
]
timestampLen
:=
len
(
insertRequest
.
Timestamps
)
rowIDLen
:=
len
(
insertRequest
.
RowI
d
s
)
rowIDLen
:=
len
(
insertRequest
.
RowI
D
s
)
rowDataLen
:=
len
(
insertRequest
.
RowData
)
keysLen
:=
len
(
keys
)
...
...
@@ -411,14 +411,14 @@ func insertRepackFunc(tsMsgs []*TsMsg, hashKeys [][]int32) (map[int32]*MsgPack,
sliceRequest
:=
internalPb
.
InsertRequest
{
MsgType
:
internalPb
.
MsgType_kInsert
,
ReqI
d
:
insertRequest
.
ReqId
,
ReqI
D
:
insertRequest
.
ReqID
,
CollectionName
:
insertRequest
.
CollectionName
,
PartitionTag
:
insertRequest
.
PartitionTag
,
SegmentI
d
:
insertRequest
.
SegmentId
,
ChannelI
d
:
insertRequest
.
ChannelId
,
ProxyI
d
:
insertRequest
.
ProxyId
,
SegmentI
D
:
insertRequest
.
SegmentID
,
ChannelI
D
:
insertRequest
.
ChannelID
,
ProxyI
D
:
insertRequest
.
ProxyID
,
Timestamps
:
[]
uint64
{
insertRequest
.
Timestamps
[
index
]},
RowI
ds
:
[]
int64
{
insertRequest
.
RowId
s
[
index
]},
RowI
Ds
:
[]
int64
{
insertRequest
.
RowID
s
[
index
]},
RowData
:
[]
*
commonPb
.
Blob
{
insertRequest
.
RowData
[
index
]},
}
...
...
@@ -458,10 +458,10 @@ func deleteRepackFunc(tsMsgs []*TsMsg, hashKeys [][]int32) (map[int32]*MsgPack,
sliceRequest
:=
internalPb
.
DeleteRequest
{
MsgType
:
internalPb
.
MsgType_kDelete
,
ReqI
d
:
deleteRequest
.
ReqId
,
ReqI
D
:
deleteRequest
.
ReqID
,
CollectionName
:
deleteRequest
.
CollectionName
,
ChannelI
d
:
deleteRequest
.
ChannelId
,
ProxyI
d
:
deleteRequest
.
ProxyId
,
ChannelI
D
:
deleteRequest
.
ChannelID
,
ProxyI
D
:
deleteRequest
.
ProxyID
,
Timestamps
:
[]
uint64
{
deleteRequest
.
Timestamps
[
index
]},
PrimaryKeys
:
[]
int64
{
deleteRequest
.
PrimaryKeys
[
index
]},
}
...
...
internal/msgstream/msgstream_test.go
浏览文件 @
0b478b61
...
...
@@ -37,14 +37,14 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue int32) *TsMsg {
case
internalPb
.
MsgType_kInsert
:
insertRequest
:=
internalPb
.
InsertRequest
{
MsgType
:
internalPb
.
MsgType_kInsert
,
ReqI
d
:
reqID
,
ReqI
D
:
reqID
,
CollectionName
:
"Collection"
,
PartitionTag
:
"Partition"
,
SegmentI
d
:
1
,
ChannelI
d
:
1
,
ProxyI
d
:
1
,
SegmentI
D
:
1
,
ChannelI
D
:
1
,
ProxyI
D
:
1
,
Timestamps
:
[]
Timestamp
{
1
},
RowI
d
s
:
[]
int64
{
1
},
RowI
D
s
:
[]
int64
{
1
},
RowData
:
[]
*
commonPb
.
Blob
{{}},
}
insertMsg
:=
&
InsertMsg
{
...
...
@@ -55,10 +55,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue int32) *TsMsg {
case
internalPb
.
MsgType_kDelete
:
deleteRequest
:=
internalPb
.
DeleteRequest
{
MsgType
:
internalPb
.
MsgType_kDelete
,
ReqI
d
:
reqID
,
ReqI
D
:
reqID
,
CollectionName
:
"Collection"
,
ChannelI
d
:
1
,
ProxyI
d
:
1
,
ChannelI
D
:
1
,
ProxyI
D
:
1
,
Timestamps
:
[]
Timestamp
{
1
},
PrimaryKeys
:
[]
IntPrimaryKey
{
1
},
}
...
...
@@ -70,10 +70,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue int32) *TsMsg {
case
internalPb
.
MsgType_kSearch
:
searchRequest
:=
internalPb
.
SearchRequest
{
MsgType
:
internalPb
.
MsgType_kSearch
,
ReqI
d
:
reqID
,
ProxyI
d
:
1
,
ReqI
D
:
reqID
,
ProxyI
D
:
1
,
Timestamp
:
1
,
ResultChannelI
d
:
1
,
ResultChannelI
D
:
1
,
}
searchMsg
:=
&
SearchMsg
{
BaseMsg
:
baseMsg
,
...
...
@@ -84,11 +84,11 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue int32) *TsMsg {
searchResult
:=
internalPb
.
SearchResult
{
MsgType
:
internalPb
.
MsgType_kSearchResult
,
Status
:
&
commonPb
.
Status
{
ErrorCode
:
commonPb
.
ErrorCode_SUCCESS
},
ReqI
d
:
reqID
,
ProxyI
d
:
1
,
QueryNodeI
d
:
1
,
ReqI
D
:
reqID
,
ProxyI
D
:
1
,
QueryNodeI
D
:
1
,
Timestamp
:
1
,
ResultChannelI
d
:
1
,
ResultChannelI
D
:
1
,
}
searchResultMsg
:=
&
SearchResultMsg
{
BaseMsg
:
baseMsg
,
...
...
@@ -98,7 +98,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue int32) *TsMsg {
case
internalPb
.
MsgType_kTimeTick
:
timeTickResult
:=
internalPb
.
TimeTickMsg
{
MsgType
:
internalPb
.
MsgType_kTimeTick
,
PeerI
d
:
reqID
,
PeerI
D
:
reqID
,
Timestamp
:
1
,
}
timeTickMsg
:=
&
TimeTickMsg
{
...
...
@@ -119,7 +119,7 @@ func getTimeTickMsg(reqID UniqueID, hashValue int32, time uint64) *TsMsg {
}
timeTickResult
:=
internalPb
.
TimeTickMsg
{
MsgType
:
internalPb
.
MsgType_kTimeTick
,
PeerI
d
:
reqID
,
PeerI
D
:
reqID
,
Timestamp
:
time
,
}
timeTickMsg
:=
&
TimeTickMsg
{
...
...
@@ -357,14 +357,14 @@ func TestStream_PulsarMsgStream_InsertRepackFunc(t *testing.T) {
insertRequest
:=
internalPb
.
InsertRequest
{
MsgType
:
internalPb
.
MsgType_kInsert
,
ReqI
d
:
1
,
ReqI
D
:
1
,
CollectionName
:
"Collection"
,
PartitionTag
:
"Partition"
,
SegmentI
d
:
1
,
ChannelI
d
:
1
,
ProxyI
d
:
1
,
SegmentI
D
:
1
,
ChannelI
D
:
1
,
ProxyI
D
:
1
,
Timestamps
:
[]
Timestamp
{
1
,
1
},
RowI
d
s
:
[]
int64
{
1
,
3
},
RowI
D
s
:
[]
int64
{
1
,
3
},
RowData
:
[]
*
commonPb
.
Blob
{{},
{}},
}
insertMsg
:=
&
InsertMsg
{
...
...
@@ -410,10 +410,10 @@ func TestStream_PulsarMsgStream_DeleteRepackFunc(t *testing.T) {
deleteRequest
:=
internalPb
.
DeleteRequest
{
MsgType
:
internalPb
.
MsgType_kDelete
,
ReqI
d
:
1
,
ReqI
D
:
1
,
CollectionName
:
"Collection"
,
ChannelI
d
:
1
,
ProxyI
d
:
1
,
ChannelI
D
:
1
,
ProxyI
D
:
1
,
Timestamps
:
[]
Timestamp
{
1
,
1
},
PrimaryKeys
:
[]
int64
{
1
,
3
},
}
...
...
@@ -460,7 +460,7 @@ func TestStream_PulsarMsgStream_DefaultRepackFunc(t *testing.T) {
timeTickRequest
:=
internalPb
.
TimeTickMsg
{
MsgType
:
internalPb
.
MsgType_kTimeTick
,
PeerI
d
:
int64
(
1
),
PeerI
D
:
int64
(
1
),
Timestamp
:
uint64
(
1
),
}
timeTick
:=
&
TimeTickMsg
{
...
...
internal/msgstream/task_test.go
浏览文件 @
0b478b61
...
...
@@ -51,7 +51,7 @@ func newRepackFunc(tsMsgs []*TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, err
keys
:=
hashKeys
[
i
]
timestampLen
:=
len
(
insertRequest
.
Timestamps
)
rowIDLen
:=
len
(
insertRequest
.
RowI
d
s
)
rowIDLen
:=
len
(
insertRequest
.
RowI
D
s
)
rowDataLen
:=
len
(
insertRequest
.
RowData
)
keysLen
:=
len
(
keys
)
...
...
@@ -67,14 +67,14 @@ func newRepackFunc(tsMsgs []*TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, err
sliceRequest
:=
internalPb
.
InsertRequest
{
MsgType
:
internalPb
.
MsgType_kInsert
,
ReqI
d
:
insertRequest
.
ReqId
,
ReqI
D
:
insertRequest
.
ReqID
,
CollectionName
:
insertRequest
.
CollectionName
,
PartitionTag
:
insertRequest
.
PartitionTag
,
SegmentI
d
:
insertRequest
.
SegmentId
,
ChannelI
d
:
insertRequest
.
ChannelId
,
ProxyI
d
:
insertRequest
.
ProxyId
,
SegmentI
D
:
insertRequest
.
SegmentID
,
ChannelI
D
:
insertRequest
.
ChannelID
,
ProxyI
D
:
insertRequest
.
ProxyID
,
Timestamps
:
[]
uint64
{
insertRequest
.
Timestamps
[
index
]},
RowI
ds
:
[]
int64
{
insertRequest
.
RowId
s
[
index
]},
RowI
Ds
:
[]
int64
{
insertRequest
.
RowID
s
[
index
]},
RowData
:
[]
*
commonPb
.
Blob
{
insertRequest
.
RowData
[
index
]},
}
...
...
@@ -97,14 +97,14 @@ func getMsg(reqID UniqueID, hashValue int32) *TsMsg {
}
insertRequest
:=
internalPb
.
InsertRequest
{
MsgType
:
internalPb
.
MsgType_kInsert
,
ReqI
d
:
reqID
,
ReqI
D
:
reqID
,
CollectionName
:
"Collection"
,
PartitionTag
:
"Partition"
,
SegmentI
d
:
1
,
ChannelI
d
:
1
,
ProxyI
d
:
1
,
SegmentI
D
:
1
,
ChannelI
D
:
1
,
ProxyI
D
:
1
,
Timestamps
:
[]
Timestamp
{
1
},
RowI
d
s
:
[]
int64
{
1
},
RowI
D
s
:
[]
int64
{
1
},
RowData
:
[]
*
commonPb
.
Blob
{{}},
}
insertMsg
:=
InsertMsg
{
...
...
internal/proto/etcd_meta.proto
浏览文件 @
0b478b61
...
...
@@ -6,32 +6,32 @@ import "common.proto";
import
"schema.proto"
;
message
TenantMeta
{
int64
id
=
1
;
int64
ID
=
1
;
int64
num_query_nodes
=
2
;
repeated
string
insert_channel
_id
s
=
3
;
string
query_channel
_id
=
4
;
repeated
string
insert_channel
ID
s
=
3
;
string
query_channel
ID
=
4
;
}
message
ProxyMeta
{
int64
id
=
1
;
int64
ID
=
1
;
common.Address
address
=
2
;
repeated
string
result_channel
_id
s
=
3
;
repeated
string
result_channel
ID
s
=
3
;
}
message
CollectionMeta
{
int64
id
=
1
;
int64
ID
=
1
;
schema.CollectionSchema
schema
=
2
;
uint64
create_time
=
3
;
repeated
int64
segment
_id
s
=
4
;
repeated
int64
segment
ID
s
=
4
;
repeated
string
partition_tags
=
5
;
}
message
SegmentMeta
{
int64
segment
_id
=
1
;
int64
collection
_id
=
2
;
int64
segment
ID
=
1
;
int64
collection
ID
=
2
;
string
partition_tag
=
3
;
int32
channel_start
=
4
;
int32
channel_end
=
5
;
...
...
internal/proto/etcdpb/etcd_meta.pb.go
浏览文件 @
0b478b61
...
...
@@ -23,10 +23,10 @@ var _ = math.Inf
const
_
=
proto
.
ProtoPackageIsVersion3
// please upgrade the proto package
type
TenantMeta
struct
{
I
d
int64
`protobuf:"varint,1,opt,name=id,proto3" json:"id
,omitempty"`
I
D
int64
`protobuf:"varint,1,opt,name=ID,proto3" json:"ID
,omitempty"`
NumQueryNodes
int64
`protobuf:"varint,2,opt,name=num_query_nodes,json=numQueryNodes,proto3" json:"num_query_nodes,omitempty"`
InsertChannelI
ds
[]
string
`protobuf:"bytes,3,rep,name=insert_channel_ids,json=insertChannelIds,proto3" json:"insert_channel_id
s,omitempty"`
QueryChannelI
d
string
`protobuf:"bytes,4,opt,name=query_channel_id,json=queryChannelId,proto3" json:"query_channel_id
,omitempty"`
InsertChannelI
Ds
[]
string
`protobuf:"bytes,3,rep,name=insert_channelIDs,json=insertChannelIDs,proto3" json:"insert_channelID
s,omitempty"`
QueryChannelI
D
string
`protobuf:"bytes,4,opt,name=query_channelID,json=queryChannelID,proto3" json:"query_channelID
,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
...
@@ -57,9 +57,9 @@ func (m *TenantMeta) XXX_DiscardUnknown() {
var
xxx_messageInfo_TenantMeta
proto
.
InternalMessageInfo
func
(
m
*
TenantMeta
)
GetI
d
()
int64
{
func
(
m
*
TenantMeta
)
GetI
D
()
int64
{
if
m
!=
nil
{
return
m
.
I
d
return
m
.
I
D
}
return
0
}
...
...
@@ -71,24 +71,24 @@ func (m *TenantMeta) GetNumQueryNodes() int64 {
return
0
}
func
(
m
*
TenantMeta
)
GetInsertChannelI
d
s
()
[]
string
{
func
(
m
*
TenantMeta
)
GetInsertChannelI
D
s
()
[]
string
{
if
m
!=
nil
{
return
m
.
InsertChannelI
d
s
return
m
.
InsertChannelI
D
s
}
return
nil
}
func
(
m
*
TenantMeta
)
GetQueryChannelI
d
()
string
{
func
(
m
*
TenantMeta
)
GetQueryChannelI
D
()
string
{
if
m
!=
nil
{
return
m
.
QueryChannelI
d
return
m
.
QueryChannelI
D
}
return
""
}
type
ProxyMeta
struct
{
I
d
int64
`protobuf:"varint,1,opt,name=id,proto3" json:"id
,omitempty"`
I
D
int64
`protobuf:"varint,1,opt,name=ID,proto3" json:"ID
,omitempty"`
Address
*
commonpb
.
Address
`protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
ResultChannelI
ds
[]
string
`protobuf:"bytes,3,rep,name=result_channel_ids,json=resultChannelIds,proto3" json:"result_channel_id
s,omitempty"`
ResultChannelI
Ds
[]
string
`protobuf:"bytes,3,rep,name=result_channelIDs,json=resultChannelIDs,proto3" json:"result_channelID
s,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
...
@@ -119,9 +119,9 @@ func (m *ProxyMeta) XXX_DiscardUnknown() {
var
xxx_messageInfo_ProxyMeta
proto
.
InternalMessageInfo
func
(
m
*
ProxyMeta
)
GetI
d
()
int64
{
func
(
m
*
ProxyMeta
)
GetI
D
()
int64
{
if
m
!=
nil
{
return
m
.
I
d
return
m
.
I
D
}
return
0
}
...
...
@@ -133,18 +133,18 @@ func (m *ProxyMeta) GetAddress() *commonpb.Address {
return
nil
}
func
(
m
*
ProxyMeta
)
GetResultChannelI
d
s
()
[]
string
{
func
(
m
*
ProxyMeta
)
GetResultChannelI
D
s
()
[]
string
{
if
m
!=
nil
{
return
m
.
ResultChannelI
d
s
return
m
.
ResultChannelI
D
s
}
return
nil
}
type
CollectionMeta
struct
{
I
d
int64
`protobuf:"varint,1,opt,name=id,proto3" json:"id
,omitempty"`
I
D
int64
`protobuf:"varint,1,opt,name=ID,proto3" json:"ID
,omitempty"`
Schema
*
schemapb
.
CollectionSchema
`protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"`
CreateTime
uint64
`protobuf:"varint,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
SegmentI
ds
[]
int64
`protobuf:"varint,4,rep,packed,name=segment_ids,json=segmentIds,proto3" json:"segment_id
s,omitempty"`
SegmentI
Ds
[]
int64
`protobuf:"varint,4,rep,packed,name=segmentIDs,proto3" json:"segmentID
s,omitempty"`
PartitionTags
[]
string
`protobuf:"bytes,5,rep,name=partition_tags,json=partitionTags,proto3" json:"partition_tags,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
...
...
@@ -176,9 +176,9 @@ func (m *CollectionMeta) XXX_DiscardUnknown() {
var
xxx_messageInfo_CollectionMeta
proto
.
InternalMessageInfo
func
(
m
*
CollectionMeta
)
GetI
d
()
int64
{
func
(
m
*
CollectionMeta
)
GetI
D
()
int64
{
if
m
!=
nil
{
return
m
.
I
d
return
m
.
I
D
}
return
0
}
...
...
@@ -197,9 +197,9 @@ func (m *CollectionMeta) GetCreateTime() uint64 {
return
0
}
func
(
m
*
CollectionMeta
)
GetSegmentI
d
s
()
[]
int64
{
func
(
m
*
CollectionMeta
)
GetSegmentI
D
s
()
[]
int64
{
if
m
!=
nil
{
return
m
.
SegmentI
d
s
return
m
.
SegmentI
D
s
}
return
nil
}
...
...
@@ -212,8 +212,8 @@ func (m *CollectionMeta) GetPartitionTags() []string {
}
type
SegmentMeta
struct
{
SegmentI
d
int64
`protobuf:"varint,1,opt,name=segment_id,json=segmentId,proto3" json:"segment_id
,omitempty"`
CollectionI
d
int64
`protobuf:"varint,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id
,omitempty"`
SegmentI
D
int64
`protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID
,omitempty"`
CollectionI
D
int64
`protobuf:"varint,2,opt,name=collectionID,proto3" json:"collectionID
,omitempty"`
PartitionTag
string
`protobuf:"bytes,3,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"`
ChannelStart
int32
`protobuf:"varint,4,opt,name=channel_start,json=channelStart,proto3" json:"channel_start,omitempty"`
ChannelEnd
int32
`protobuf:"varint,5,opt,name=channel_end,json=channelEnd,proto3" json:"channel_end,omitempty"`
...
...
@@ -250,16 +250,16 @@ func (m *SegmentMeta) XXX_DiscardUnknown() {
var
xxx_messageInfo_SegmentMeta
proto
.
InternalMessageInfo
func
(
m
*
SegmentMeta
)
GetSegmentI
d
()
int64
{
func
(
m
*
SegmentMeta
)
GetSegmentI
D
()
int64
{
if
m
!=
nil
{
return
m
.
SegmentI
d
return
m
.
SegmentI
D
}
return
0
}
func
(
m
*
SegmentMeta
)
GetCollectionI
d
()
int64
{
func
(
m
*
SegmentMeta
)
GetCollectionI
D
()
int64
{
if
m
!=
nil
{
return
m
.
CollectionI
d
return
m
.
CollectionI
D
}
return
0
}
...
...
@@ -316,37 +316,37 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"etcd_meta.proto"
,
fileDescriptor_975d306d62b73e88
)
}
var
fileDescriptor_975d306d62b73e88
=
[]
byte
{
// 50
5
bytes of a gzipped FileDescriptorProto
// 50
6
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0x6c
,
0x93
,
0x4d
,
0x8f
,
0xd3
,
0x30
,
0x10
,
0x86
,
0x95
,
0xa6
,
0x5f
,
0x99
,
0x7e
,
0x
ec
,
0x92
,
0x53
,
0x58
,
0x58
,
0x51
,
0x15
,
0x2d
,
0xca
,
0x
01
,
0x5a
,
0x09
,
0x24
,
0x6e
,
0x20
,
0x60
,
0xc5
,
0x81
,
0x03
,
0x08
,
0xd2
,
0x9e
,
0xb8
,
0x44
,
0x6e
,
0x
3c
,
0x6a
,
0x2d
,
0xc5
,
0x76
,
0xb1
,
0x1d
,
0x96
,
0xdd
,
0x1b
,
0xbf
,
0x81
,
0x2b
,
0x3f
,
0x88
,
0x9f
,
0x
85
,
0xfc
,
0x41
,
0x43
,
0xa5
,
0x1e
,
0xf3
,
0xcc
,
0xeb
,
0xf1
,
0x3b
,
0xef
,
0x38
,
0x70
,
0x86
,
0xa6
,
0x
a2
,
0x25
,
0x47
,
0x43
,
0x16
,
0x7b
,
0x25
,
0x8d
,
0x4c
,
0xef
,
0x71
,
0x56
,
0x7f
,
0x6f
,
0xb4
,
0xff
,
0x
5a
,
0xd8
,
0xea
,
0xc5
,
0xb8
,
0x92
,
0x9c
,
0x4b
,
0xe1
,
0xd1
,
0xc5
,
0x58
,
0x57
,
0x3b
,
0xe4
,
0x41
,
0x
3e
,
0xff
,
0x1d
,
0x01
,
0xac
,
0x51
,
0x10
,
0x61
,
0x3e
,
0xa2
,
0x21
,
0xe9
,
0x14
,
0x3a
,
0x8c
,
0x66
,
0x
d1
,
0x2c
,
0xca
,
0xe3
,
0xa2
,
0xc3
,
0x68
,
0xfa
,
0x04
,
0xce
,
0x44
,
0xc3
,
0xcb
,
0x6f
,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8
,
0xf2
,
0x7d
,
0xe8
,
0x9a
,
0x37
,
0x2c
,
0xc5
,
0x
b5
,
0x4a
,
0xba
,
0x76
,
0x8c
,
0x0e
,
0xaf
,
0x58
,
0x2a
,
0xae
,
0xd5
,
0x87
,
0x77
,
0xdf
,
0xde
,
0x6e
,
0x
a9
,
0xde
,
0x55
,
0x1b
,
0xf3
,
0x58
,
0xe6
,
0xb7
,
0xb4
,
0x2c
,
0xe9
,
0xad
,
0xc6
,
0x7c
,
0x37
,
0x77
,
0x
1b
,
0x7c
,
0x51
,
0x50
,
0xa5
,
0x25
,
0xdd
,
0x54
,
0x1a
,
0x8b
,
0x39
,
0xe5
,
0x1a
,
0x25
,
0x27
,
0xe5
,
0x
dc
,
0xae
,
0x75
,
0x6e
,
0xfe
,
0xac
,
0xfd
,
0x66
,
0xd3
,
0xb6
,
0x5f
,
0xaf
,
0xfe
,
0x05
,
0x00
,
0x00
,
0xff
,
0xf
f
,
0xc2
,
0xde
,
0x28
,
0x4b
,
0x88
,
0x03
,
0x00
,
0x00
,
}
internal/proto/internal_msg.proto
浏览文件 @
0b478b61
...
...
@@ -47,20 +47,20 @@ enum PeerRole {
}
message
I
d
Request
{
int64
peer
_id
=
1
;
message
I
D
Request
{
int64
peer
ID
=
1
;
PeerRole
role
=
2
;
uint32
count
=
3
;
}
message
I
d
Response
{
message
I
D
Response
{
common.Status
status
=
1
;
int64
id
=
2
;
int64
ID
=
2
;
uint32
count
=
3
;
}
message
TsoRequest
{
int64
peer
_id
=
1
;
int64
peer
ID
=
1
;
PeerRole
role
=
2
;
uint32
count
=
3
;
}
...
...
@@ -74,113 +74,113 @@ message TsoResponse {
message
CreateCollectionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
common.Blob
schema
=
5
;
}
message
DropCollectionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.CollectionName
collection_name
=
5
;
}
message
HasCollectionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.CollectionName
collection_name
=
5
;
}
message
DescribeCollectionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.CollectionName
collection_name
=
5
;
}
message
ShowCollectionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
}
message
CreatePartitionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.PartitionName
partition_name
=
5
;
}
message
DropPartitionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.PartitionName
partition_name
=
5
;
}
message
HasPartitionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.PartitionName
partition_name
=
5
;
}
message
DescribePartitionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.PartitionName
partition_name
=
5
;
}
message
ShowPartitionRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
uint64
timestamp
=
3
;
int64
proxy
_id
=
4
;
int64
proxy
ID
=
4
;
service.CollectionName
collection_name
=
5
;
}
message
InsertRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
string
collection_name
=
3
;
string
partition_tag
=
4
;
int64
segment
_id
=
5
;
int64
channel
_id
=
6
;
int64
proxy
_id
=
7
;
int64
segment
ID
=
5
;
int64
channel
ID
=
6
;
int64
proxy
ID
=
7
;
repeated
uint64
timestamps
=
8
;
repeated
int64
row
_id
s
=
9
;
repeated
int64
row
ID
s
=
9
;
repeated
common.Blob
row_data
=
10
;
}
message
DeleteRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
req
ID
=
2
;
string
collection_name
=
3
;
int64
channel
_id
=
4
;
int64
proxy
_id
=
5
;
int64
channel
ID
=
4
;
int64
proxy
ID
=
5
;
repeated
uint64
timestamps
=
6
;
repeated
int64
primary_keys
=
7
;
}
...
...
@@ -188,10 +188,10 @@ message DeleteRequest {
message
SearchRequest
{
MsgType
msg_type
=
1
;
int64
req
_id
=
2
;
int64
proxy
_id
=
3
;
int64
req
ID
=
2
;
int64
proxy
ID
=
3
;
uint64
timestamp
=
4
;
int64
result_channel
_id
=
5
;
int64
result_channel
ID
=
5
;
common.Blob
query
=
6
;
}
...
...
@@ -199,37 +199,37 @@ message SearchRequest {
message
SearchResult
{
MsgType
msg_type
=
1
;
common.Status
status
=
2
;
int64
req
_id
=
3
;
int64
proxy
_id
=
4
;
int64
query_node
_id
=
5
;
int64
req
ID
=
3
;
int64
proxy
ID
=
4
;
int64
query_node
ID
=
5
;
uint64
timestamp
=
6
;
int64
result_channel
_id
=
7
;
int64
result_channel
ID
=
7
;
repeated
service.Hits
hits
=
8
;
}
message
TimeTickMsg
{
MsgType
msg_type
=
1
;
int64
peer
_id
=
2
;
int64
peer
ID
=
2
;
uint64
timestamp
=
3
;
}
message
Key2Seg
{
int64
row
_id
=
1
;
int64
row
ID
=
1
;
int64
primary_key
=
2
;
uint64
timestamp
=
3
;
bool
is_valid
=
4
;
repeated
int64
segment
_id
s
=
5
;
repeated
int64
segment
ID
s
=
5
;
}
message
Key2SegMsg
{
int64
req
_id
=
1
;
int64
req
ID
=
1
;
repeated
Key2Seg
key2seg
=
2
;
}
message
SegmentStats
{
int64
segment
_id
=
1
;
int64
segment
ID
=
1
;
int64
memory_size
=
2
;
int64
num_rows
=
3
;
bool
recently_modified
=
4
;
...
...
@@ -237,6 +237,6 @@ message SegmentStats {
message
QueryNodeSegStats
{
MsgType
msg_type
=
1
;
int64
peer
_id
=
2
;
int64
peer
ID
=
2
;
repeated
SegmentStats
seg_stats
=
3
;
}
\ No newline at end of file
internal/proto/internalpb/internal_msg.pb.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/proto/master.proto
浏览文件 @
0b478b61
...
...
@@ -90,5 +90,5 @@ service Master {
rpc
AllocTimestamp
(
internal.TsoRequest
)
returns
(
internal.TsoResponse
)
{}
rpc
AllocI
d
(
internal.IdRequest
)
returns
(
internal.Id
Response
)
{}
rpc
AllocI
D
(
internal.IDRequest
)
returns
(
internal.ID
Response
)
{}
}
internal/proto/masterpb/master.pb.go
浏览文件 @
0b478b61
...
...
@@ -33,31 +33,31 @@ var fileDescriptor_f9c348dec43a6705 = []byte{
// 432 bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0x9c
,
0x94
,
0x51
,
0xaf
,
0xd2
,
0x30
,
0x14
,
0xc7
,
0x79
,
0xba
,
0xc6
,
0x86
,
0xcb
,
0xf5
,
0xd6
,
0x37
,
0x7c
,
0xf1
,
0xee
,
0xc9
,
0x80
,
0x6c
,
0x46
,
0xbf
,
0x80
,
0x
02
,
0x0f
,
0x90
,
0x68
,
0x42
,
0x80
,
0x17
,
0x35
,
0x06
,
0xbb
,
0xad
,
0x81
,
0xc6
,
0x46
,
0xbf
,
0x80
,
0x
c2
,
0x1e
,
0x20
,
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0xcb
,
0x80
,
0x
26
,
0xf7
,
0x66
,
0xb1
,
0x8d
,
0x4d
,
0xf0
,
0x8f
,
0x08
,
0x9c
,
0x78
,
0x0d
,
0xce
,
0x7b
,
0xd5
,
0x3a
,
0x
3b
,
0x00
,
0x82
,
0xf4
,
0x8a
,
0xc5
,
0xd6
,
0xaf
,
0xe0
,
0x9c
,
0x99
,
0x25
,
0x7b
,
0xcc
,
0xfa
,
0x3
f
,
0x
93
,
0xde
,
0x07
,
0x29
,
0x55
,
0xbc
,
0x12
,
0x09
,
0x07
,
0x64
,
0x49
,
0x46
,
0x1f
,
0x1c
,
0x56
,
0x2b
,
0x
50
,
0x8e
,
0xc9
,
0xd9
,
0x92
,
0x1a
,
0x3d
,
0x27
,
0x4f
,
0x4a
,
0xf4
,
0x2c
,
0xa4
,
0x2f
,
0x1d
,
0x05
,
0x
b3
,
0xd0
,
0x20
,
0x1f
,
0x2e
,
0x28
,
0x0c
,
0x71
,
0x3c
,
0xfe
,
0xf2
,
0x7e
,
0x2b
,
0x70
,
0x97
,
0x47
,
0x
45
,
0x0e
,
0x82
,
0x83
,
0x90
,
0x52
,
0x1c
,
0x90
,
0xc7
,
0xbb
,
0xa0
,
0xaa
,
0x1d
,
0x6d
,
0x04
,
0xa
0
,
0x
16
,
0x51
,
0x8e
,
0x7c
,
0x13
,
0x18
,
0x42
,
0x50
,
0x02
,
0x83
,
0xea
,
0xbb
,
0x99
,
0x45
,
0xd
1
,
0x4d
,
0x79
,
0x7e
,
0xf7
,
0x27
,
0x00
,
0x00
,
0xff
,
0xff
,
0x
ba
,
0x9e
,
0x0e
,
0x5d
,
0x65
,
0x05
,
0x00
,
0x00
,
}
// Reference imports to suppress errors if they are not otherwise used.
...
...
@@ -133,7 +133,7 @@ type MasterClient interface {
// @return StringListResponse
ShowPartitions
(
ctx
context
.
Context
,
in
*
internalpb
.
ShowPartitionRequest
,
opts
...
grpc
.
CallOption
)
(
*
servicepb
.
StringListResponse
,
error
)
AllocTimestamp
(
ctx
context
.
Context
,
in
*
internalpb
.
TsoRequest
,
opts
...
grpc
.
CallOption
)
(
*
internalpb
.
TsoResponse
,
error
)
AllocI
d
(
ctx
context
.
Context
,
in
*
internalpb
.
IdRequest
,
opts
...
grpc
.
CallOption
)
(
*
internalpb
.
Id
Response
,
error
)
AllocI
D
(
ctx
context
.
Context
,
in
*
internalpb
.
IDRequest
,
opts
...
grpc
.
CallOption
)
(
*
internalpb
.
ID
Response
,
error
)
}
type
masterClient
struct
{
...
...
@@ -243,9 +243,9 @@ func (c *masterClient) AllocTimestamp(ctx context.Context, in *internalpb.TsoReq
return
out
,
nil
}
func
(
c
*
masterClient
)
AllocI
d
(
ctx
context
.
Context
,
in
*
internalpb
.
IdRequest
,
opts
...
grpc
.
CallOption
)
(
*
internalpb
.
Id
Response
,
error
)
{
out
:=
new
(
internalpb
.
I
d
Response
)
err
:=
c
.
cc
.
Invoke
(
ctx
,
"/milvus.proto.master.Master/AllocI
d
"
,
in
,
out
,
opts
...
)
func
(
c
*
masterClient
)
AllocI
D
(
ctx
context
.
Context
,
in
*
internalpb
.
IDRequest
,
opts
...
grpc
.
CallOption
)
(
*
internalpb
.
ID
Response
,
error
)
{
out
:=
new
(
internalpb
.
I
D
Response
)
err
:=
c
.
cc
.
Invoke
(
ctx
,
"/milvus.proto.master.Master/AllocI
D
"
,
in
,
out
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -315,7 +315,7 @@ type MasterServer interface {
// @return StringListResponse
ShowPartitions
(
context
.
Context
,
*
internalpb
.
ShowPartitionRequest
)
(
*
servicepb
.
StringListResponse
,
error
)
AllocTimestamp
(
context
.
Context
,
*
internalpb
.
TsoRequest
)
(
*
internalpb
.
TsoResponse
,
error
)
AllocI
d
(
context
.
Context
,
*
internalpb
.
IdRequest
)
(
*
internalpb
.
Id
Response
,
error
)
AllocI
D
(
context
.
Context
,
*
internalpb
.
IDRequest
)
(
*
internalpb
.
ID
Response
,
error
)
}
// UnimplementedMasterServer can be embedded to have forward compatible implementations.
...
...
@@ -355,8 +355,8 @@ func (*UnimplementedMasterServer) ShowPartitions(ctx context.Context, req *inter
func
(
*
UnimplementedMasterServer
)
AllocTimestamp
(
ctx
context
.
Context
,
req
*
internalpb
.
TsoRequest
)
(
*
internalpb
.
TsoResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method AllocTimestamp not implemented"
)
}
func
(
*
UnimplementedMasterServer
)
AllocI
d
(
ctx
context
.
Context
,
req
*
internalpb
.
IdRequest
)
(
*
internalpb
.
Id
Response
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method AllocI
d
not implemented"
)
func
(
*
UnimplementedMasterServer
)
AllocI
D
(
ctx
context
.
Context
,
req
*
internalpb
.
IDRequest
)
(
*
internalpb
.
ID
Response
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method AllocI
D
not implemented"
)
}
func
RegisterMasterServer
(
s
*
grpc
.
Server
,
srv
MasterServer
)
{
...
...
@@ -561,20 +561,20 @@ func _Master_AllocTimestamp_Handler(srv interface{}, ctx context.Context, dec fu
return
interceptor
(
ctx
,
in
,
info
,
handler
)
}
func
_Master_AllocI
d
_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
in
:=
new
(
internalpb
.
I
d
Request
)
func
_Master_AllocI
D
_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
,
interceptor
grpc
.
UnaryServerInterceptor
)
(
interface
{},
error
)
{
in
:=
new
(
internalpb
.
I
D
Request
)
if
err
:=
dec
(
in
);
err
!=
nil
{
return
nil
,
err
}
if
interceptor
==
nil
{
return
srv
.
(
MasterServer
)
.
AllocI
d
(
ctx
,
in
)
return
srv
.
(
MasterServer
)
.
AllocI
D
(
ctx
,
in
)
}
info
:=
&
grpc
.
UnaryServerInfo
{
Server
:
srv
,
FullMethod
:
"/milvus.proto.master.Master/AllocI
d
"
,
FullMethod
:
"/milvus.proto.master.Master/AllocI
D
"
,
}
handler
:=
func
(
ctx
context
.
Context
,
req
interface
{})
(
interface
{},
error
)
{
return
srv
.
(
MasterServer
)
.
AllocI
d
(
ctx
,
req
.
(
*
internalpb
.
Id
Request
))
return
srv
.
(
MasterServer
)
.
AllocI
D
(
ctx
,
req
.
(
*
internalpb
.
ID
Request
))
}
return
interceptor
(
ctx
,
in
,
info
,
handler
)
}
...
...
@@ -628,8 +628,8 @@ var _Master_serviceDesc = grpc.ServiceDesc{
Handler
:
_Master_AllocTimestamp_Handler
,
},
{
MethodName
:
"AllocI
d
"
,
Handler
:
_Master_AllocI
d
_Handler
,
MethodName
:
"AllocI
D
"
,
Handler
:
_Master_AllocI
D
_Handler
,
},
},
Streams
:
[]
grpc
.
StreamDesc
{},
...
...
internal/proto/schema.proto
浏览文件 @
0b478b61
...
...
@@ -42,6 +42,6 @@ message FieldSchema {
message
CollectionSchema
{
string
name
=
1
;
string
description
=
2
;
bool
auto
_id
=
3
;
bool
auto
ID
=
3
;
repeated
FieldSchema
fields
=
4
;
}
internal/proto/schemapb/schema.pb.go
浏览文件 @
0b478b61
...
...
@@ -153,7 +153,7 @@ func (m *FieldSchema) GetIndexParams() []*commonpb.KeyValuePair {
type
CollectionSchema
struct
{
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description
string
`protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
AutoI
d
bool
`protobuf:"varint,3,opt,name=auto_id,json=autoId,proto3" json:"auto_id
,omitempty"`
AutoI
D
bool
`protobuf:"varint,3,opt,name=autoID,proto3" json:"autoID
,omitempty"`
Fields
[]
*
FieldSchema
`protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
...
...
@@ -199,9 +199,9 @@ func (m *CollectionSchema) GetDescription() string {
return
""
}
func
(
m
*
CollectionSchema
)
GetAutoI
d
()
bool
{
func
(
m
*
CollectionSchema
)
GetAutoI
D
()
bool
{
if
m
!=
nil
{
return
m
.
AutoI
d
return
m
.
AutoI
D
}
return
false
}
...
...
@@ -222,32 +222,31 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"schema.proto"
,
fileDescriptor_1c5fb4d8cc22d66a
)
}
var
fileDescriptor_1c5fb4d8cc22d66a
=
[]
byte
{
// 41
9
bytes of a gzipped FileDescriptorProto
// 41
6
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xa4
,
0x91
,
0x5f
,
0x8b
,
0xd4
,
0x30
,
0x14
,
0xc5
,
0xed
,
0xfc
,
0x73
,
0xe6
,
0x76
,
0x94
,
0x18
,
0x05
,
0x07
,
0x41
,
0xa8
,
0xfb
,
0x34
,
0x08
,
0xb6
,
0x38
,
0x2b
,
0xcb
,
0xe2
,
0x93
,
0xdb
,
0x9d
,
0x59
,
0x29
,
0x0e
,
0xed
,
0x92
,
0xad
,
0x0b
,
0xfa
,
0x52
,
0xd2
,
0x26
,
0x3a
,
0x81
,
0xf4
,
0x0f
,
0x6d
,
0x2a
,
0xce
,
0x7e
,
0x03
,
0x1f
,
0x7d
,
0xf6
,
0xcb
,
0x4a
,
0xd2
,
0x0e
,
0xac
,
0xb0
,
0x0f
,
0xc2
,
0xbe
,
0xfd
,
0xee
,
0xbd
,
0x39
,
0x37
,
0x39
,
0x27
,
0x30
,
0x6f
,
0xb2
,
0x1d
,
0xcf
,
0xa9
,
0x5b
,
0xd5
,
0xa5
,
0x2a
,
0xf1
,
0xd3
,
0x5c
,
0xc8
,
0x1f
,
0x6d
,
0xd3
,
0x55
,
0x6e
,
0x37
,
0x7a
,
0x31
,
0xcf
,
0xca
,
0x3c
,
0x2f
,
0x8b
,
0xae
,
0x79
,
0xf4
,
0x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
0xa3
,
0x0f
,
0xe8
,
0x29
,
0x7e
,
0x0c
,
0x0f
,
0x6f
,
0xd7
,
0x97
,
0x49
,
0x4c
,
0xb6
,
0x7e
,
0x18
,
0x5d
,
0x90
,
0xcf
,
0x88
,
0x61
,
0x04
,
0xf3
,
0xbe
,
0xd5
,
0x89
,
0xb9
,
0xef
,
0x7f
,
0x79
,
0xff
,
0x4d
,
0xa8
,
0x5d
,
0x9b
,
0xea
,
0x6c
,
0xbd
,
0x3b
,
0x21
,
0xa5
,
0xb8
,
0x53
,
0x3c
,
0xdb
,
0x79
,
0x9d
,
0xa9
,
0xd7
,
0x4c
,
0x34
,
0xaa
,
0x16
,
0x69
,
0xab
,
0x38
,
0xf3
,
0x44
,
0xa1
,
0x78
,
0x5d
,
0x50
,
0xe9
,
0x19
,
0xa7
,
0x5e
,
0xe7
,
0xb4
,
0x4a
,
0xd3
,
0x89
,
0xa9
,
0x4f
,
0xff
,
0x04
,
0x00
,
0x00
,
0xff
,
0xff
,
0x74
,
0xb3
,
0xe8
,
0x78
,
0xba
,
0x02
,
0x00
,
0x00
,
}
internal/proto/service_msg.proto
浏览文件 @
0b478b61
...
...
@@ -151,7 +151,7 @@ message Score {
* @brief Entities hit by query
*/
message
Hits
{
repeated
int64
id
s
=
1
;
repeated
int64
ID
s
=
1
;
repeated
common.Blob
row_data
=
2
;
repeated
Score
scores
=
3
;
}
...
...
internal/proto/servicepb/service_msg.pb.go
浏览文件 @
0b478b61
...
...
@@ -791,7 +791,7 @@ func (m *Score) GetValues() []float32 {
//*
// @brief Entities hit by query
type
Hits
struct
{
I
ds
[]
int64
`protobuf:"varint,1,rep,packed,name=ids,proto3" json:"id
s,omitempty"`
I
Ds
[]
int64
`protobuf:"varint,1,rep,packed,name=IDs,proto3" json:"ID
s,omitempty"`
RowData
[]
*
commonpb
.
Blob
`protobuf:"bytes,2,rep,name=row_data,json=rowData,proto3" json:"row_data,omitempty"`
Scores
[]
*
Score
`protobuf:"bytes,3,rep,name=scores,proto3" json:"scores,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
...
...
@@ -824,9 +824,9 @@ func (m *Hits) XXX_DiscardUnknown() {
var
xxx_messageInfo_Hits
proto
.
InternalMessageInfo
func
(
m
*
Hits
)
GetI
d
s
()
[]
int64
{
func
(
m
*
Hits
)
GetI
D
s
()
[]
int64
{
if
m
!=
nil
{
return
m
.
I
d
s
return
m
.
I
D
s
}
return
nil
}
...
...
@@ -917,7 +917,7 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"service_msg.proto"
,
fileDescriptor_b4b40b84dd2f74cb
)
}
var
fileDescriptor_b4b40b84dd2f74cb
=
[]
byte
{
// 76
2
bytes of a gzipped FileDescriptorProto
// 76
3
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xac
,
0x54
,
0x5d
,
0x6f
,
0xf3
,
0x34
,
0x14
,
0x26
,
0x4d
,
0x5b
,
0xba
,
0xd3
,
0xb4
,
0x6f
,
0x67
,
0x0a
,
0x0a
,
0xdb
,
0x4d
,
0xc9
,
0xab
,
0x41
,
0x05
,
0xa2
,
0x15
,
0x1b
,
0x12
,
0xda
,
0x05
,
0x12
,
0xed
,
0x36
,
0x60
,
0x1f
,
0xea
,
0x86
,
0x5b
,
0x4d
,
...
...
@@ -955,15 +955,15 @@ var fileDescriptor_b4b40b84dd2f74cb = []byte{
0xad
,
0xb8
,
0x97
,
0x74
,
0xae
,
0xff
,
0xd6
,
0x0d
,
0x61
,
0x02
,
0xaf
,
0x25
,
0x39
,
0x7f
,
0x19
,
0xd0
,
0x5c
,
0x3a
,
0xe6
,
0x8b
,
0xfb
,
0xf9
,
0x06
,
0x8a
,
0xfa
,
0x5b
,
0x66
,
0xdd
,
0xbc
,
0xfd
,
0x8f
,
0xff
,
0xbe
,
0x6e
,
0xd0
,
0x58
,
0x27
,
0xbc
,
0x46
,
0x27
,
0x5f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4b
,
0x8f
,
0x49
,
0x25
,
0xd8
,
0x24
,
0x51
,
0xd4
,
0xeb
,
0xb2
,
0x48
,
0x51
,
0x11
,
0x
91
,
0xb0
,
0xab
,
0xf9
,
0x74
,
0x73
,
0x3e
,
0xf1
,
0x64
,
0x52
,
0xd6
,
0x81
,
0xa3
,
0x7f
,
0x02
,
0x00
,
0x
00
,
0xff
,
0xff
,
0x12
,
0x37
,
0x33
,
0x02
,
0x37
,
0x08
,
0x00
,
0x00
,
}
internal/proxy/proxy.go
浏览文件 @
0b478b61
...
...
@@ -151,7 +151,7 @@ func (p *Proxy) queryResultLoop() {
}
tsMsg
:=
msgPack
.
Msgs
[
0
]
searchResultMsg
,
_
:=
(
*
tsMsg
)
.
(
*
msgstream
.
SearchResultMsg
)
reqID
:=
searchResultMsg
.
GetReqI
d
()
reqID
:=
searchResultMsg
.
GetReqI
D
()
_
,
ok
:=
queryResultBuf
[
reqID
]
if
!
ok
{
queryResultBuf
[
reqID
]
=
make
([]
*
internalpb
.
SearchResult
,
0
)
...
...
internal/proxy/task.go
浏览文件 @
0b478b61
...
...
@@ -13,7 +13,7 @@ import (
)
type
task
interface
{
ID
()
UniqueID
// return ReqI
d
ID
()
UniqueID
// return ReqI
D
Type
()
internalpb
.
MsgType
BeginTs
()
Timestamp
EndTs
()
Timestamp
...
...
@@ -50,7 +50,7 @@ func (it *InsertTask) EndTs() Timestamp {
}
func
(
it
*
InsertTask
)
ID
()
UniqueID
{
return
it
.
ReqI
d
return
it
.
ReqI
D
}
func
(
it
*
InsertTask
)
Type
()
internalpb
.
MsgType
{
...
...
@@ -104,7 +104,7 @@ type CreateCollectionTask struct {
}
func
(
cct
*
CreateCollectionTask
)
ID
()
UniqueID
{
return
cct
.
ReqI
d
return
cct
.
ReqI
D
}
func
(
cct
*
CreateCollectionTask
)
Type
()
internalpb
.
MsgType
{
...
...
@@ -172,7 +172,7 @@ type DropCollectionTask struct {
}
func
(
dct
*
DropCollectionTask
)
ID
()
UniqueID
{
return
dct
.
ReqI
d
return
dct
.
ReqI
D
}
func
(
dct
*
DropCollectionTask
)
Type
()
internalpb
.
MsgType
{
...
...
@@ -241,7 +241,7 @@ type QueryTask struct {
}
func
(
qt
*
QueryTask
)
ID
()
UniqueID
{
return
qt
.
ReqI
d
return
qt
.
ReqI
D
}
func
(
qt
*
QueryTask
)
Type
()
internalpb
.
MsgType
{
...
...
@@ -320,7 +320,7 @@ func (qt *QueryTask) Notify(err error) {
qt
.
resultChan
<-
&
servicepb
.
QueryResult
{}
return
}
k
:=
len
(
searchResults
[
0
]
.
Hits
[
0
]
.
I
d
s
)
// k
k
:=
len
(
searchResults
[
0
]
.
Hits
[
0
]
.
I
D
s
)
// k
queryResult
:=
&
servicepb
.
QueryResult
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
0
,
...
...
@@ -347,7 +347,7 @@ func (qt *QueryTask) Notify(err error) {
}
}
choiceOffset
:=
locs
[
choice
]
hits
.
I
ds
=
append
(
hits
.
Ids
,
searchResults
[
choice
]
.
Hits
[
i
]
.
Id
s
[
choiceOffset
])
hits
.
I
Ds
=
append
(
hits
.
IDs
,
searchResults
[
choice
]
.
Hits
[
i
]
.
ID
s
[
choiceOffset
])
hits
.
RowData
=
append
(
hits
.
RowData
,
searchResults
[
choice
]
.
Hits
[
i
]
.
RowData
[
choiceOffset
])
hits
.
Scores
=
append
(
hits
.
Scores
,
searchResults
[
choice
]
.
Hits
[
i
]
.
Scores
[
choiceOffset
])
locs
[
choice
]
++
...
...
@@ -369,7 +369,7 @@ type HasCollectionTask struct {
}
func
(
hct
*
HasCollectionTask
)
ID
()
UniqueID
{
return
hct
.
ReqI
d
return
hct
.
ReqI
D
}
func
(
hct
*
HasCollectionTask
)
Type
()
internalpb
.
MsgType
{
...
...
@@ -440,7 +440,7 @@ type DescribeCollectionTask struct {
}
func
(
dct
*
DescribeCollectionTask
)
ID
()
UniqueID
{
return
dct
.
ReqI
d
return
dct
.
ReqI
D
}
func
(
dct
*
DescribeCollectionTask
)
Type
()
internalpb
.
MsgType
{
...
...
@@ -510,7 +510,7 @@ type ShowCollectionsTask struct {
}
func
(
sct
*
ShowCollectionsTask
)
ID
()
UniqueID
{
return
sct
.
ReqI
d
return
sct
.
ReqI
D
}
func
(
sct
*
ShowCollectionsTask
)
Type
()
internalpb
.
MsgType
{
...
...
internal/proxy/task_scheduler.go
浏览文件 @
0b478b61
...
...
@@ -130,19 +130,19 @@ type DqTaskQueue struct {
func
(
queue
*
DdTaskQueue
)
Enqueue
(
t
task
)
error
{
queue
.
lock
.
Lock
()
defer
queue
.
lock
.
Unlock
()
// TODO: set Ts, ReqI
d, ProxyId
// TODO: set Ts, ReqI
D, ProxyID
queue
.
AddUnissuedTask
(
t
)
return
nil
}
func
(
queue
*
DmTaskQueue
)
Enqueue
(
t
task
)
error
{
// TODO: set Ts, ReqI
d, ProxyId
// TODO: set Ts, ReqI
D, ProxyID
queue
.
AddUnissuedTask
(
t
)
return
nil
}
func
(
queue
*
DqTaskQueue
)
Enqueue
(
t
task
)
error
{
// TODO: set Ts, ReqI
d, ProxyId
// TODO: set Ts, ReqI
D, ProxyID
queue
.
AddUnissuedTask
(
t
)
return
nil
}
...
...
internal/proxy/timetick.go
浏览文件 @
0b478b61
...
...
@@ -68,7 +68,7 @@ func (tt *timeTick) tick() error {
var
timeTickMsg
msgstream
.
TsMsg
=
&
msgstream
.
TimeTickMsg
{
TimeTickMsg
:
internalpb
.
TimeTickMsg
{
MsgType
:
internalpb
.
MsgType_kTimeTick
,
PeerI
d
:
tt
.
peerID
,
PeerI
D
:
tt
.
peerID
,
Timestamp
:
tt
.
currentTick
,
},
}
...
...
internal/reader/col_seg_container_test.go
浏览文件 @
0b478b61
...
...
@@ -47,10 +47,10 @@ func TestColSegContainer_addCollection(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -60,7 +60,7 @@ func TestColSegContainer_addCollection(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
}
...
...
@@ -99,10 +99,10 @@ func TestColSegContainer_removeCollection(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -112,7 +112,7 @@ func TestColSegContainer_removeCollection(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
err
:=
node
.
container
.
removeCollection
(
collection
)
...
...
@@ -155,10 +155,10 @@ func TestColSegContainer_getCollectionByID(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -168,14 +168,14 @@ func TestColSegContainer_getCollectionByID(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
targetCollection
,
err
:=
node
.
container
.
getCollectionByID
(
UniqueID
(
0
))
assert
.
NoError
(
t
,
err
)
assert
.
NotNil
(
t
,
targetCollection
)
assert
.
Equal
(
t
,
targetCollection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
targetCollection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
targetCollection
.
meta
.
I
D
,
UniqueID
(
0
))
}
func
TestColSegContainer_getCollectionByName
(
t
*
testing
.
T
)
{
...
...
@@ -213,10 +213,10 @@ func TestColSegContainer_getCollectionByName(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -226,14 +226,14 @@ func TestColSegContainer_getCollectionByName(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
targetCollection
,
err
:=
node
.
container
.
getCollectionByName
(
"collection0"
)
assert
.
NoError
(
t
,
err
)
assert
.
NotNil
(
t
,
targetCollection
)
assert
.
Equal
(
t
,
targetCollection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
targetCollection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
targetCollection
.
meta
.
I
D
,
UniqueID
(
0
))
}
//----------------------------------------------------------------------------------------------------- partition
...
...
@@ -272,10 +272,10 @@ func TestColSegContainer_addPartition(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -285,7 +285,7 @@ func TestColSegContainer_addPartition(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
for
_
,
tag
:=
range
collectionMeta
.
PartitionTags
{
...
...
@@ -330,10 +330,10 @@ func TestColSegContainer_removePartition(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -343,7 +343,7 @@ func TestColSegContainer_removePartition(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
for
_
,
tag
:=
range
collectionMeta
.
PartitionTags
{
...
...
@@ -390,10 +390,10 @@ func TestColSegContainer_getPartitionByTag(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -403,7 +403,7 @@ func TestColSegContainer_getPartitionByTag(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
for
_
,
tag
:=
range
collectionMeta
.
PartitionTags
{
...
...
@@ -453,10 +453,10 @@ func TestColSegContainer_addSegment(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -466,7 +466,7 @@ func TestColSegContainer_addSegment(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
partition
,
err
:=
node
.
container
.
addPartition
(
collection
,
collectionMeta
.
PartitionTags
[
0
])
...
...
@@ -515,10 +515,10 @@ func TestColSegContainer_removeSegment(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -528,7 +528,7 @@ func TestColSegContainer_removeSegment(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
partition
,
err
:=
node
.
container
.
addPartition
(
collection
,
collectionMeta
.
PartitionTags
[
0
])
...
...
@@ -579,10 +579,10 @@ func TestColSegContainer_getSegmentByID(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -592,7 +592,7 @@ func TestColSegContainer_getSegmentByID(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
partition
,
err
:=
node
.
container
.
addPartition
(
collection
,
collectionMeta
.
PartitionTags
[
0
])
...
...
@@ -644,10 +644,10 @@ func TestColSegContainer_hasSegment(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -657,7 +657,7 @@ func TestColSegContainer_hasSegment(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
partition
,
err
:=
node
.
container
.
addPartition
(
collection
,
collectionMeta
.
PartitionTags
[
0
])
...
...
internal/reader/collection.go
浏览文件 @
0b478b61
...
...
@@ -26,7 +26,7 @@ func (c *Collection) Name() string {
}
func
(
c
*
Collection
)
ID
()
UniqueID
{
return
(
*
c
.
meta
)
.
I
d
return
(
*
c
.
meta
)
.
I
D
}
func
(
c
*
Collection
)
Partitions
()
*
[]
*
Partition
{
...
...
internal/reader/collection_test.go
浏览文件 @
0b478b61
...
...
@@ -46,10 +46,10 @@ func TestCollection_Partitions(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -59,7 +59,7 @@ func TestCollection_Partitions(t *testing.T) {
var
collection
=
node
.
container
.
addCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
len
(
node
.
container
.
collections
),
1
)
for
_
,
tag
:=
range
collectionMeta
.
PartitionTags
{
...
...
@@ -102,10 +102,10 @@ func TestCollection_newCollection(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -114,7 +114,7 @@ func TestCollection_newCollection(t *testing.T) {
collection
:=
newCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
}
func
TestCollection_deleteCollection
(
t
*
testing
.
T
)
{
...
...
@@ -148,10 +148,10 @@ func TestCollection_deleteCollection(t *testing.T) {
}
collectionMeta
:=
etcdpb
.
CollectionMeta
{
I
d
:
UniqueID
(
0
),
I
D
:
UniqueID
(
0
),
Schema
:
&
schema
,
CreateTime
:
Timestamp
(
0
),
SegmentI
d
s
:
[]
UniqueID
{
0
},
SegmentI
D
s
:
[]
UniqueID
{
0
},
PartitionTags
:
[]
string
{
"default"
},
}
...
...
@@ -160,7 +160,7 @@ func TestCollection_deleteCollection(t *testing.T) {
collection
:=
newCollection
(
&
collectionMeta
,
collectionMetaBlob
)
assert
.
Equal
(
t
,
collection
.
meta
.
Schema
.
Name
,
"collection0"
)
assert
.
Equal
(
t
,
collection
.
meta
.
I
d
,
UniqueID
(
0
))
assert
.
Equal
(
t
,
collection
.
meta
.
I
D
,
UniqueID
(
0
))
deleteCollection
(
collection
)
}
internal/reader/data_sync_service_test.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/flow_graph_insert_node.go
浏览文件 @
0b478b61
...
...
@@ -49,15 +49,15 @@ func (iNode *insertNode) Operate(in []*Msg) []*Msg {
// 1. hash insertMessages to insertData
for
_
,
task
:=
range
iMsg
.
insertMessages
{
if
len
(
task
.
RowI
ds
)
!=
len
(
task
.
Timestamps
)
||
len
(
task
.
RowId
s
)
!=
len
(
task
.
RowData
)
{
if
len
(
task
.
RowI
Ds
)
!=
len
(
task
.
Timestamps
)
||
len
(
task
.
RowID
s
)
!=
len
(
task
.
RowData
)
{
// TODO: what if the messages are misaligned?
// Here, we ignore those messages and print error
log
.
Println
(
"Error, misaligned messages detected"
)
continue
}
insertData
.
insertIDs
[
task
.
SegmentI
d
]
=
append
(
insertData
.
insertIDs
[
task
.
SegmentId
],
task
.
RowId
s
...
)
insertData
.
insertTimestamps
[
task
.
SegmentI
d
]
=
append
(
insertData
.
insertTimestamps
[
task
.
SegmentId
],
task
.
Timestamps
...
)
insertData
.
insertRecords
[
task
.
SegmentI
d
]
=
append
(
insertData
.
insertRecords
[
task
.
SegmentId
],
task
.
RowData
...
)
insertData
.
insertIDs
[
task
.
SegmentI
D
]
=
append
(
insertData
.
insertIDs
[
task
.
SegmentID
],
task
.
RowID
s
...
)
insertData
.
insertTimestamps
[
task
.
SegmentI
D
]
=
append
(
insertData
.
insertTimestamps
[
task
.
SegmentID
],
task
.
Timestamps
...
)
insertData
.
insertRecords
[
task
.
SegmentI
D
]
=
append
(
insertData
.
insertRecords
[
task
.
SegmentID
],
task
.
RowData
...
)
}
// 2. do preInsert
...
...
internal/reader/flow_graph_key2seg_node.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/meta_service.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/partition_test.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/search_service.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/search_service_test.go
浏览文件 @
0b478b61
...
...
@@ -66,8 +66,8 @@ package reader
// Uid: int64(i),
// PartitionTag: "partition0",
// Timestamp: uint64(i + 1000),
// SegmentI
d
: int64(i),
// ChannelI
d
: 0,
// SegmentI
D
: int64(i),
// ChannelI
D
: 0,
// Op: msgPb.OpType_INSERT,
// ClientId: 0,
// ExtraParams: nil,
...
...
internal/reader/segment_test.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/stats_service.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
internal/reader/util_functions_test.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
test/insert_test.go
浏览文件 @
0b478b61
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录