Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
cb3ca1ab
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cb3ca1ab
编写于
1月 04, 2021
作者:
B
bigsheeper
提交者:
yefu.chen
1月 04, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor kvPath param and unify the segment flush kvPath in write node
Signed-off-by:
N
bigsheeper
<
yihao.dai@zilliz.com
>
上级
c82565bd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
49 addition
and
18 deletion
+49
-18
configs/milvus.yaml
configs/milvus.yaml
+2
-1
internal/master/param_table.go
internal/master/param_table.go
+14
-4
internal/writenode/client/client.go
internal/writenode/client/client.go
+2
-2
internal/writenode/meta_table.go
internal/writenode/meta_table.go
+4
-4
internal/writenode/param_table.go
internal/writenode/param_table.go
+27
-7
未找到文件。
configs/milvus.yaml
浏览文件 @
cb3ca1ab
...
...
@@ -21,7 +21,8 @@ etcd:
rootPath
:
by-dev
metaSubPath
:
meta
# metaRootPath = rootPath + '/' + metaSubPath
kvSubPath
:
kv
# kvRootPath = rootPath + '/' + kvSubPath
writeNodeKvSubPath
:
writer
writeNodeSegKvSubPath
:
writer/segment
writeNodeDDLKvSubPath
:
writer/ddl
segThreshold
:
10000
minio
:
...
...
internal/master/param_table.go
浏览文件 @
cb3ca1ab
...
...
@@ -16,10 +16,11 @@ type ParamTable struct {
Address
string
Port
int
EtcdAddress
string
MetaRootPath
string
KvRootPath
string
PulsarAddress
string
EtcdAddress
string
MetaRootPath
string
KvRootPath
string
WriteNodeSegKvSubPath
string
PulsarAddress
string
// nodeID
ProxyIDList
[]
typeutil
.
UniqueID
...
...
@@ -68,6 +69,7 @@ func (p *ParamTable) Init() {
p
.
initEtcdAddress
()
p
.
initMetaRootPath
()
p
.
initKvRootPath
()
p
.
initWriteNodeSegKvSubPath
()
p
.
initPulsarAddress
()
p
.
initProxyIDList
()
...
...
@@ -147,6 +149,14 @@ func (p *ParamTable) initKvRootPath() {
p
.
KvRootPath
=
rootPath
+
"/"
+
subPath
}
func
(
p
*
ParamTable
)
initWriteNodeSegKvSubPath
()
{
subPath
,
err
:=
p
.
Load
(
"etcd.writeNodeSegKvSubPath"
)
if
err
!=
nil
{
panic
(
err
)
}
p
.
WriteNodeSegKvSubPath
=
subPath
+
"/"
}
func
(
p
*
ParamTable
)
initTopicNum
()
{
iRangeStr
,
err
:=
p
.
Load
(
"msgChannel.channelRange.insert"
)
if
err
!=
nil
{
...
...
internal/writenode/client/client.go
浏览文件 @
cb3ca1ab
...
...
@@ -25,7 +25,7 @@ type Client struct {
flushStream
msgstream
.
MsgStream
}
func
NewWriterClient
(
etcdAddress
string
,
kvRootPath
string
,
writeNodeKvSubPath
string
,
flushStream
msgstream
.
MsgStream
)
(
*
Client
,
error
)
{
func
NewWriterClient
(
etcdAddress
string
,
kvRootPath
string
,
writeNode
Seg
KvSubPath
string
,
flushStream
msgstream
.
MsgStream
)
(
*
Client
,
error
)
{
// init kv client
etcdClient
,
err
:=
clientv3
.
New
(
clientv3
.
Config
{
Endpoints
:
[]
string
{
etcdAddress
}})
if
err
!=
nil
{
...
...
@@ -35,7 +35,7 @@ func NewWriterClient(etcdAddress string, kvRootPath string, writeNodeKvSubPath s
return
&
Client
{
kvClient
:
kvClient
,
kvPrefix
:
writeNodeKvSubPath
,
kvPrefix
:
writeNode
Seg
KvSubPath
,
flushStream
:
flushStream
,
},
nil
}
...
...
internal/writenode/meta_table.go
浏览文件 @
cb3ca1ab
...
...
@@ -105,12 +105,12 @@ func (mt *metaTable) saveDDLFlushMeta(meta *pb.DDLFlushMeta) error {
mt
.
collID2DdlMeta
[
meta
.
CollectionID
]
=
meta
return
mt
.
client
.
Save
(
"/writer/ddl/"
+
strconv
.
FormatInt
(
meta
.
CollectionID
,
10
),
value
)
return
mt
.
client
.
Save
(
Params
.
WriteNodeDDLKvSubPath
+
strconv
.
FormatInt
(
meta
.
CollectionID
,
10
),
value
)
}
func
(
mt
*
metaTable
)
reloadDdlMetaFromKV
()
error
{
mt
.
collID2DdlMeta
=
make
(
map
[
UniqueID
]
*
pb
.
DDLFlushMeta
)
_
,
values
,
err
:=
mt
.
client
.
LoadWithPrefix
(
"writer/ddl"
)
_
,
values
,
err
:=
mt
.
client
.
LoadWithPrefix
(
Params
.
WriteNodeDDLKvSubPath
)
if
err
!=
nil
{
return
err
}
...
...
@@ -132,13 +132,13 @@ func (mt *metaTable) saveSegFlushMeta(meta *pb.SegmentFlushMeta) error {
mt
.
segID2FlushMeta
[
meta
.
SegmentID
]
=
*
meta
return
mt
.
client
.
Save
(
"/writer/segment/"
+
strconv
.
FormatInt
(
meta
.
SegmentID
,
10
),
value
)
return
mt
.
client
.
Save
(
Params
.
WriteNodeSegKvSubPath
+
strconv
.
FormatInt
(
meta
.
SegmentID
,
10
),
value
)
}
func
(
mt
*
metaTable
)
reloadSegMetaFromKV
()
error
{
mt
.
segID2FlushMeta
=
make
(
map
[
UniqueID
]
pb
.
SegmentFlushMeta
)
_
,
values
,
err
:=
mt
.
client
.
LoadWithPrefix
(
"writer/segment"
)
_
,
values
,
err
:=
mt
.
client
.
LoadWithPrefix
(
Params
.
WriteNodeSegKvSubPath
)
if
err
!=
nil
{
return
err
}
...
...
internal/writenode/param_table.go
浏览文件 @
cb3ca1ab
...
...
@@ -36,13 +36,15 @@ type ParamTable struct {
DefaultPartitionTag
string
SliceIndex
int
EtcdAddress
string
MetaRootPath
string
MinioAddress
string
MinioAccessKeyID
string
MinioSecretAccessKey
string
MinioUseSSL
bool
MinioBucketName
string
EtcdAddress
string
MetaRootPath
string
WriteNodeSegKvSubPath
string
WriteNodeDDLKvSubPath
string
MinioAddress
string
MinioAccessKeyID
string
MinioSecretAccessKey
string
MinioUseSSL
bool
MinioBucketName
string
FlushInsertBufSize
int
FlushDdBufSize
int
...
...
@@ -78,6 +80,8 @@ func (p *ParamTable) Init() {
p
.
initPulsarAddress
()
p
.
initEtcdAddress
()
p
.
initMetaRootPath
()
p
.
initWriteNodeSegKvSubPath
()
p
.
initWriteNodeDDLKvSubPath
()
p
.
initInsertLogRootPath
()
p
.
initDdLogRootPath
()
...
...
@@ -299,6 +303,22 @@ func (p *ParamTable) initMetaRootPath() {
p
.
MetaRootPath
=
rootPath
+
"/"
+
subPath
}
func
(
p
*
ParamTable
)
initWriteNodeSegKvSubPath
()
{
subPath
,
err
:=
p
.
Load
(
"etcd.writeNodeSegKvSubPath"
)
if
err
!=
nil
{
panic
(
err
)
}
p
.
WriteNodeSegKvSubPath
=
subPath
+
"/"
}
func
(
p
*
ParamTable
)
initWriteNodeDDLKvSubPath
()
{
subPath
,
err
:=
p
.
Load
(
"etcd.writeNodeDDLKvSubPath"
)
if
err
!=
nil
{
panic
(
err
)
}
p
.
WriteNodeDDLKvSubPath
=
subPath
+
"/"
}
func
(
p
*
ParamTable
)
initInsertLogRootPath
()
{
rootPath
,
err
:=
p
.
Load
(
"etcd.rootPath"
)
if
err
!=
nil
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录