Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
79221be2
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,发现更多精彩内容 >>
提交
79221be2
编写于
10月 09, 2019
作者:
G
groot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine code
Former-commit-id: 1ae20820e89e60a9ce8294d7e7e5f976fb72e55c
上级
d0e07fb0
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
50 addition
and
54 deletion
+50
-54
cpp/src/scheduler/optimizer/HybridPass.cpp
cpp/src/scheduler/optimizer/HybridPass.cpp
+5
-5
cpp/src/scheduler/optimizer/HybridPass.h
cpp/src/scheduler/optimizer/HybridPass.h
+9
-10
cpp/src/scheduler/optimizer/Optimizer.cpp
cpp/src/scheduler/optimizer/Optimizer.cpp
+3
-4
cpp/src/scheduler/optimizer/Optimizer.h
cpp/src/scheduler/optimizer/Optimizer.h
+10
-11
cpp/src/scheduler/optimizer/Pass.h
cpp/src/scheduler/optimizer/Pass.h
+11
-10
cpp/src/server/Config.cpp
cpp/src/server/Config.cpp
+4
-8
cpp/src/server/DBWrapper.cpp
cpp/src/server/DBWrapper.cpp
+7
-6
cpp/src/server/DBWrapper.h
cpp/src/server/DBWrapper.h
+1
-0
未找到文件。
cpp/src/scheduler/optimizer/HybridPass.cpp
浏览文件 @
79221be2
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// specific language governing permissions and limitations
// under the License.
// under the License.
#include "HybridPass.h"
#include "
scheduler/optimizer/
HybridPass.h"
#include "scheduler/task/SearchTask.h"
#include "scheduler/task/SearchTask.h"
namespace
milvus
{
namespace
milvus
{
...
@@ -24,12 +24,12 @@ namespace scheduler {
...
@@ -24,12 +24,12 @@ namespace scheduler {
bool
bool
HybridPass
::
Run
(
const
TaskPtr
&
task
)
{
HybridPass
::
Run
(
const
TaskPtr
&
task
)
{
// TODO: Index::IVFSQ8Hybrid, if nq < threshold set cpu, else set gpu
// TODO: Index::IVFSQ8Hybrid, if nq < threshold set cpu, else set gpu
if
(
task
->
Type
()
!=
TaskType
::
SearchTask
)
return
false
;
if
(
task
->
Type
()
!=
TaskType
::
SearchTask
)
return
false
;
auto
search_task
=
std
::
static_pointer_cast
<
XSearchTask
>
(
task
);
auto
search_task
=
std
::
static_pointer_cast
<
XSearchTask
>
(
task
);
// if (search_task->file_->engine_type_ == engine::EngineType::FAISS_IVFSQ8Hybrid)
// if (search_task->file_->engine_type_ == engine::EngineType::FAISS_IVFSQ8Hybrid)
return
false
;
return
false
;
}
}
}
}
// namespace scheduler
}
}
// namespace milvus
cpp/src/scheduler/optimizer/HybridPass.h
浏览文件 @
79221be2
...
@@ -16,16 +16,16 @@
...
@@ -16,16 +16,16 @@
// under the License.
// under the License.
#pragma once
#pragma once
#include <
string
>
#include <
condition_variable
>
#include <
vector
>
#include <
deque
>
#include <list>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <queue>
#include <deque>
#include <string>
#include <unordered_map>
#include <thread>
#include <thread>
#include <mutex>
#include <unordered_map>
#include <condition_variable>
#include <vector>
#include <memory>
#include "Pass.h"
#include "Pass.h"
...
@@ -43,6 +43,5 @@ class HybridPass : public Pass {
...
@@ -43,6 +43,5 @@ class HybridPass : public Pass {
using
HybridPassPtr
=
std
::
shared_ptr
<
HybridPass
>
;
using
HybridPassPtr
=
std
::
shared_ptr
<
HybridPass
>
;
}
}
// namespace scheduler
}
}
// namespace milvus
cpp/src/scheduler/optimizer/Optimizer.cpp
浏览文件 @
79221be2
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// specific language governing permissions and limitations
// under the License.
// under the License.
#include "Optimizer.h"
#include "
scheduler/optimizer/
Optimizer.h"
namespace
milvus
{
namespace
milvus
{
namespace
scheduler
{
namespace
scheduler
{
...
@@ -38,6 +38,5 @@ Optimizer::Run(const TaskPtr& task) {
...
@@ -38,6 +38,5 @@ Optimizer::Run(const TaskPtr& task) {
return
false
;
return
false
;
}
}
}
}
// namespace scheduler
}
}
// namespace milvus
cpp/src/scheduler/optimizer/Optimizer.h
浏览文件 @
79221be2
...
@@ -16,16 +16,16 @@
...
@@ -16,16 +16,16 @@
// under the License.
// under the License.
#pragma once
#pragma once
#include <
string
>
#include <
condition_variable
>
#include <
vector
>
#include <
deque
>
#include <list>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <queue>
#include <deque>
#include <string>
#include <unordered_map>
#include <thread>
#include <thread>
#include <mutex>
#include <unordered_map>
#include <condition_variable>
#include <vector>
#include <memory>
#include "Pass.h"
#include "Pass.h"
...
@@ -40,12 +40,11 @@ class Optimizer {
...
@@ -40,12 +40,11 @@ class Optimizer {
Init
();
Init
();
bool
bool
Run
(
const
TaskPtr
&
task
);
Run
(
const
TaskPtr
&
task
);
private:
private:
std
::
vector
<
PassPtr
>
pass_list_
;
std
::
vector
<
PassPtr
>
pass_list_
;
};
};
}
}
// namespace scheduler
}
}
// namespace milvus
cpp/src/scheduler/optimizer/Pass.h
浏览文件 @
79221be2
...
@@ -16,16 +16,16 @@
...
@@ -16,16 +16,16 @@
// under the License.
// under the License.
#pragma once
#pragma once
#include <
string
>
#include <
condition_variable
>
#include <
vector
>
#include <
deque
>
#include <list>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <queue>
#include <deque>
#include <string>
#include <unordered_map>
#include <thread>
#include <thread>
#include <mutex>
#include <unordered_map>
#include <condition_variable>
#include <vector>
#include <memory>
#include "scheduler/task/Task.h"
#include "scheduler/task/Task.h"
...
@@ -35,12 +35,13 @@ namespace scheduler {
...
@@ -35,12 +35,13 @@ namespace scheduler {
class
Pass
{
class
Pass
{
public:
public:
virtual
void
virtual
void
Init
()
{}
Init
()
{
}
virtual
bool
virtual
bool
Run
(
const
TaskPtr
&
task
)
=
0
;
Run
(
const
TaskPtr
&
task
)
=
0
;
};
};
using
PassPtr
=
std
::
shared_ptr
<
Pass
>
;
using
PassPtr
=
std
::
shared_ptr
<
Pass
>
;
}
}
// namespace scheduler
}
}
// namespace milvus
cpp/src/server/Config.cpp
浏览文件 @
79221be2
...
@@ -735,8 +735,7 @@ Config::GetDBConfigArchiveDaysThreshold(int32_t& value) {
...
@@ -735,8 +735,7 @@ Config::GetDBConfigArchiveDaysThreshold(int32_t& value) {
Status
Status
Config
::
GetDBConfigInsertBufferSize
(
int32_t
&
value
)
{
Config
::
GetDBConfigInsertBufferSize
(
int32_t
&
value
)
{
std
::
string
str
=
std
::
string
str
=
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_INSERT_BUFFER_SIZE
,
CONFIG_DB_INSERT_BUFFER_SIZE_DEFAULT
);
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_INSERT_BUFFER_SIZE
,
CONFIG_DB_INSERT_BUFFER_SIZE_DEFAULT
);
Status
s
=
CheckDBConfigInsertBufferSize
(
str
);
Status
s
=
CheckDBConfigInsertBufferSize
(
str
);
if
(
!
s
.
ok
())
{
if
(
!
s
.
ok
())
{
return
s
;
return
s
;
...
@@ -748,8 +747,7 @@ Config::GetDBConfigInsertBufferSize(int32_t& value) {
...
@@ -748,8 +747,7 @@ Config::GetDBConfigInsertBufferSize(int32_t& value) {
Status
Status
Config
::
GetDBConfigBuildIndexGPU
(
int32_t
&
value
)
{
Config
::
GetDBConfigBuildIndexGPU
(
int32_t
&
value
)
{
std
::
string
str
=
std
::
string
str
=
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_BUILD_INDEX_GPU
,
CONFIG_DB_BUILD_INDEX_GPU_DEFAULT
);
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_BUILD_INDEX_GPU
,
CONFIG_DB_BUILD_INDEX_GPU_DEFAULT
);
Status
s
=
CheckDBConfigBuildIndexGPU
(
str
);
Status
s
=
CheckDBConfigBuildIndexGPU
(
str
);
if
(
!
s
.
ok
())
{
if
(
!
s
.
ok
())
{
return
s
;
return
s
;
...
@@ -767,8 +765,7 @@ Config::GetDBConfigPreloadTable(std::string& value) {
...
@@ -767,8 +765,7 @@ Config::GetDBConfigPreloadTable(std::string& value) {
Status
Status
Config
::
GetMetricConfigEnableMonitor
(
bool
&
value
)
{
Config
::
GetMetricConfigEnableMonitor
(
bool
&
value
)
{
std
::
string
str
=
std
::
string
str
=
GetConfigStr
(
CONFIG_METRIC
,
CONFIG_METRIC_ENABLE_MONITOR
,
CONFIG_METRIC_ENABLE_MONITOR_DEFAULT
);
GetConfigStr
(
CONFIG_METRIC
,
CONFIG_METRIC_ENABLE_MONITOR
,
CONFIG_METRIC_ENABLE_MONITOR_DEFAULT
);
Status
s
=
CheckMetricConfigEnableMonitor
(
str
);
Status
s
=
CheckMetricConfigEnableMonitor
(
str
);
if
(
!
s
.
ok
())
{
if
(
!
s
.
ok
())
{
return
s
;
return
s
;
...
@@ -872,8 +869,7 @@ Config::GetEngineConfigUseBlasThreshold(int32_t& value) {
...
@@ -872,8 +869,7 @@ Config::GetEngineConfigUseBlasThreshold(int32_t& value) {
Status
Status
Config
::
GetEngineConfigOmpThreadNum
(
int32_t
&
value
)
{
Config
::
GetEngineConfigOmpThreadNum
(
int32_t
&
value
)
{
std
::
string
str
=
std
::
string
str
=
GetConfigStr
(
CONFIG_ENGINE
,
CONFIG_ENGINE_OMP_THREAD_NUM
,
CONFIG_ENGINE_OMP_THREAD_NUM_DEFAULT
);
GetConfigStr
(
CONFIG_ENGINE
,
CONFIG_ENGINE_OMP_THREAD_NUM
,
CONFIG_ENGINE_OMP_THREAD_NUM_DEFAULT
);
Status
s
=
CheckEngineConfigOmpThreadNum
(
str
);
Status
s
=
CheckEngineConfigOmpThreadNum
(
str
);
if
(
!
s
.
ok
())
{
if
(
!
s
.
ok
())
{
return
s
;
return
s
;
...
...
cpp/src/server/DBWrapper.cpp
浏览文件 @
79221be2
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <faiss/utils.h>
#include <faiss/utils.h>
#include <omp.h>
#include <omp.h>
#include <string>
#include <string>
#include <vector>
namespace
milvus
{
namespace
milvus
{
namespace
server
{
namespace
server
{
...
@@ -183,14 +184,14 @@ DBWrapper::StopService() {
...
@@ -183,14 +184,14 @@ DBWrapper::StopService() {
Status
Status
DBWrapper
::
PreloadTables
(
const
std
::
string
&
preload_tables
)
{
DBWrapper
::
PreloadTables
(
const
std
::
string
&
preload_tables
)
{
if
(
preload_tables
.
empty
())
{
if
(
preload_tables
.
empty
())
{
//do nothing
//
do nothing
}
else
if
(
preload_tables
==
"*"
)
{
}
else
if
(
preload_tables
==
"*"
)
{
//load all tables
//
load all tables
std
::
vector
<
engine
::
meta
::
TableSchema
>
table_schema_array
;
std
::
vector
<
engine
::
meta
::
TableSchema
>
table_schema_array
;
db_
->
AllTables
(
table_schema_array
);
db_
->
AllTables
(
table_schema_array
);
for
(
auto
&
schema
:
table_schema_array
)
{
for
(
auto
&
schema
:
table_schema_array
)
{
auto
status
=
db_
->
PreloadTable
(
schema
.
table_id_
);
auto
status
=
db_
->
PreloadTable
(
schema
.
table_id_
);
if
(
!
status
.
ok
())
{
if
(
!
status
.
ok
())
{
return
status
;
return
status
;
...
@@ -199,7 +200,7 @@ DBWrapper::PreloadTables(const std::string& preload_tables) {
...
@@ -199,7 +200,7 @@ DBWrapper::PreloadTables(const std::string& preload_tables) {
}
else
{
}
else
{
std
::
vector
<
std
::
string
>
table_names
;
std
::
vector
<
std
::
string
>
table_names
;
StringHelpFunctions
::
SplitStringByDelimeter
(
preload_tables
,
","
,
table_names
);
StringHelpFunctions
::
SplitStringByDelimeter
(
preload_tables
,
","
,
table_names
);
for
(
auto
&
name
:
table_names
)
{
for
(
auto
&
name
:
table_names
)
{
auto
status
=
db_
->
PreloadTable
(
name
);
auto
status
=
db_
->
PreloadTable
(
name
);
if
(
!
status
.
ok
())
{
if
(
!
status
.
ok
())
{
return
status
;
return
status
;
...
...
cpp/src/server/DBWrapper.h
浏览文件 @
79221be2
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "utils/Status.h"
#include "utils/Status.h"
#include <memory>
#include <memory>
#include <string>
namespace
milvus
{
namespace
milvus
{
namespace
server
{
namespace
server
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录