Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
4808b462
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,发现更多精彩内容 >>
提交
4808b462
编写于
12月 30, 2020
作者:
S
sunby
提交者:
yefu.chen
12月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Filter indexable fields in flush scheduler
Signed-off-by:
N
sunby
<
bingyi.sun@zilliz.com
>
上级
2e198e27
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
4 deletion
+40
-4
internal/master/flush_scheduler.go
internal/master/flush_scheduler.go
+12
-0
internal/master/meta_table.go
internal/master/meta_table.go
+22
-0
internal/master/persistence_scheduler_test.go
internal/master/persistence_scheduler_test.go
+3
-1
tests/python/requirements.txt
tests/python/requirements.txt
+1
-1
tests/python/utils.py
tests/python/utils.py
+2
-2
未找到文件。
internal/master/flush_scheduler.go
浏览文件 @
4808b462
...
...
@@ -68,6 +68,18 @@ func (scheduler *FlushScheduler) describe() error {
return
err
}
for
fieldID
,
data
:=
range
mapData
{
// check field indexable
segMeta
,
err
:=
scheduler
.
metaTable
.
GetSegmentByID
(
singleSegmentID
)
if
err
!=
nil
{
return
err
}
indexable
,
err
:=
scheduler
.
metaTable
.
IsIndexable
(
segMeta
.
CollectionID
,
fieldID
)
if
err
!=
nil
{
return
err
}
if
!
indexable
{
continue
}
info
:=
&
IndexBuildInfo
{
segmentID
:
singleSegmentID
,
fieldID
:
fieldID
,
...
...
internal/master/meta_table.go
浏览文件 @
4808b462
...
...
@@ -5,6 +5,8 @@ import (
"strconv"
"sync"
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
...
...
@@ -678,3 +680,23 @@ func (mt *metaTable) UpdateFieldIndexParams(collName string, fieldName string, i
return
fmt
.
Errorf
(
"can not find field with id %s"
,
fieldName
)
}
func
(
mt
*
metaTable
)
IsIndexable
(
collID
UniqueID
,
fieldID
UniqueID
)
(
bool
,
error
)
{
mt
.
ddLock
.
RLock
()
defer
mt
.
ddLock
.
RUnlock
()
if
_
,
ok
:=
mt
.
collID2Meta
[
collID
];
!
ok
{
return
false
,
fmt
.
Errorf
(
"can not find collection with id %d"
,
collID
)
}
for
_
,
v
:=
range
mt
.
collID2Meta
[
collID
]
.
Schema
.
Fields
{
// field is vector type and index params is not empty
if
v
.
FieldID
==
fieldID
&&
(
v
.
DataType
==
schemapb
.
DataType_VECTOR_BINARY
||
v
.
DataType
==
schemapb
.
DataType_VECTOR_FLOAT
)
&&
len
(
v
.
IndexParams
)
!=
0
{
return
true
,
nil
}
}
// fieldID is not in schema(eg: timestamp) or not indexable
return
false
,
nil
}
internal/master/persistence_scheduler_test.go
浏览文件 @
4808b462
...
...
@@ -5,6 +5,8 @@ import (
"testing"
"time"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/etcdpb"
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
...
...
@@ -43,7 +45,7 @@ func TestPersistenceScheduler(t *testing.T) {
Name
:
"testcoll"
,
Fields
:
[]
*
schemapb
.
FieldSchema
{
{
FieldID
:
1
},
{
FieldID
:
100
},
{
FieldID
:
100
,
DataType
:
schemapb
.
DataType_VECTOR_FLOAT
,
IndexParams
:
[]
*
commonpb
.
KeyValuePair
{{
Key
:
"k"
,
Value
:
"v"
}}
},
},
},
})
...
...
tests/python/requirements.txt
浏览文件 @
4808b462
...
...
@@ -4,5 +4,5 @@ numpy==1.18.1
pytest==5.3.4
pytest-cov==2.8.1
pytest-timeout==1.3.4
pymilvus-distributed==0.0.
6
pymilvus-distributed==0.0.
7
sklearn==0.0
tests/python/utils.py
浏览文件 @
4808b462
...
...
@@ -243,7 +243,7 @@ def gen_single_vector_fields():
def
gen_default_fields
(
auto_id
=
True
):
default_fields
=
{
"fields"
:
[
{
"name"
:
"int64"
,
"type"
:
DataType
.
INT64
,
"is_primary_key"
:
not
auto_id
},
{
"name"
:
"int64"
,
"type"
:
DataType
.
INT64
},
{
"name"
:
"float"
,
"type"
:
DataType
.
FLOAT
},
{
"name"
:
default_float_vec_field_name
,
"type"
:
DataType
.
FLOAT_VECTOR
,
"params"
:
{
"dim"
:
default_dim
},
...
...
@@ -258,7 +258,7 @@ def gen_default_fields(auto_id=True):
def
gen_binary_default_fields
(
auto_id
=
True
):
default_fields
=
{
"fields"
:
[
{
"name"
:
"int64"
,
"type"
:
DataType
.
INT64
,
"is_primary_key"
:
not
auto_id
},
{
"name"
:
"int64"
,
"type"
:
DataType
.
INT64
},
{
"name"
:
"float"
,
"type"
:
DataType
.
FLOAT
},
{
"name"
:
default_binary_vec_field_name
,
"type"
:
DataType
.
BINARY_VECTOR
,
"params"
:
{
"dim"
:
default_dim
},
"indexes"
:
[{
"metric_type"
:
"JACCARD"
}]}
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录