Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
25e8ed53
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
25e8ed53
编写于
6月 24, 2019
作者:
Z
zhiru
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/branch-0.3.0' into mysql-0.3.0
Former-commit-id: 5935eae6d401f047e1e75718cae16fdfa5883030
上级
bc24d74c
0086b464
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
30 deletion
+31
-30
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+1
-0
cpp/build.sh
cpp/build.sh
+2
-2
cpp/coverage.sh
cpp/coverage.sh
+1
-1
cpp/src/license/LicenseCheck.cpp
cpp/src/license/LicenseCheck.cpp
+8
-8
cpp/src/main.cpp
cpp/src/main.cpp
+13
-13
cpp/src/server/Server.cpp
cpp/src/server/Server.cpp
+6
-6
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
25e8ed53
...
...
@@ -5,6 +5,7 @@ Please mark all change in change log and use the ticket from JIRA.
# Milvus 0.3.0 (TBD)
## Bug
-
MS-104 - Fix unittest lcov execution error
-
MS-102 - Fix build script file condition error
-
MS-80 - Fix server hang issue
-
MS-89 - Fix compile failed, libgpufaiss.a link missing
...
...
cpp/build.sh
浏览文件 @
25e8ed53
...
...
@@ -84,10 +84,10 @@ if [[ ${BUILD_TYPE} != "Debug" ]]; then
strip src/milvus_server
fi
make
install
||
exit
1
if
[[
${
BUILD_COVERAGE
}
==
"ON"
]]
;
then
cd
-
bash
`
pwd
`
/coverage.sh
cd
-
fi
make
install
cpp/coverage.sh
浏览文件 @
25e8ed53
...
...
@@ -32,7 +32,7 @@ for test in `ls ${DIR_UNITTEST}`; do
done
# gen test converage
${
LCOV_CMD
}
-d
${
DIR_GCNO
}
-o
"
${
FILE_INFO_MILVUS
}
"
-c
-b
${
LCOV_CMD
}
-d
${
DIR_GCNO
}
-o
"
${
FILE_INFO_MILVUS
}
"
-c
# merge coverage
${
LCOV_CMD
}
-a
${
FILE_INFO_BASE
}
-a
${
FILE_INFO_MILVUS
}
-o
"
${
FILE_INFO_OUTPUT
}
"
...
...
cpp/src/license/LicenseCheck.cpp
浏览文件 @
25e8ed53
...
...
@@ -47,27 +47,27 @@ LicenseCheck::LegalityCheck(const std::string &license_file_path) {
end_time
);
if
(
err
!=
SERVER_SUCCESS
)
{
printf
(
"License check error: 01
\n
"
)
;
std
::
cout
<<
"License check error: 01"
<<
std
::
endl
;
return
SERVER_UNEXPECTED_ERROR
;
}
time_t
system_time
;
LicenseLibrary
::
GetSystemTime
(
system_time
);
if
(
device_count
!=
output_device_count
)
{
printf
(
"License check error: 02
\n
"
)
;
std
::
cout
<<
"License check error: 02"
<<
std
::
endl
;
return
SERVER_UNEXPECTED_ERROR
;
}
for
(
int
i
=
0
;
i
<
device_count
;
++
i
)
{
if
(
sha_array
[
i
]
!=
uuid_encryption_map
[
i
])
{
printf
(
"License check error: 03
\n
"
)
;
std
::
cout
<<
"License check error: 03"
<<
std
::
endl
;
return
SERVER_UNEXPECTED_ERROR
;
}
}
if
(
system_time
<
starting_time
||
system_time
>
end_time
)
{
printf
(
"License check error: 04
\n
"
)
;
std
::
cout
<<
"License check error: 04"
<<
std
::
endl
;
return
SERVER_UNEXPECTED_ERROR
;
}
printf
(
"Legality Check Success
\n
"
)
;
std
::
cout
<<
"Legality Check Success"
<<
std
::
endl
;
return
SERVER_SUCCESS
;
}
...
...
@@ -80,11 +80,11 @@ LicenseCheck::AlterFile(const std::string &license_file_path,
ServerError
err
=
LicenseCheck
::
LegalityCheck
(
license_file_path
);
if
(
err
!=
SERVER_SUCCESS
)
{
printf
(
"license file check error
\n
"
)
;
std
::
cout
<<
"license file check error"
<<
std
::
endl
;
exit
(
1
);
}
printf
(
"---runing---
\n
"
)
;
std
::
cout
<<
"---runing---"
<<
std
::
endl
;
pt
->
expires_at
(
pt
->
expires_at
()
+
boost
::
posix_time
::
hours
(
1
));
pt
->
async_wait
(
boost
::
bind
(
LicenseCheck
::
AlterFile
,
license_file_path
,
boost
::
asio
::
placeholders
::
error
,
pt
));
...
...
@@ -96,7 +96,7 @@ ServerError
LicenseCheck
::
StartCountingDown
(
const
std
::
string
&
license_file_path
)
{
if
(
!
LicenseLibrary
::
IsFileExistent
(
license_file_path
))
{
printf
(
"license file not exist
\n
"
)
;
std
::
cout
<<
"license file not exist"
<<
std
::
endl
;
exit
(
1
);
}
...
...
cpp/src/main.cpp
浏览文件 @
25e8ed53
...
...
@@ -26,8 +26,8 @@ using namespace zilliz::milvus;
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"
\n
Welcome to use Milvus by Zillz!
\n
"
)
;
printf
(
"Milvus %s version: v%s built at %s
\n
"
,
BUILD_TYPE
,
MILVUS_VERSION
,
BUILD_TIME
)
;
std
::
cout
<<
std
::
endl
<<
"Welcome to use Milvus by Zillz!"
<<
std
::
endl
;
std
::
cout
<<
"Milvus "
<<
BUILD_TYPE
<<
" version: v"
<<
MILVUS_VERSION
<<
" built at "
<<
BUILD_TIME
<<
std
::
endl
;
signal
(
SIGINT
,
server
::
SignalUtil
::
HandleSignal
);
signal
(
SIGSEGV
,
server
::
SignalUtil
::
HandleSignal
);
...
...
@@ -53,7 +53,7 @@ main(int argc, char *argv[]) {
if
(
argc
<
2
)
{
print_help
(
app_name
);
printf
(
"Milvus server exit...
\n
"
)
;
std
::
cout
<<
"Milvus server exit..."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
...
...
@@ -64,14 +64,14 @@ main(int argc, char *argv[]) {
char
*
config_filename_ptr
=
strdup
(
optarg
);
config_filename
=
config_filename_ptr
;
free
(
config_filename_ptr
);
printf
(
"Loading configuration from: %s
\n
"
,
config_filename
.
c_str
())
;
std
::
cout
<<
"Loading configuration from: "
<<
config_filename
<<
std
::
endl
;
break
;
}
case
'l'
:
{
char
*
log_filename_ptr
=
strdup
(
optarg
);
log_config_file
=
log_filename_ptr
;
free
(
log_filename_ptr
);
printf
(
"Initial log config from: %s
\n
"
,
log_config_file
.
c_str
())
;
std
::
cout
<<
"Initial log config from: "
<<
log_config_file
<<
std
::
endl
;
break
;
}
...
...
@@ -79,7 +79,7 @@ main(int argc, char *argv[]) {
char
*
pid_filename_ptr
=
strdup
(
optarg
);
pid_filename
=
pid_filename_ptr
;
free
(
pid_filename_ptr
);
printf
(
"%s
\n
"
,
pid_filename
.
c_str
())
;
std
::
cout
<<
pid_filename
<<
std
::
endl
;
break
;
}
...
...
@@ -107,11 +107,11 @@ main(int argc, char *argv[]) {
void
print_help
(
const
std
::
string
&
app_name
)
{
printf
(
"
\n
Usage: %s [OPTIONS]
\n\n
"
,
app_name
.
c_str
())
;
printf
(
" Options:
\n
"
)
;
printf
(
" -h --help Print this help
\n
"
)
;
printf
(
" -c --conf_file filename Read configuration from the file
\n
"
)
;
printf
(
" -d --daemon Daemonize this application
\n
"
)
;
printf
(
" -p --pid_file filename PID file used by daemonized app
\n
"
)
;
printf
(
"
\n
"
)
;
std
::
cout
<<
std
::
endl
<<
"Usage: "
<<
app_name
<<
" [OPTIONS]"
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
" Options:"
<<
std
::
endl
;
std
::
cout
<<
" -h --help Print this help"
<<
std
::
endl
;
std
::
cout
<<
" -c --conf_file filename Read configuration from the file"
<<
std
::
endl
;
std
::
cout
<<
" -d --daemon Daemonize this application"
<<
std
::
endl
;
std
::
cout
<<
" -p --pid_file filename PID file used by daemonized app"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
}
cpp/src/server/Server.cpp
浏览文件 @
25e8ed53
...
...
@@ -171,7 +171,7 @@ Server::Start() {
signal
(
SIGTERM
,
SignalUtil
::
HandleSignal
);
server
::
Metrics
::
GetInstance
().
Init
();
server
::
SystemInfo
::
GetInstance
().
Init
();
printf
(
"Milvus server start successfully.
\n
"
)
;
std
::
cout
<<
"Milvus server start successfully."
<<
std
::
endl
;
StartService
();
}
catch
(
std
::
exception
&
ex
){
...
...
@@ -187,18 +187,18 @@ Server::Start() {
void
Server
::
Stop
()
{
printf
(
"Milvus server is going to shutdown ...
\n
"
)
;
std
::
cout
<<
"Milvus server is going to shutdown ..."
<<
std
::
endl
;
// Unlock and close lockfile
if
(
pid_fd
!=
-
1
)
{
int
ret
=
lockf
(
pid_fd
,
F_ULOCK
,
0
);
if
(
ret
!=
0
){
printf
(
"Can't lock file: %s
\n
"
,
strerror
(
errno
))
;
std
::
cout
<<
"Can't lock file: "
<<
strerror
(
errno
)
<<
std
::
endl
;
exit
(
0
);
}
ret
=
close
(
pid_fd
);
if
(
ret
!=
0
){
printf
(
"Can't close file: %s
\n
"
,
strerror
(
errno
))
;
std
::
cout
<<
"Can't close file: "
<<
strerror
(
errno
)
<<
std
::
endl
;
exit
(
0
);
}
}
...
...
@@ -207,7 +207,7 @@ Server::Stop() {
if
(
!
pid_filename_
.
empty
())
{
int
ret
=
unlink
(
pid_filename_
.
c_str
());
if
(
ret
!=
0
){
printf
(
"Can't unlink file: %s
\n
"
,
strerror
(
errno
))
;
std
::
cout
<<
"Can't unlink file: "
<<
strerror
(
errno
)
<<
std
::
endl
;
exit
(
0
);
}
}
...
...
@@ -219,7 +219,7 @@ Server::Stop() {
#ifdef ENABLE_LICENSE
server
::
LicenseCheck
::
GetInstance
().
StopCountingDown
();
#endif
printf
(
"Milvus server is closed!
\n
"
)
;
std
::
cout
<<
"Milvus server is closed!"
<<
std
::
endl
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录