Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
d1251fb0
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,发现更多精彩内容 >>
提交
d1251fb0
编写于
9月 28, 2019
作者:
S
starlord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format code by clang-tidy
Former-commit-id: 437b1fff79da965b8aafce026c8be4f9d582c909
上级
e8ae6127
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
83 addition
and
75 deletion
+83
-75
.clang-tidy
.clang-tidy
+3
-1
cpp/build.sh
cpp/build.sh
+8
-8
cpp/src/cache/CpuCacheMgr.h
cpp/src/cache/CpuCacheMgr.h
+1
-1
cpp/src/core/test/kdtree.cpp
cpp/src/core/test/kdtree.cpp
+1
-1
cpp/src/core/test/test_ivf.cpp
cpp/src/core/test/test_ivf.cpp
+1
-1
cpp/src/core/test/test_kdt.cpp
cpp/src/core/test/test_kdt.cpp
+1
-1
cpp/src/core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp
...core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp
+2
-2
cpp/src/db/DBImpl.cpp
cpp/src/db/DBImpl.cpp
+9
-7
cpp/src/db/Utils.cpp
cpp/src/db/Utils.cpp
+1
-1
cpp/src/db/engine/ExecutionEngineImpl.cpp
cpp/src/db/engine/ExecutionEngineImpl.cpp
+2
-1
cpp/src/db/meta/MySQLConnectionPool.cpp
cpp/src/db/meta/MySQLConnectionPool.cpp
+1
-1
cpp/src/db/meta/MySQLMetaImpl.cpp
cpp/src/db/meta/MySQLMetaImpl.cpp
+7
-8
cpp/src/db/meta/SqliteMetaImpl.cpp
cpp/src/db/meta/SqliteMetaImpl.cpp
+2
-2
cpp/src/metrics/SystemInfo.cpp
cpp/src/metrics/SystemInfo.cpp
+18
-10
cpp/src/scheduler/ResourceMgr.cpp
cpp/src/scheduler/ResourceMgr.cpp
+1
-1
cpp/src/scheduler/ResourceMgr.h
cpp/src/scheduler/ResourceMgr.h
+2
-2
cpp/src/scheduler/SchedInst.cpp
cpp/src/scheduler/SchedInst.cpp
+1
-1
cpp/src/scheduler/Scheduler.cpp
cpp/src/scheduler/Scheduler.cpp
+1
-1
cpp/src/scheduler/Scheduler.h
cpp/src/scheduler/Scheduler.h
+1
-1
cpp/src/scheduler/TaskCreator.cpp
cpp/src/scheduler/TaskCreator.cpp
+1
-1
cpp/src/scheduler/TaskTable.h
cpp/src/scheduler/TaskTable.h
+2
-2
cpp/src/scheduler/action/PushTaskToNeighbour.cpp
cpp/src/scheduler/action/PushTaskToNeighbour.cpp
+1
-1
cpp/src/scheduler/resource/Node.h
cpp/src/scheduler/resource/Node.h
+1
-1
cpp/src/scheduler/resource/Resource.h
cpp/src/scheduler/resource/Resource.h
+3
-3
cpp/src/scheduler/task/SearchTask.h
cpp/src/scheduler/task/SearchTask.h
+1
-1
cpp/src/sdk/examples/grpcsimple/main.cpp
cpp/src/sdk/examples/grpcsimple/main.cpp
+4
-4
cpp/src/sdk/grpc/ClientProxy.cpp
cpp/src/sdk/grpc/ClientProxy.cpp
+4
-8
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
+1
-1
cpp/unittest/db/db_tests.cpp
cpp/unittest/db/db_tests.cpp
+1
-1
cpp/unittest/server/cache_test.cpp
cpp/unittest/server/cache_test.cpp
+1
-1
未找到文件。
.clang-tidy
浏览文件 @
d1251fb0
...
...
@@ -18,8 +18,10 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,modernize-*,readability-*'
# produce HeaderFilterRegex from cpp/build-support/lint_exclusions.txt with:
# echo -n '^('; sed -e 's/*/\.*/g' cpp/build-support/lint_exclusions.txt | tr '\n' '|'; echo ')$'
HeaderFilterRegex: '^(.*cmake-build-debug.*|.*cmake-build-release.*|.*cmake_build.*|.*src/
thirdparty.*|.*src/core/thirdparty.*|.*src/grpc.*|
)$'
HeaderFilterRegex: '^(.*cmake-build-debug.*|.*cmake-build-release.*|.*cmake_build.*|.*src/
core/thirdparty.*|.*thirdparty.*|.*easylogging++.*|.*SqliteMetaImpl.cpp|.*src/grpc.*|.*src/core.*|.*src/wrapper.*
)$'
AnalyzeTemporaryDtors: true
ChainedConditionalReturn: 1
ChainedConditionalAssignment: 1
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
...
...
cpp/build.sh
浏览文件 @
d1251fb0
...
...
@@ -111,14 +111,14 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
exit
1
fi
echo
"clang-format check passed!"
#
#
# clang-tidy check
#
make check-clang-tidy
#
if [ $? -ne 0 ]; then
#
echo "ERROR! clang-tidy check failed"
#
exit 1
#
fi
#
echo "clang-tidy check passed!"
# clang-tidy check
make check-clang-tidy
if
[
$?
-ne
0
]
;
then
echo
"ERROR! clang-tidy check failed"
exit
1
fi
echo
"clang-tidy check passed!"
else
# compile and build
make
-j
4
||
exit
1
...
...
cpp/src/cache/CpuCacheMgr.h
浏览文件 @
d1251fb0
...
...
@@ -32,7 +32,7 @@ class CpuCacheMgr : public CacheMgr<DataObjPtr> {
CpuCacheMgr
();
public:
// TODO: use smart pointer instead
// TODO
(myh)
: use smart pointer instead
static
CpuCacheMgr
*
GetInstance
();
...
...
cpp/src/core/test/kdtree.cpp
浏览文件 @
d1251fb0
...
...
@@ -44,7 +44,7 @@ DatasetPtr
generate_queries
(
int64_t
n
,
int64_t
d
,
int64_t
k
,
int64_t
base
)
{
size_t
size
=
sizeof
(
float
)
*
n
*
d
;
auto
v
=
(
float
*
)
malloc
(
size
);
// TODO: check malloc
// TODO
(lxj)
: check malloc
for
(
auto
i
=
0
;
i
<
n
;
++
i
)
{
for
(
auto
j
=
0
;
j
<
d
;
++
j
)
{
v
[
i
*
d
+
j
]
=
float
(
base
+
i
);
...
...
cpp/src/core/test/test_ivf.cpp
浏览文件 @
d1251fb0
...
...
@@ -694,4 +694,4 @@ TEST_F(GPURESTEST, TrainAndSearch) {
// TODO(l
in
xj): Add exception test
// TODO(lxj): Add exception test
cpp/src/core/test/test_kdt.cpp
浏览文件 @
d1251fb0
...
...
@@ -85,7 +85,7 @@ void PrintResult(const DatasetPtr &result,
std
::
cout
<<
"dist
\n
"
<<
ss_dist
.
str
()
<<
std
::
endl
;
}
// TODO(l
in
xj): add test about count() and dimension()
// TODO(lxj): add test about count() and dimension()
TEST_F
(
KDTTest
,
kdt_basic
)
{
assert
(
!
xb
.
empty
());
...
...
cpp/src/core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp
浏览文件 @
d1251fb0
...
...
@@ -179,13 +179,13 @@ FileMetadataSet::SaveMetadata(const std::string& p_metaFile, const std::string&
ErrorCode
FileMetadataSet
::
SaveMetadataToMemory
(
void
**
pGraphMemFile
,
int64_t
&
len
)
{
// TODO: serialize file to mem?
// TODO
(lxj)
: serialize file to mem?
return
ErrorCode
::
Fail
;
}
ErrorCode
FileMetadataSet
::
LoadMetadataFromMemory
(
void
*
pGraphMemFile
)
{
// TODO: not support yet
// TODO
(lxj)
: not support yet
return
ErrorCode
::
Fail
;
}
...
...
cpp/src/db/DBImpl.cpp
浏览文件 @
d1251fb0
...
...
@@ -242,7 +242,7 @@ DBImpl::GetTableRowCount(const std::string& table_id, uint64_t& row_count) {
}
Status
DBImpl
::
InsertVectors
(
const
std
::
string
&
table_id
_
,
uint64_t
n
,
const
float
*
vectors
,
IDNumbers
&
vector_ids_
)
{
DBImpl
::
InsertVectors
(
const
std
::
string
&
table_id
,
uint64_t
n
,
const
float
*
vectors
,
IDNumbers
&
vector_ids
)
{
// ENGINE_LOG_DEBUG << "Insert " << n << " vectors to cache";
if
(
shutting_down_
.
load
(
std
::
memory_order_acquire
))
{
return
Status
(
DB_ERROR
,
"Milsvus server is shutdown!"
);
...
...
@@ -250,7 +250,7 @@ DBImpl::InsertVectors(const std::string& table_id_, uint64_t n, const float* vec
Status
status
;
zilliz
::
milvus
::
server
::
CollectInsertMetrics
metrics
(
n
,
status
);
status
=
mem_mgr_
->
InsertVectors
(
table_id
_
,
n
,
vectors
,
vector_ids_
);
status
=
mem_mgr_
->
InsertVectors
(
table_id
,
n
,
vectors
,
vector_ids
);
// std::chrono::microseconds time_span =
// std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time);
// double average_time = double(time_span.count()) / n;
...
...
@@ -295,15 +295,17 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) {
// for IDMAP type, only wait all NEW file converted to RAW file
// for other type, wait NEW/RAW/NEW_MERGE/NEW_INDEX/TO_INDEX files converted to INDEX files
std
::
vector
<
int
>
file_types
;
if
(
index
.
engine_type_
==
(
int
)
EngineType
::
FAISS_IDMAP
)
{
if
(
index
.
engine_type_
==
static_cast
<
int32_t
>
(
EngineType
::
FAISS_IDMAP
)
)
{
file_types
=
{
(
int
)
meta
::
TableFileSchema
::
NEW
,
(
int
)
meta
::
TableFileSchema
::
NEW_MERGE
,
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW_MERGE
)
,
};
}
else
{
file_types
=
{
(
int
)
meta
::
TableFileSchema
::
RAW
,
(
int
)
meta
::
TableFileSchema
::
NEW
,
(
int
)
meta
::
TableFileSchema
::
NEW_MERGE
,
(
int
)
meta
::
TableFileSchema
::
NEW_INDEX
,
(
int
)
meta
::
TableFileSchema
::
TO_INDEX
,
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
RAW
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW_MERGE
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW_INDEX
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
TO_INDEX
),
};
}
...
...
cpp/src/db/Utils.cpp
浏览文件 @
d1251fb0
...
...
@@ -228,7 +228,7 @@ ParseMetaUri(const std::string& uri, MetaUriInfo& info) {
info
.
port_
=
pieces_match
[
5
].
str
();
info
.
db_name_
=
pieces_match
[
6
].
str
();
// TODO: verify host, port...
// TODO
(myh)
: verify host, port...
}
else
{
return
Status
(
DB_INVALID_META_URI
,
"Invalid meta uri: "
+
uri
);
}
...
...
cpp/src/db/engine/ExecutionEngineImpl.cpp
浏览文件 @
d1251fb0
...
...
@@ -342,8 +342,9 @@ Status
ExecutionEngineImpl
::
Init
()
{
server
::
Config
&
config
=
server
::
Config
::
GetInstance
();
Status
s
=
config
.
GetDBConfigBuildIndexGPU
(
gpu_num_
);
if
(
!
s
.
ok
())
if
(
!
s
.
ok
())
{
return
s
;
}
return
Status
::
OK
();
}
...
...
cpp/src/db/meta/MySQLConnectionPool.cpp
浏览文件 @
d1251fb0
...
...
@@ -68,7 +68,7 @@ MySQLConnectionPool::create() {
try
{
// Create connection using the parameters we were passed upon
// creation.
mysqlpp
::
Connection
*
conn
=
new
mysqlpp
::
Connection
();
auto
conn
=
new
mysqlpp
::
Connection
();
conn
->
set_option
(
new
mysqlpp
::
ReconnectOption
(
true
));
conn
->
connect
(
db_
.
empty
()
?
0
:
db_
.
c_str
(),
server_
.
empty
()
?
0
:
server_
.
c_str
(),
user_
.
empty
()
?
0
:
user_
.
c_str
(),
password_
.
empty
()
?
0
:
password_
.
c_str
(),
port_
);
...
...
cpp/src/db/meta/MySQLMetaImpl.cpp
浏览文件 @
d1251fb0
...
...
@@ -50,11 +50,11 @@ HandleException(const std::string& desc, const char* what = nullptr) {
if
(
what
==
nullptr
)
{
ENGINE_LOG_ERROR
<<
desc
;
return
Status
(
DB_META_TRANSACTION_FAILED
,
desc
);
}
else
{
std
::
string
msg
=
desc
+
":"
+
what
;
ENGINE_LOG_ERROR
<<
msg
;
return
Status
(
DB_META_TRANSACTION_FAILED
,
msg
);
}
std
::
string
msg
=
desc
+
":"
+
what
;
ENGINE_LOG_ERROR
<<
msg
;
return
Status
(
DB_META_TRANSACTION_FAILED
,
msg
);
}
class
MetaField
{
...
...
@@ -324,7 +324,7 @@ MySQLMetaImpl::Initialize() {
return
Status
::
OK
();
}
//
PXU TODO: Temp solution. Will fix later
//
TODO(myh): Delete single vecotor by id
Status
MySQLMetaImpl
::
DropPartitionsByDates
(
const
std
::
string
&
table_id
,
const
DatesT
&
dates
)
{
if
(
dates
.
empty
())
{
...
...
@@ -1379,7 +1379,7 @@ MySQLMetaImpl::GetTableFiles(const std::string& table_id, const std::vector<size
}
}
//
PXU TODO: Support Swap
//
TODO(myh): Support swap to cloud storage
Status
MySQLMetaImpl
::
Archive
()
{
auto
&
criterias
=
options_
.
archive_conf_
.
GetCriterias
();
...
...
@@ -1984,9 +1984,8 @@ MySQLMetaImpl::DropAll() {
if
(
dropTableQuery
.
exec
())
{
return
Status
::
OK
();
}
else
{
return
HandleException
(
"QUERY ERROR WHEN DROPPING ALL"
,
dropTableQuery
.
error
());
}
return
HandleException
(
"QUERY ERROR WHEN DROPPING ALL"
,
dropTableQuery
.
error
());
}
catch
(
std
::
exception
&
e
)
{
return
HandleException
(
"GENERAL ERROR WHEN DROPPING ALL"
,
e
.
what
());
}
...
...
cpp/src/db/meta/SqliteMetaImpl.cpp
浏览文件 @
d1251fb0
...
...
@@ -155,7 +155,7 @@ SqliteMetaImpl::Initialize() {
return
Status
::
OK
();
}
//
PXU TODO: Temp solution. Will fix later
//
TODO(myh): Delete single vecotor by id
Status
SqliteMetaImpl
::
DropPartitionsByDates
(
const
std
::
string
&
table_id
,
const
DatesT
&
dates
)
{
...
...
@@ -885,7 +885,7 @@ SqliteMetaImpl::GetTableFiles(const std::string &table_id,
}
}
//
PXU TODO: Support Swap
//
TODO(myh): Support swap to cloud storage
Status
SqliteMetaImpl
::
Archive
()
{
auto
&
criterias
=
options_
.
archive_conf_
.
GetCriterias
();
...
...
cpp/src/metrics/SystemInfo.cpp
浏览文件 @
d1251fb0
...
...
@@ -31,8 +31,9 @@ namespace server {
void
SystemInfo
::
Init
()
{
if
(
initialized_
)
if
(
initialized_
)
{
return
;
}
initialized_
=
true
;
...
...
@@ -45,9 +46,10 @@ SystemInfo::Init() {
last_user_cpu_
=
time_sample
.
tms_utime
;
file
=
fopen
(
"/proc/cpuinfo"
,
"r"
);
num_processors_
=
0
;
while
(
fgets
(
line
,
128
,
file
)
!=
NULL
)
{
if
(
strncmp
(
line
,
"processor"
,
9
)
==
0
)
while
(
fgets
(
line
,
128
,
file
)
!=
nullptr
)
{
if
(
strncmp
(
line
,
"processor"
,
9
)
==
0
)
{
num_processors_
++
;
}
if
(
strncmp
(
line
,
"physical"
,
8
)
==
0
)
{
num_physical_processors_
=
ParseLine
(
line
);
}
...
...
@@ -80,7 +82,9 @@ SystemInfo::ParseLine(char* line) {
// This assumes that a digit will be found and the line ends in " Kb".
int
i
=
strlen
(
line
);
const
char
*
p
=
line
;
while
(
*
p
<
'0'
||
*
p
>
'9'
)
p
++
;
while
(
*
p
<
'0'
||
*
p
>
'9'
)
{
p
++
;
}
line
[
i
-
3
]
=
'\0'
;
i
=
atoi
(
p
);
return
static_cast
<
uint64_t
>
(
i
);
...
...
@@ -105,7 +109,7 @@ SystemInfo::GetProcessUsedMemory() {
constexpr
uint64_t
KB_SIZE
=
1024
;
char
line
[
line_length
];
while
(
fgets
(
line
,
line_length
,
file
)
!=
NULL
)
{
while
(
fgets
(
line
,
line_length
,
file
)
!=
nullptr
)
{
if
(
strncmp
(
line
,
"VmRSS:"
,
6
)
==
0
)
{
result
=
ParseLine
(
line
);
break
;
...
...
@@ -118,9 +122,12 @@ SystemInfo::GetProcessUsedMemory() {
double
SystemInfo
::
MemoryPercent
()
{
if
(
!
initialized_
)
if
(
!
initialized_
)
{
Init
();
return
(
double
)(
GetProcessUsedMemory
()
*
100
)
/
(
double
)
total_ram_
;
}
double
mem_used
=
static_cast
<
double
>
(
GetProcessUsedMemory
()
*
100
);
return
mem_used
/
static_cast
<
double
>
(
total_ram_
);
}
std
::
vector
<
double
>
...
...
@@ -174,8 +181,9 @@ SystemInfo::getTotalCpuTime(std::vector<uint64_t>& work_time_array) {
double
SystemInfo
::
CPUPercent
()
{
if
(
!
initialized_
)
if
(
!
initialized_
)
{
Init
();
}
struct
tms
time_sample
;
clock_t
now
;
double
percent
;
...
...
@@ -233,7 +241,7 @@ SystemInfo::CPUTemperature() {
for
(
int
i
=
0
;
i
<=
num_physical_processors_
;
++
i
)
{
std
::
string
path
=
"/sys/class/thermal/thermal_zone"
+
std
::
to_string
(
i
)
+
"/temp"
;
FILE
*
file
=
fopen
(
path
.
data
(),
"r"
);
if
(
file
==
NULL
)
{
if
(
file
==
nullptr
)
{
perror
(
"Could not open thermal file"
);
return
result
;
}
...
...
@@ -269,7 +277,7 @@ SystemInfo::Octets() {
std
::
ifstream
file
(
filename
);
std
::
string
lastline
=
""
;
std
::
string
line
=
""
;
while
(
fil
e
)
{
while
(
tru
e
)
{
getline
(
file
,
line
);
if
(
file
.
fail
())
{
break
;
...
...
cpp/src/scheduler/ResourceMgr.cpp
浏览文件 @
d1251fb0
...
...
@@ -75,7 +75,7 @@ ResourceMgr::Connect(const std::string& name1, const std::string& name2, Connect
auto
res2
=
GetResource
(
name2
);
if
(
res1
&&
res2
)
{
res1
->
AddNeighbour
(
std
::
static_pointer_cast
<
Node
>
(
res2
),
connection
);
// TODO: enable when task balance supported
// TODO
(wxy)
: enable when task balance supported
// res2->AddNeighbour(std::static_pointer_cast<Node>(res1), connection);
return
true
;
}
...
...
cpp/src/scheduler/ResourceMgr.h
浏览文件 @
d1251fb0
...
...
@@ -65,7 +65,7 @@ class ResourceMgr {
return
disk_resources_
;
}
// TODO: why return shared pointer
// TODO
(wxy)
: why return shared pointer
inline
std
::
vector
<
ResourcePtr
>
GetAllResources
()
{
return
resources_
;
...
...
@@ -90,7 +90,7 @@ class ResourceMgr {
GetNumGpuResource
()
const
;
public:
// TODO: add stats interface(low)
// TODO
(wxy)
: add stats interface(low)
public:
/******** Utility Functions ********/
...
...
cpp/src/scheduler/SchedInst.cpp
浏览文件 @
d1251fb0
...
...
@@ -147,7 +147,7 @@ load_advance_config() {
// }
// } catch (const char *msg) {
// SERVER_LOG_ERROR << msg;
// // TODO: throw exception instead
// // TODO
(wxy)
: throw exception instead
// exit(-1);
//// throw std::exception();
// }
...
...
cpp/src/scheduler/Scheduler.cpp
浏览文件 @
d1251fb0
...
...
@@ -93,7 +93,7 @@ Scheduler::Process(const EventPtr& event) {
process_event
(
event
);
}
// TODO: refactor the function
// TODO
(wxy)
: refactor the function
void
Scheduler
::
OnLoadCompleted
(
const
EventPtr
&
event
)
{
auto
load_completed_event
=
std
::
static_pointer_cast
<
LoadCompletedEvent
>
(
event
);
...
...
cpp/src/scheduler/Scheduler.h
浏览文件 @
d1251fb0
...
...
@@ -32,7 +32,7 @@ namespace zilliz {
namespace
milvus
{
namespace
scheduler
{
// TODO: refactor, not friendly to unittest, logical in framework code
// TODO
(wxy)
: refactor, not friendly to unittest, logical in framework code
class
Scheduler
{
public:
explicit
Scheduler
(
ResourceMgrWPtr
res_mgr
);
...
...
cpp/src/scheduler/TaskCreator.cpp
浏览文件 @
d1251fb0
...
...
@@ -33,7 +33,7 @@ TaskCreator::Create(const JobPtr& job) {
return
Create
(
std
::
static_pointer_cast
<
DeleteJob
>
(
job
));
}
default:
{
// TODO: error
// TODO
(wxy)
: error
return
std
::
vector
<
TaskPtr
>
();
}
}
...
...
cpp/src/scheduler/TaskTable.h
浏览文件 @
d1251fb0
...
...
@@ -126,7 +126,7 @@ class TaskTable {
Get
(
uint64_t
index
);
/*
* TODO(wxy
u
): BIG GC
* TODO(wxy): BIG GC
* Remove sequence task which is DONE or MOVED from front;
* Called by ?
*/
...
...
@@ -174,7 +174,7 @@ class TaskTable {
public:
/******** Action ********/
// TODO: bool to Status
// TODO
(wxy)
: bool to Status
/*
* Load a task;
* Set state loading;
...
...
cpp/src/scheduler/action/PushTaskToNeighbour.cpp
浏览文件 @
d1251fb0
...
...
@@ -83,7 +83,7 @@ Action::PushTaskToNeighbourRandomly(const TaskPtr& task, const ResourcePtr& self
}
}
else
{
// TODO: process
// TODO
(wxy)
: process
}
}
...
...
cpp/src/scheduler/resource/Node.h
浏览文件 @
d1251fb0
...
...
@@ -41,7 +41,7 @@ struct Neighbour {
Connection
connection
;
};
// TODO(l
in
xj): return type void -> Status
// TODO(lxj): return type void -> Status
class
Node
{
public:
Node
();
...
...
cpp/src/scheduler/resource/Resource.h
浏览文件 @
d1251fb0
...
...
@@ -39,7 +39,7 @@ namespace zilliz {
namespace
milvus
{
namespace
scheduler
{
// TODO(wxy
u
): Storage, Route, Executor
// TODO(wxy): Storage, Route, Executor
enum
class
ResourceType
{
DISK
=
0
,
CPU
=
1
,
...
...
@@ -115,11 +115,11 @@ class Resource : public Node, public std::enable_shared_from_this<Resource> {
return
enable_executor_
;
}
// TODO: const
// TODO
(wxy)
: const
uint64_t
NumOfTaskToExec
();
// TODO: need double ?
// TODO
(wxy)
: need double ?
inline
uint64_t
TaskAvgCost
()
const
{
return
total_cost_
/
total_task_
;
...
...
cpp/src/scheduler/task/SearchTask.h
浏览文件 @
d1251fb0
...
...
@@ -27,7 +27,7 @@ namespace zilliz {
namespace
milvus
{
namespace
scheduler
{
// TODO: rewrite
// TODO
(wxy)
: rewrite
class
XSearchTask
:
public
Task
{
public:
explicit
XSearchTask
(
TableFileSchemaPtr
file
);
...
...
cpp/src/sdk/examples/grpcsimple/main.cpp
浏览文件 @
d1251fb0
...
...
@@ -30,10 +30,10 @@ main(int argc, char* argv[]) {
printf
(
"Client start...
\n
"
);
std
::
string
app_name
=
basename
(
argv
[
0
]);
static
struct
option
long_options
[]
=
{{
"server"
,
optional_argument
,
0
,
's'
},
{
"port"
,
optional_argument
,
0
,
'p'
},
{
"help"
,
no_argument
,
0
,
'h'
},
{
NULL
,
0
,
0
,
0
}};
static
struct
option
long_options
[]
=
{{
"server"
,
optional_argument
,
nullptr
,
's'
},
{
"port"
,
optional_argument
,
nullptr
,
'p'
},
{
"help"
,
no_argument
,
nullptr
,
'h'
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
std
::
string
address
=
"127.0.0.1"
,
port
=
"19530"
;
...
...
cpp/src/sdk/grpc/ClientProxy.cpp
浏览文件 @
d1251fb0
...
...
@@ -29,10 +29,7 @@ namespace milvus {
bool
UriCheck
(
const
std
::
string
&
uri
)
{
size_t
index
=
uri
.
find_first_of
(
':'
,
0
);
if
(
index
==
std
::
string
::
npos
)
{
return
false
;
}
return
true
;
return
(
index
!=
std
::
string
::
npos
);
}
Status
...
...
@@ -99,7 +96,7 @@ ClientProxy::CreateTable(const TableSchema& param) {
schema
.
set_table_name
(
param
.
table_name
);
schema
.
set_dimension
(
param
.
dimension
);
schema
.
set_index_file_size
(
param
.
index_file_size
);
schema
.
set_metric_type
(
(
int32_t
)
param
.
metric_type
);
schema
.
set_metric_type
(
static_cast
<
int32_t
>
(
param
.
metric_type
)
);
return
client_ptr_
->
CreateTable
(
schema
);
}
catch
(
std
::
exception
&
ex
)
{
...
...
@@ -130,7 +127,6 @@ ClientProxy::DropTable(const std::string& table_name) {
Status
ClientProxy
::
CreateIndex
(
const
IndexParam
&
index_param
)
{
try
{
// TODO: add index params
::
milvus
::
grpc
::
IndexParam
grpc_index_param
;
grpc_index_param
.
set_table_name
(
index_param
.
table_name
);
grpc_index_param
.
mutable_index
()
->
set_index_type
(
static_cast
<
int32_t
>
(
index_param
.
index_type
));
...
...
@@ -274,7 +270,7 @@ ClientProxy::DescribeTable(const std::string& table_name, TableSchema& table_sch
table_schema
.
table_name
=
grpc_schema
.
table_name
();
table_schema
.
dimension
=
grpc_schema
.
dimension
();
table_schema
.
index_file_size
=
grpc_schema
.
index_file_size
();
table_schema
.
metric_type
=
(
MetricType
)
grpc_schema
.
metric_type
(
);
table_schema
.
metric_type
=
static_cast
<
MetricType
>
(
grpc_schema
.
metric_type
()
);
return
status
;
}
catch
(
std
::
exception
&
ex
)
{
...
...
@@ -384,7 +380,7 @@ ClientProxy::DescribeIndex(const std::string& table_name, IndexParam& index_para
grpc_table_name
.
set_table_name
(
table_name
);
::
milvus
::
grpc
::
IndexParam
grpc_index_param
;
Status
status
=
client_ptr_
->
DescribeIndex
(
grpc_table_name
,
grpc_index_param
);
index_param
.
index_type
=
(
IndexType
)
(
grpc_index_param
.
mutable_index
()
->
index_type
());
index_param
.
index_type
=
static_cast
<
IndexType
>
(
grpc_index_param
.
mutable_index
()
->
index_type
());
index_param
.
nlist
=
grpc_index_param
.
mutable_index
()
->
nlist
();
return
status
;
...
...
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
浏览文件 @
d1251fb0
...
...
@@ -468,7 +468,7 @@ InsertTask::OnExecute() {
// step 4: prepare float data
std
::
vector
<
float
>
vec_f
(
insert_param_
->
row_record_array_size
()
*
table_info
.
dimension_
,
0
);
// TODO
: change to one dimension array in protobuf
or use multiple-thread to copy the data
// TODO
(yk): change to one dimension array
or use multiple-thread to copy the data
for
(
size_t
i
=
0
;
i
<
insert_param_
->
row_record_array_size
();
i
++
)
{
if
(
insert_param_
->
row_record_array
(
i
).
vector_data
().
empty
())
{
return
Status
(
SERVER_INVALID_ROWRECORD_ARRAY
,
"Row record array data is empty"
);
...
...
cpp/unittest/db/db_tests.cpp
浏览文件 @
d1251fb0
...
...
@@ -291,7 +291,7 @@ TEST_F(DBTest, SEARCH_TEST) {
ASSERT_TRUE
(
stat
.
ok
());
}
// TODO(l
in
xj): add groundTruth assert
// TODO(lxj): add groundTruth assert
}
TEST_F
(
DBTest
,
PRELOADTABLE_TEST
)
{
...
...
cpp/unittest/server/cache_test.cpp
浏览文件 @
d1251fb0
...
...
@@ -193,7 +193,7 @@ TEST(CacheTest, GPU_CACHE_TEST) {
ASSERT_EQ
(
gpu_mgr
->
ItemCount
(),
0
);
for
(
auto
i
=
0
;
i
<
3
;
i
++
)
{
// TODO: use gpu index to mock
// TODO
(myh)
: use gpu index to mock
//each vector is 1k byte, total size less than 2G
ms
::
engine
::
VecIndexPtr
mock_index
=
std
::
make_shared
<
MockVecIndex
>
(
256
,
2000000
);
ms
::
cache
::
DataObjPtr
data_obj
=
std
::
make_shared
<
ms
::
cache
::
DataObj
>
(
mock_index
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录