Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
bc23b7a3
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,发现更多精彩内容 >>
提交
bc23b7a3
编写于
10月 09, 2019
作者:
T
test
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MS-575 Add Clang-format & Clang-tidy & Cpplint
Former-commit-id: d20bf96022680c43b050d9d5327ee77dcfa1ba80
上级
406fc339
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
91 addition
and
91 deletion
+91
-91
cpp/src/db/DBImpl.cpp
cpp/src/db/DBImpl.cpp
+2
-1
cpp/src/db/meta/MySQLMetaImpl.cpp
cpp/src/db/meta/MySQLMetaImpl.cpp
+12
-9
cpp/src/scheduler/optimizer/HybridPass.cpp
cpp/src/scheduler/optimizer/HybridPass.cpp
+4
-4
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
+2
-3
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/scheduler/task/SearchTask.cpp
cpp/src/scheduler/task/SearchTask.cpp
+2
-2
cpp/src/sdk/include/Status.h
cpp/src/sdk/include/Status.h
+5
-5
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/server/grpc_impl/GrpcRequestHandler.h
cpp/src/server/grpc_impl/GrpcRequestHandler.h
+19
-19
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
+2
-2
cpp/src/utils/LogUtil.cpp
cpp/src/utils/LogUtil.cpp
+1
-1
未找到文件。
cpp/src/db/DBImpl.cpp
浏览文件 @
bc23b7a3
...
...
@@ -296,7 +296,8 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) {
std
::
vector
<
int
>
file_types
;
if
(
index
.
engine_type_
==
static_cast
<
int32_t
>
(
EngineType
::
FAISS_IDMAP
))
{
file_types
=
{
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW_MERGE
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW_MERGE
),
};
}
else
{
file_types
=
{
...
...
cpp/src/db/meta/MySQLMetaImpl.cpp
浏览文件 @
bc23b7a3
...
...
@@ -148,15 +148,18 @@ static const MetaSchema TABLES_SCHEMA(META_TABLES, {
});
// TableFiles schema
static
const
MetaSchema
TABLEFILES_SCHEMA
(
META_TABLEFILES
,
{
MetaField
(
"id"
,
"BIGINT"
,
"PRIMARY KEY AUTO_INCREMENT"
),
MetaField
(
"table_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"engine_type"
,
"INT"
,
"DEFAULT 1 NOT NULL"
),
MetaField
(
"file_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"file_type"
,
"INT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"file_size"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"row_count"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"updated_time"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"created_on"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"date"
,
"INT"
,
"DEFAULT -1 NOT NULL"
),
});
static
const
MetaSchema
TABLEFILES_SCHEMA
(
META_TABLEFILES
,
{
MetaField
(
"id"
,
"BIGINT"
,
"PRIMARY KEY AUTO_INCREMENT"
),
MetaField
(
"table_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"engine_type"
,
"INT"
,
"DEFAULT 1 NOT NULL"
),
MetaField
(
"file_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"file_type"
,
"INT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"file_size"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"row_count"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"updated_time"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"created_on"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"date"
,
"INT"
,
"DEFAULT -1 NOT NULL"
),
});
}
// namespace
...
...
cpp/src/scheduler/optimizer/HybridPass.cpp
浏览文件 @
bc23b7a3
...
...
@@ -24,12 +24,12 @@ namespace scheduler {
bool
HybridPass
::
Run
(
const
TaskPtr
&
task
)
{
// 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
);
// if (search_task->file_->engine_type_ == engine::EngineType::FAISS_IVFSQ8Hybrid)
return
false
;
}
}
// namespace scheduler
}
// namespace milvus
}
// namespace scheduler
}
// namespace milvus
cpp/src/scheduler/optimizer/HybridPass.h
浏览文件 @
bc23b7a3
...
...
@@ -16,16 +16,16 @@
// under the License.
#pragma once
#include <
string
>
#include <
vector
>
#include <
condition_variable
>
#include <
deque
>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <deque>
#include <unordered_map>
#include <string>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory>
#include <unordered_map>
#include <vector>
#include "Pass.h"
...
...
@@ -43,6 +43,5 @@ class HybridPass : public Pass {
using
HybridPassPtr
=
std
::
shared_ptr
<
HybridPass
>
;
}
// namespace scheduler
}
// namespace milvus
}
// namespace scheduler
}
// namespace milvus
cpp/src/scheduler/optimizer/Optimizer.cpp
浏览文件 @
bc23b7a3
...
...
@@ -38,6 +38,5 @@ Optimizer::Run(const TaskPtr& task) {
return
false
;
}
}
// namespace scheduler
}
// namespace milvus
}
// namespace scheduler
}
// namespace milvus
cpp/src/scheduler/optimizer/Optimizer.h
浏览文件 @
bc23b7a3
...
...
@@ -16,16 +16,16 @@
// under the License.
#pragma once
#include <
string
>
#include <
vector
>
#include <
condition_variable
>
#include <
deque
>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <deque>
#include <unordered_map>
#include <string>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory>
#include <unordered_map>
#include <vector>
#include "Pass.h"
...
...
@@ -40,12 +40,11 @@ class Optimizer {
Init
();
bool
Run
(
const
TaskPtr
&
task
);
Run
(
const
TaskPtr
&
task
);
private:
std
::
vector
<
PassPtr
>
pass_list_
;
};
}
// namespace scheduler
}
// namespace milvus
}
// namespace scheduler
}
// namespace milvus
cpp/src/scheduler/optimizer/Pass.h
浏览文件 @
bc23b7a3
...
...
@@ -16,16 +16,16 @@
// under the License.
#pragma once
#include <
string
>
#include <
vector
>
#include <
condition_variable
>
#include <
deque
>
#include <list>
#include <memory>
#include <mutex>
#include <queue>
#include <deque>
#include <unordered_map>
#include <string>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory>
#include <unordered_map>
#include <vector>
#include "scheduler/task/Task.h"
...
...
@@ -35,12 +35,13 @@ namespace scheduler {
class
Pass
{
public:
virtual
void
Init
()
{}
Init
()
{
}
virtual
bool
Run
(
const
TaskPtr
&
task
)
=
0
;
};
using
PassPtr
=
std
::
shared_ptr
<
Pass
>
;
}
// namespace scheduler
}
// namespace milvus
}
// namespace scheduler
}
// namespace milvus
cpp/src/scheduler/task/SearchTask.cpp
浏览文件 @
bc23b7a3
...
...
@@ -157,8 +157,8 @@ XSearchTask::Load(LoadType type, uint8_t device_id) {
size_t
file_size
=
index_engine_
->
PhysicalSize
();
std
::
string
info
=
"Load file id:"
+
std
::
to_string
(
file_
->
id_
)
+
" file type:"
+
std
::
to_string
(
file_
->
file_type_
)
+
" size:"
+
std
::
to_string
(
file_size
)
+
std
::
string
info
=
"Load file id:"
+
std
::
to_string
(
file_
->
id_
)
+
" file type:"
+
std
::
to_string
(
file_
->
file_type_
)
+
" size:"
+
std
::
to_string
(
file_size
)
+
" bytes from location: "
+
file_
->
location_
+
" totally cost"
;
double
span
=
rc
.
ElapseFromBegin
(
info
);
// for (auto &context : search_contexts_) {
...
...
cpp/src/sdk/include/Status.h
浏览文件 @
bc23b7a3
...
...
@@ -20,12 +20,12 @@
#include <string>
/** \brief Milvus SDK namespace
*/
*/
namespace
milvus
{
/**
* @brief Status Code for SDK interface return
*/
* @brief Status Code for SDK interface return
*/
enum
class
StatusCode
{
OK
=
0
,
...
...
@@ -41,8 +41,8 @@ enum class StatusCode {
};
/**
* @brief Status for SDK interface return
*/
* @brief Status for SDK interface return
*/
class
Status
{
public:
Status
(
StatusCode
code
,
const
std
::
string
&
msg
);
...
...
cpp/src/server/Config.cpp
浏览文件 @
bc23b7a3
...
...
@@ -735,8 +735,7 @@ Config::GetDBConfigArchiveDaysThreshold(int32_t& value) {
Status
Config
::
GetDBConfigInsertBufferSize
(
int32_t
&
value
)
{
std
::
string
str
=
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_INSERT_BUFFER_SIZE
,
CONFIG_DB_INSERT_BUFFER_SIZE_DEFAULT
);
std
::
string
str
=
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_INSERT_BUFFER_SIZE
,
CONFIG_DB_INSERT_BUFFER_SIZE_DEFAULT
);
Status
s
=
CheckDBConfigInsertBufferSize
(
str
);
if
(
!
s
.
ok
())
{
return
s
;
...
...
@@ -748,8 +747,7 @@ Config::GetDBConfigInsertBufferSize(int32_t& value) {
Status
Config
::
GetDBConfigBuildIndexGPU
(
int32_t
&
value
)
{
std
::
string
str
=
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_BUILD_INDEX_GPU
,
CONFIG_DB_BUILD_INDEX_GPU_DEFAULT
);
std
::
string
str
=
GetConfigStr
(
CONFIG_DB
,
CONFIG_DB_BUILD_INDEX_GPU
,
CONFIG_DB_BUILD_INDEX_GPU_DEFAULT
);
Status
s
=
CheckDBConfigBuildIndexGPU
(
str
);
if
(
!
s
.
ok
())
{
return
s
;
...
...
@@ -767,8 +765,7 @@ Config::GetDBConfigPreloadTable(std::string& value) {
Status
Config
::
GetMetricConfigEnableMonitor
(
bool
&
value
)
{
std
::
string
str
=
GetConfigStr
(
CONFIG_METRIC
,
CONFIG_METRIC_ENABLE_MONITOR
,
CONFIG_METRIC_ENABLE_MONITOR_DEFAULT
);
std
::
string
str
=
GetConfigStr
(
CONFIG_METRIC
,
CONFIG_METRIC_ENABLE_MONITOR
,
CONFIG_METRIC_ENABLE_MONITOR_DEFAULT
);
Status
s
=
CheckMetricConfigEnableMonitor
(
str
);
if
(
!
s
.
ok
())
{
return
s
;
...
...
@@ -872,8 +869,7 @@ Config::GetEngineConfigUseBlasThreshold(int32_t& value) {
Status
Config
::
GetEngineConfigOmpThreadNum
(
int32_t
&
value
)
{
std
::
string
str
=
GetConfigStr
(
CONFIG_ENGINE
,
CONFIG_ENGINE_OMP_THREAD_NUM
,
CONFIG_ENGINE_OMP_THREAD_NUM_DEFAULT
);
std
::
string
str
=
GetConfigStr
(
CONFIG_ENGINE
,
CONFIG_ENGINE_OMP_THREAD_NUM
,
CONFIG_ENGINE_OMP_THREAD_NUM_DEFAULT
);
Status
s
=
CheckEngineConfigOmpThreadNum
(
str
);
if
(
!
s
.
ok
())
{
return
s
;
...
...
cpp/src/server/DBWrapper.cpp
浏览文件 @
bc23b7a3
...
...
@@ -25,6 +25,7 @@
#include <faiss/utils.h>
#include <omp.h>
#include <string>
#include <vector>
namespace
milvus
{
namespace
server
{
...
...
@@ -183,14 +184,14 @@ DBWrapper::StopService() {
Status
DBWrapper
::
PreloadTables
(
const
std
::
string
&
preload_tables
)
{
if
(
preload_tables
.
empty
())
{
//do nothing
}
else
if
(
preload_tables
==
"*"
)
{
//load all tables
if
(
preload_tables
.
empty
())
{
//
do nothing
}
else
if
(
preload_tables
==
"*"
)
{
//
load all tables
std
::
vector
<
engine
::
meta
::
TableSchema
>
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_
);
if
(
!
status
.
ok
())
{
return
status
;
...
...
@@ -199,7 +200,7 @@ DBWrapper::PreloadTables(const std::string& preload_tables) {
}
else
{
std
::
vector
<
std
::
string
>
table_names
;
StringHelpFunctions
::
SplitStringByDelimeter
(
preload_tables
,
","
,
table_names
);
for
(
auto
&
name
:
table_names
)
{
for
(
auto
&
name
:
table_names
)
{
auto
status
=
db_
->
PreloadTable
(
name
);
if
(
!
status
.
ok
())
{
return
status
;
...
...
cpp/src/server/DBWrapper.h
浏览文件 @
bc23b7a3
...
...
@@ -21,6 +21,7 @@
#include "utils/Status.h"
#include <memory>
#include <string>
namespace
milvus
{
namespace
server
{
...
...
cpp/src/server/grpc_impl/GrpcRequestHandler.h
浏览文件 @
bc23b7a3
...
...
@@ -148,25 +148,25 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service {
::
milvus
::
grpc
::
TopKQueryResultList
*
response
)
override
;
/**
* @brief Internal use query interface
*
* This method is used to query vector in specified files.
*
* @param context, add context for every RPC
* @param request:
* file_id_array, specified files id array, queried.
* query_record_array, all vector are going to be queried.
* query_range_array, optional ranges for conditional search. If not specified, search whole table
* topk, how many similarity vectors will be searched.
*
* @param writer, write query result array.
*
* @return status
*
* @param context
* @param request
* @param writer
*/
* @brief Internal use query interface
*
* This method is used to query vector in specified files.
*
* @param context, add context for every RPC
* @param request:
* file_id_array, specified files id array, queried.
* query_record_array, all vector are going to be queried.
* query_range_array, optional ranges for conditional search. If not specified, search whole table
* topk, how many similarity vectors will be searched.
*
* @param writer, write query result array.
*
* @return status
*
* @param context
* @param request
* @param writer
*/
::
grpc
::
Status
SearchInFiles
(
::
grpc
::
ServerContext
*
context
,
const
::
milvus
::
grpc
::
SearchInFilesParam
*
request
,
::
milvus
::
grpc
::
TopKQueryResultList
*
response
)
override
;
...
...
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
浏览文件 @
bc23b7a3
...
...
@@ -511,8 +511,8 @@ InsertTask::OnExecute() {
}
// step 6: update table flag
user_provide_ids
?
table_info
.
flag_
|=
engine
::
meta
::
FLAG_MASK_HAS_USERID
:
table_info
.
flag_
|=
engine
::
meta
::
FLAG_MASK_NO_USERID
;
user_provide_ids
?
table_info
.
flag_
|=
engine
::
meta
::
FLAG_MASK_HAS_USERID
:
table_info
.
flag_
|=
engine
::
meta
::
FLAG_MASK_NO_USERID
;
status
=
DBWrapper
::
DB
()
->
UpdateTableFlag
(
insert_param_
->
table_name
(),
table_info
.
flag_
);
#ifdef MILVUS_ENABLE_PROFILING
...
...
cpp/src/utils/LogUtil.cpp
浏览文件 @
bc23b7a3
...
...
@@ -31,7 +31,7 @@ static int warning_idx = 0;
static
int
trace_idx
=
0
;
static
int
error_idx
=
0
;
static
int
fatal_idx
=
0
;
}
}
// namespace
// TODO(yzb) : change the easylogging library to get the log level from parameter rather than filename
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录