Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
3a4df03b
M
milvus
项目概览
milvus
/
milvus
10 个月 前同步成功
通知
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 搜索 >>
未验证
提交
3a4df03b
编写于
10月 09, 2021
作者:
B
bigsheeper
提交者:
GitHub
10月 09, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add SealedSegmentsChangeInfo and changeInfoMsg (#9479)
Signed-off-by:
N
bigsheeper
<
yihao.dai@zilliz.com
>
上级
1ec5d849
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
489 addition
and
286 deletion
+489
-286
internal/core/src/pb/common.pb.cc
internal/core/src/pb/common.pb.cc
+12
-10
internal/core/src/pb/common.pb.h
internal/core/src/pb/common.pb.h
+1
-0
internal/msgstream/msg.go
internal/msgstream/msg.go
+58
-0
internal/msgstream/msg_test.go
internal/msgstream/msg_test.go
+48
-0
internal/msgstream/unmarshal.go
internal/msgstream/unmarshal.go
+2
-0
internal/proto/common.proto
internal/proto/common.proto
+1
-0
internal/proto/commonpb/common.pb.go
internal/proto/commonpb/common.pb.go
+155
-151
internal/proto/query_coord.proto
internal/proto/query_coord.proto
+9
-0
internal/proto/querypb/query_coord.pb.go
internal/proto/querypb/query_coord.pb.go
+203
-125
未找到文件。
internal/core/src/pb/common.pb.cc
浏览文件 @
3a4df03b
...
...
@@ -284,7 +284,7 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
"ssued
\020\001\022\016\n\n
InProgress
\020\002\022\014\n\010
Finished
\020\003\022\n\n
"
"
\006
Failed
\020\004
*f
\n\014
SegmentState
\022\024\n\020
SegmentStat"
"eNone
\020\000\022\014\n\010
NotExist
\020\001\022\013\n\007
Growing
\020\002\022\n\n\006
Se"
"aled
\020\003\022\013\n\007
Flushed
\020\004\022\014\n\010
Flushing
\020\005
*
\
264
\010\n\007
Ms"
"aled
\020\003\022\013\n\007
Flushed
\020\004\022\014\n\010
Flushing
\020\005
*
\
323
\010\n\007
Ms"
"gType
\022\r\n\t
Undefined
\020\000\022\024\n\020
CreateCollection"
"
\020
d
\022\022\n\016
DropCollection
\020
e
\022\021\n\r
HasCollection
\020
"
"f
\022\026\n\022
DescribeCollection
\020
g
\022\023\n\017
ShowCollect"
...
...
@@ -307,14 +307,15 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
"eve
\020\372\003\022\023\n\016
RetrieveResult
\020\373\003\022\024\n\017
WatchDmCh"
"annels
\020\374\003\022\025\n\020
RemoveDmChannels
\020\375\003\022\027\n\022
Watc"
"hQueryChannels
\020\376\003\022\030\n\023
RemoveQueryChannels"
"
\020\377\003\022\020\n\013
SegmentInfo
\020\330\004\022\r\n\010
TimeTick
\020\260\t\022\023\n\016
"
"QueryNodeStats
\020\261\t\022\016\n\t
LoadIndex
\020\262\t\022\016\n\t
Req"
"uestID
\020\263\t\022\017\n\n
RequestTSO
\020\264\t\022\024\n\017
AllocateSe"
"gment
\020\265\t\022\026\n\021
SegmentStatistics
\020\266\t\022\025\n\020
Segm"
"entFlushDone
\020\267\t\022\017\n\n
DataNodeTt
\020\270\t
*
\"\n\007
DslT"
"ype
\022\007\n\003
Dsl
\020\000\022\016\n\n
BoolExprV1
\020\001
B5Z3github.c"
"om/milvus-io/milvus/internal/proto/commo"
"npbb
\006
proto3"
"
\020\377\003\022\035\n\030
SealedSegmentsChangeInfo
\020\200\004\022\020\n\013
Se"
"gmentInfo
\020\330\004\022\r\n\010
TimeTick
\020\260\t\022\023\n\016
QueryNode"
"Stats
\020\261\t\022\016\n\t
LoadIndex
\020\262\t\022\016\n\t
RequestID
\020\263\t
"
"
\022\017\n\n
RequestTSO
\020\264\t\022\024\n\017
AllocateSegment
\020\265\t\022
"
"
\026\n\021
SegmentStatistics
\020\266\t\022\025\n\020
SegmentFlushD"
"one
\020\267\t\022\017\n\n
DataNodeTt
\020\270\t
*
\"\n\007
DslType
\022\007\n\003
Ds"
"l
\020\000\022\016\n\n
BoolExprV1
\020\001
B5Z3github.com/milvus"
"-io/milvus/internal/proto/commonpbb
\006
prot"
"o3"
;
static
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
DescriptorTable
*
const
descriptor_table_common_2eproto_deps
[
1
]
=
{
};
...
...
@@ -331,7 +332,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_com
static
::
PROTOBUF_NAMESPACE_ID
::
internal
::
once_flag
descriptor_table_common_2eproto_once
;
static
bool
descriptor_table_common_2eproto_initialized
=
false
;
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
DescriptorTable
descriptor_table_common_2eproto
=
{
&
descriptor_table_common_2eproto_initialized
,
descriptor_table_protodef_common_2eproto
,
"common.proto"
,
24
51
,
&
descriptor_table_common_2eproto_initialized
,
descriptor_table_protodef_common_2eproto
,
"common.proto"
,
24
82
,
&
descriptor_table_common_2eproto_once
,
descriptor_table_common_2eproto_sccs
,
descriptor_table_common_2eproto_deps
,
8
,
0
,
schemas
,
file_default_instances
,
TableStruct_common_2eproto
::
offsets
,
file_level_metadata_common_2eproto
,
8
,
file_level_enum_descriptors_common_2eproto
,
file_level_service_descriptors_common_2eproto
,
...
...
@@ -465,6 +466,7 @@ bool MsgType_IsValid(int value) {
case
509
:
case
510
:
case
511
:
case
512
:
case
600
:
case
1200
:
case
1201
:
...
...
internal/core/src/pb/common.pb.h
浏览文件 @
3a4df03b
...
...
@@ -250,6 +250,7 @@ enum MsgType : int {
RemoveDmChannels
=
509
,
WatchQueryChannels
=
510
,
RemoveQueryChannels
=
511
,
SealedSegmentsChangeInfo
=
512
,
SegmentInfo
=
600
,
TimeTick
=
1200
,
QueryNodeStats
=
1201
,
...
...
internal/msgstream/msg.go
浏览文件 @
3a4df03b
...
...
@@ -20,6 +20,7 @@ import (
"github.com/milvus-io/milvus/internal/proto/commonpb"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/querypb"
)
// MsgType is an alias ofo commonpb.MsgType
...
...
@@ -981,6 +982,63 @@ func (l *LoadBalanceSegmentsMsg) Unmarshal(input MarshalType) (TsMsg, error) {
return
loadMsg
,
nil
}
/////////////////////////////////////////SealedSegmentsChangeInfoMsg//////////////////////////////////////////
// SealedSegmentsChangeInfoMsg is a message pack that contains sealed segments change info
type
SealedSegmentsChangeInfoMsg
struct
{
BaseMsg
querypb
.
SealedSegmentsChangeInfo
}
// interface implementation validation
var
_
TsMsg
=
&
SealedSegmentsChangeInfoMsg
{}
// ID returns the ID of this message pack
func
(
s
*
SealedSegmentsChangeInfoMsg
)
ID
()
UniqueID
{
return
s
.
Base
.
MsgID
}
// Type returns the type of this message pack
func
(
s
*
SealedSegmentsChangeInfoMsg
)
Type
()
MsgType
{
return
s
.
Base
.
MsgType
}
// SourceID indicated which component generated this message
func
(
s
*
SealedSegmentsChangeInfoMsg
)
SourceID
()
int64
{
return
s
.
Base
.
SourceID
}
// Marshal is used to serializing a message pack to byte array
func
(
s
*
SealedSegmentsChangeInfoMsg
)
Marshal
(
input
TsMsg
)
(
MarshalType
,
error
)
{
changeInfoMsg
:=
input
.
(
*
SealedSegmentsChangeInfoMsg
)
changeInfo
:=
&
changeInfoMsg
.
SealedSegmentsChangeInfo
mb
,
err
:=
proto
.
Marshal
(
changeInfo
)
if
err
!=
nil
{
return
nil
,
err
}
return
mb
,
nil
}
// Unmarshal is used to deserializing a message pack from byte array
func
(
s
*
SealedSegmentsChangeInfoMsg
)
Unmarshal
(
input
MarshalType
)
(
TsMsg
,
error
)
{
changeInfo
:=
querypb
.
SealedSegmentsChangeInfo
{}
in
,
err
:=
convertToByteArray
(
input
)
if
err
!=
nil
{
return
nil
,
err
}
err
=
proto
.
Unmarshal
(
in
,
&
changeInfo
)
if
err
!=
nil
{
return
nil
,
err
}
changeInfoMsg
:=
&
SealedSegmentsChangeInfoMsg
{
SealedSegmentsChangeInfo
:
changeInfo
}
changeInfoMsg
.
BeginTimestamp
=
changeInfo
.
Base
.
Timestamp
changeInfoMsg
.
EndTimestamp
=
changeInfo
.
Base
.
Timestamp
return
changeInfoMsg
,
nil
}
/////////////////////////////////////////DataNodeTtMsg//////////////////////////////////////////
// DataNodeTtMsg is a message pack that contains datanode time tick
type
DataNodeTtMsg
struct
{
BaseMsg
...
...
internal/msgstream/msg_test.go
浏览文件 @
3a4df03b
...
...
@@ -20,6 +20,7 @@ import (
"github.com/milvus-io/milvus/internal/proto/commonpb"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/querypb"
"github.com/milvus-io/milvus/internal/proto/schemapb"
)
...
...
@@ -828,3 +829,50 @@ func TestDataNodeTtMsg_Unmarshal_IllegalParameter(t *testing.T) {
assert
.
NotNil
(
t
,
err
)
assert
.
Nil
(
t
,
tsMsg
)
}
func
TestSealedSegmentsChangeInfoMsg
(
t
*
testing
.
T
)
{
changeInfoMsg
:=
&
SealedSegmentsChangeInfoMsg
{
BaseMsg
:
generateBaseMsg
(),
SealedSegmentsChangeInfo
:
querypb
.
SealedSegmentsChangeInfo
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_SealedSegmentsChangeInfo
,
MsgID
:
1
,
Timestamp
:
2
,
SourceID
:
3
,
},
OnlineNodeID
:
int64
(
1
),
OnlineSegmentIDs
:
[]
int64
{
1
,
2
,
3
},
OfflineNodeID
:
int64
(
2
),
OfflineSegmentIDs
:
[]
int64
{
4
,
5
,
6
},
},
}
assert
.
NotNil
(
t
,
changeInfoMsg
.
TraceCtx
())
ctx
:=
context
.
Background
()
changeInfoMsg
.
SetTraceCtx
(
ctx
)
assert
.
Equal
(
t
,
ctx
,
changeInfoMsg
.
TraceCtx
())
assert
.
Equal
(
t
,
int64
(
1
),
changeInfoMsg
.
ID
())
assert
.
Equal
(
t
,
commonpb
.
MsgType_SealedSegmentsChangeInfo
,
changeInfoMsg
.
Type
())
assert
.
Equal
(
t
,
int64
(
3
),
changeInfoMsg
.
SourceID
())
bytes
,
err
:=
changeInfoMsg
.
Marshal
(
changeInfoMsg
)
assert
.
Nil
(
t
,
err
)
tsMsg
,
err
:=
changeInfoMsg
.
Unmarshal
(
bytes
)
assert
.
Nil
(
t
,
err
)
changeInfoMsg2
,
ok
:=
tsMsg
.
(
*
SealedSegmentsChangeInfoMsg
)
assert
.
True
(
t
,
ok
)
assert
.
Equal
(
t
,
int64
(
1
),
changeInfoMsg2
.
ID
())
assert
.
Equal
(
t
,
commonpb
.
MsgType_SealedSegmentsChangeInfo
,
changeInfoMsg2
.
Type
())
assert
.
Equal
(
t
,
int64
(
3
),
changeInfoMsg2
.
SourceID
())
}
func
TestSealedSegmentsChangeInfoMsg_Unmarshal_IllegalParameter
(
t
*
testing
.
T
)
{
changeInfoMsg
:=
&
SealedSegmentsChangeInfoMsg
{}
tsMsg
,
err
:=
changeInfoMsg
.
Unmarshal
(
10
)
assert
.
NotNil
(
t
,
err
)
assert
.
Nil
(
t
,
tsMsg
)
}
internal/msgstream/unmarshal.go
浏览文件 @
3a4df03b
...
...
@@ -64,6 +64,7 @@ func (pudf *ProtoUDFactory) NewUnmarshalDispatcher() *ProtoUnmarshalDispatcher {
segmentStatisticsMsg
:=
SegmentStatisticsMsg
{}
loadBalanceSegmentsMsg
:=
LoadBalanceSegmentsMsg
{}
dataNodeTtMsg
:=
DataNodeTtMsg
{}
sealedSegmentsChangeInfoMsg
:=
SealedSegmentsChangeInfoMsg
{}
p
:=
&
ProtoUnmarshalDispatcher
{}
p
.
TempMap
=
make
(
map
[
commonpb
.
MsgType
]
UnmarshalFunc
)
...
...
@@ -82,6 +83,7 @@ func (pudf *ProtoUDFactory) NewUnmarshalDispatcher() *ProtoUnmarshalDispatcher {
p
.
TempMap
[
commonpb
.
MsgType_SegmentStatistics
]
=
segmentStatisticsMsg
.
Unmarshal
p
.
TempMap
[
commonpb
.
MsgType_LoadBalanceSegments
]
=
loadBalanceSegmentsMsg
.
Unmarshal
p
.
TempMap
[
commonpb
.
MsgType_DataNodeTt
]
=
dataNodeTtMsg
.
Unmarshal
p
.
TempMap
[
commonpb
.
MsgType_SealedSegmentsChangeInfo
]
=
sealedSegmentsChangeInfoMsg
.
Unmarshal
return
p
}
...
...
internal/proto/common.proto
浏览文件 @
3a4df03b
...
...
@@ -133,6 +133,7 @@ enum MsgType {
RemoveDmChannels
=
509
;
WatchQueryChannels
=
510
;
RemoveQueryChannels
=
511
;
SealedSegmentsChangeInfo
=
512
;
/* DATA SERVICE */
SegmentInfo
=
600
;
...
...
internal/proto/commonpb/common.pb.go
浏览文件 @
3a4df03b
此差异已折叠。
点击以展开。
internal/proto/query_coord.proto
浏览文件 @
3a4df03b
...
...
@@ -303,3 +303,12 @@ message LoadBalanceRequest {
repeated
int64
source_nodeIDs
=
2
;
TriggerCondition
balance_reason
=
3
;
}
//---------------- common query proto -----------------
message
SealedSegmentsChangeInfo
{
common.MsgBase
base
=
1
;
int64
online_nodeID
=
2
;
repeated
int64
online_segmentIDs
=
3
;
int64
offline_nodeID
=
4
;
repeated
int64
offline_segmentIDs
=
5
;
}
internal/proto/querypb/query_coord.pb.go
浏览文件 @
3a4df03b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录