Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
3b17eb74
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,发现更多精彩内容 >>
提交
3b17eb74
编写于
11月 03, 2019
作者:
J
JinHai-CN
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'main/0.5.1' into 0.5.1
Former-commit-id: 42a8368f0bedd23d2fedeb195ee8607f42bea555
上级
54d5334a
81a3070a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
120 addition
and
2 deletion
+120
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
core/src/server/Config.cpp
core/src/server/Config.cpp
+1
-2
core/unittest/server/test_config.cpp
core/unittest/server/test_config.cpp
+118
-0
未找到文件。
CHANGELOG.md
浏览文件 @
3b17eb74
...
...
@@ -30,6 +30,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
\#
156 - Not return error when search_resources and index_build_device set cpu
-
\#
159 - Change the configuration name from 'use_gpu_threshold' to 'gpu_search_threshold'
-
\#
168 - Improve result reduce
-
\#
175 - add invalid config unittest
## Task
...
...
core/src/server/Config.cpp
浏览文件 @
3b17eb74
...
...
@@ -401,8 +401,7 @@ Status
Config
::
CheckServerConfigDeployMode
(
const
std
::
string
&
value
)
{
if
(
value
!=
"single"
&&
value
!=
"cluster_readonly"
&&
value
!=
"cluster_writable"
)
{
return
Status
(
SERVER_INVALID_ARGUMENT
,
"server_config.deploy_mode is not one of "
"single, cluster_readonly, and cluster_writable."
);
"server_config.deploy_mode is not one of single, cluster_readonly, and cluster_writable."
);
}
return
Status
::
OK
();
}
...
...
core/unittest/server/test_config.cpp
浏览文件 @
3b17eb74
...
...
@@ -112,3 +112,121 @@ TEST_F(ConfigTest, SERVER_CONFIG_TEST) {
s
=
config
.
ResetDefaultConfig
();
ASSERT_TRUE
(
s
.
ok
());
}
TEST_F
(
ConfigTest
,
SERVER_CONFIG_INVALID_TEST
)
{
std
::
string
config_path
(
CONFIG_PATH
);
milvus
::
server
::
Config
&
config
=
milvus
::
server
::
Config
::
GetInstance
();
milvus
::
Status
s
;
s
=
config
.
LoadConfigFile
(
""
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
LoadConfigFile
(
config_path
+
INVALID_CONFIG_FILE
);
ASSERT_FALSE
(
s
.
ok
());
/* server config */
s
=
config
.
SetServerConfigAddress
(
"0.0.0"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigAddress
(
"0.0.0.256"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigPort
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigPort
(
"99999"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigDeployMode
(
"cluster"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigTimeZone
(
"GM"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigTimeZone
(
"GMT8"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetServerConfigTimeZone
(
"UTCA"
);
ASSERT_FALSE
(
s
.
ok
());
/* db config */
s
=
config
.
SetDBConfigPrimaryPath
(
""
);
ASSERT_FALSE
(
s
.
ok
());
// s = config.SetDBConfigSecondaryPath("");
// ASSERT_FALSE(s.ok());
s
=
config
.
SetDBConfigBackendUrl
(
"http://www.google.com"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigBackendUrl
(
"sqlite://:@:"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigBackendUrl
(
"mysql://root:123456@127.0.0.1/milvus"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigArchiveDiskThreshold
(
"0x10"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigArchiveDaysThreshold
(
"0x10"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigInsertBufferSize
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigInsertBufferSize
(
"-1"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetDBConfigInsertBufferSize
(
"2048"
);
ASSERT_FALSE
(
s
.
ok
());
/* metric config */
s
=
config
.
SetMetricConfigEnableMonitor
(
"Y"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetMetricConfigCollector
(
"zilliz"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetMetricConfigPrometheusPort
(
"0xff"
);
ASSERT_FALSE
(
s
.
ok
());
/* cache config */
s
=
config
.
SetCacheConfigCpuCacheCapacity
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigCpuCacheCapacity
(
"-1"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigCpuCacheCapacity
(
"2048"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigCpuCacheThreshold
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigCpuCacheThreshold
(
"1.0"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheCapacity
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheCapacity
(
"128"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheThreshold
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheThreshold
(
"1.0"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigCacheInsertData
(
"N"
);
ASSERT_FALSE
(
s
.
ok
());
/* engine config */
s
=
config
.
SetEngineConfigUseBlasThreshold
(
"0xff"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetEngineConfigOmpThreadNum
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetEngineConfigOmpThreadNum
(
"-1"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetEngineConfigGpuSearchThreshold
(
"-1"
);
ASSERT_FALSE
(
s
.
ok
());
/* resource config */
s
=
config
.
SetResourceConfigMode
(
"default"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetResourceConfigIndexBuildDevice
(
"gup2"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetResourceConfigIndexBuildDevice
(
"gpu16"
);
ASSERT_FALSE
(
s
.
ok
());
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录