Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
b532a69c
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,发现更多精彩内容 >>
未验证
提交
b532a69c
编写于
5月 20, 2020
作者:
C
Cai Yudong
提交者:
GitHub
5月 19, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean compile warning (#2380)
Signed-off-by:
N
yudong.cai
<
yudong.cai@zilliz.com
>
上级
b616dcb7
变更
40
隐藏空白更改
内联
并排
Showing
40 changed file
with
88 addition
and
86 deletion
+88
-86
core/src/codecs/default/DefaultVectorIndexFormat.cpp
core/src/codecs/default/DefaultVectorIndexFormat.cpp
+1
-1
core/src/config/Config.cpp
core/src/config/Config.cpp
+9
-9
core/src/db/DBImpl.cpp
core/src/db/DBImpl.cpp
+1
-1
core/src/db/engine/ExecutionEngineImpl.cpp
core/src/db/engine/ExecutionEngineImpl.cpp
+1
-1
core/src/db/merge/MergeAdaptiveStrategy.cpp
core/src/db/merge/MergeAdaptiveStrategy.cpp
+2
-2
core/src/db/merge/MergeTask.cpp
core/src/db/merge/MergeTask.cpp
+2
-2
core/src/db/meta/MySQLMetaImpl.cpp
core/src/db/meta/MySQLMetaImpl.cpp
+2
-1
core/src/db/meta/SqliteMetaImpl.cpp
core/src/db/meta/SqliteMetaImpl.cpp
+1
-1
core/src/db/wal/WalBuffer.cpp
core/src/db/wal/WalBuffer.cpp
+1
-1
core/src/metrics/SystemInfo.cpp
core/src/metrics/SystemInfo.cpp
+4
-6
core/src/metrics/prometheus/PrometheusMetrics.cpp
core/src/metrics/prometheus/PrometheusMetrics.cpp
+3
-3
core/src/query/BinaryQuery.cpp
core/src/query/BinaryQuery.cpp
+6
-4
core/src/scheduler/job/SearchJob.cpp
core/src/scheduler/job/SearchJob.cpp
+1
-1
core/src/scheduler/resource/Resource.cpp
core/src/scheduler/resource/Resource.cpp
+1
-1
core/src/scheduler/selector/FaissFlatPass.cpp
core/src/scheduler/selector/FaissFlatPass.cpp
+1
-1
core/src/scheduler/selector/FaissIVFFlatPass.cpp
core/src/scheduler/selector/FaissIVFFlatPass.cpp
+1
-1
core/src/scheduler/selector/FaissIVFPQPass.cpp
core/src/scheduler/selector/FaissIVFPQPass.cpp
+1
-1
core/src/scheduler/selector/FaissIVFSQ8HPass.cpp
core/src/scheduler/selector/FaissIVFSQ8HPass.cpp
+1
-1
core/src/scheduler/selector/FaissIVFSQ8Pass.cpp
core/src/scheduler/selector/FaissIVFSQ8Pass.cpp
+1
-1
core/src/scheduler/task/BuildIndexTask.cpp
core/src/scheduler/task/BuildIndexTask.cpp
+0
-1
core/src/scheduler/task/SearchTask.cpp
core/src/scheduler/task/SearchTask.cpp
+4
-4
core/src/segment/Attr.cpp
core/src/segment/Attr.cpp
+1
-1
core/src/segment/SegmentWriter.cpp
core/src/segment/SegmentWriter.cpp
+1
-1
core/src/segment/Vectors.cpp
core/src/segment/Vectors.cpp
+1
-1
core/src/server/delivery/RequestHandler.cpp
core/src/server/delivery/RequestHandler.cpp
+1
-0
core/src/server/delivery/hybrid_request/InsertEntityRequest.cpp
...rc/server/delivery/hybrid_request/InsertEntityRequest.cpp
+1
-1
core/src/server/delivery/request/InsertRequest.cpp
core/src/server/delivery/request/InsertRequest.cpp
+1
-1
core/src/server/grpc_impl/GrpcRequestHandler.cpp
core/src/server/grpc_impl/GrpcRequestHandler.cpp
+9
-6
core/src/server/grpc_impl/GrpcRequestHandler.h
core/src/server/grpc_impl/GrpcRequestHandler.h
+2
-2
core/src/server/init/CpuChecker.cpp
core/src/server/init/CpuChecker.cpp
+0
-2
core/src/server/web_impl/handler/WebRequestHandler.cpp
core/src/server/web_impl/handler/WebRequestHandler.cpp
+5
-4
core/src/tracing/TracerUtil.cpp
core/src/tracing/TracerUtil.cpp
+4
-0
core/src/tracing/TracerUtil.h
core/src/tracing/TracerUtil.h
+3
-3
core/src/utils/CommonUtil.cpp
core/src/utils/CommonUtil.cpp
+3
-3
core/src/utils/CommonUtil.h
core/src/utils/CommonUtil.h
+1
-1
core/src/utils/LogUtil.cpp
core/src/utils/LogUtil.cpp
+6
-7
core/src/utils/ValidationUtil.cpp
core/src/utils/ValidationUtil.cpp
+2
-2
core/src/utils/ValidationUtil.h
core/src/utils/ValidationUtil.h
+1
-1
core/unittest/server/test_config.cpp
core/unittest/server/test_config.cpp
+0
-4
core/unittest/server/test_util.cpp
core/unittest/server/test_util.cpp
+2
-2
未找到文件。
core/src/codecs/default/DefaultVectorIndexFormat.cpp
浏览文件 @
b532a69c
...
...
@@ -47,7 +47,7 @@ DefaultVectorIndexFormat::read_internal(const storage::FSHandlerPtr& fs_ptr, con
return
nullptr
;
}
size
_t
rp
=
0
;
int64
_t
rp
=
0
;
fs_ptr
->
reader_ptr_
->
seekg
(
0
);
int32_t
current_type
=
0
;
...
...
core/src/config/Config.cpp
浏览文件 @
b532a69c
...
...
@@ -398,19 +398,19 @@ Config::ValidateConfig() {
STATUS_CHECK
(
GetLogsTraceEnable
(
trace_enable
));
bool
debug_enable
;
STATUS_CHECK
(
GetLogsDebugEnable
(
trace
_enable
));
STATUS_CHECK
(
GetLogsDebugEnable
(
debug
_enable
));
bool
info_enable
;
STATUS_CHECK
(
GetLogsInfoEnable
(
trace
_enable
));
STATUS_CHECK
(
GetLogsInfoEnable
(
info
_enable
));
bool
warning_enable
;
STATUS_CHECK
(
GetLogsWarningEnable
(
trace
_enable
));
STATUS_CHECK
(
GetLogsWarningEnable
(
warning
_enable
));
bool
error_enable
;
STATUS_CHECK
(
GetLogsErrorEnable
(
trace
_enable
));
STATUS_CHECK
(
GetLogsErrorEnable
(
error
_enable
));
bool
fatal_enable
;
STATUS_CHECK
(
GetLogsFatalEnable
(
trace
_enable
));
STATUS_CHECK
(
GetLogsFatalEnable
(
fatal
_enable
));
std
::
string
logs_path
;
STATUS_CHECK
(
GetLogsPath
(
logs_path
));
...
...
@@ -1252,9 +1252,9 @@ Config::CheckCacheConfigCpuCacheCapacity(const std::string& value) {
return
Status
(
SERVER_INVALID_ARGUMENT
,
msg
);
}
u
int64_t
total_mem
=
0
,
free_mem
=
0
;
int64_t
total_mem
=
0
,
free_mem
=
0
;
CommonUtil
::
GetSystemMemInfo
(
total_mem
,
free_mem
);
if
(
static_cast
<
uint64_t
>
(
cpu_cache_capacity
)
>=
total_mem
)
{
if
(
cpu_cache_capacity
>=
total_mem
)
{
std
::
string
msg
=
"Invalid cpu cache capacity: "
+
value
+
". Possible reason: cache_config.cpu_cache_capacity exceeds system memory."
;
return
Status
(
SERVER_INVALID_ARGUMENT
,
msg
);
...
...
@@ -1314,7 +1314,7 @@ Config::CheckCacheConfigInsertBufferSize(const std::string& value) {
std
::
string
str
=
GetConfigStr
(
CONFIG_CACHE
,
CONFIG_CACHE_CPU_CACHE_CAPACITY
,
"0"
);
int64_t
cache_size
=
std
::
stoll
(
str
)
*
GB
;
u
int64_t
total_mem
=
0
,
free_mem
=
0
;
int64_t
total_mem
=
0
,
free_mem
=
0
;
CommonUtil
::
GetSystemMemInfo
(
total_mem
,
free_mem
);
if
(
buffer_size
+
cache_size
>=
total_mem
)
{
std
::
string
msg
=
"Invalid insert buffer size: "
+
value
+
...
...
@@ -1423,7 +1423,7 @@ Config::CheckGpuResourceConfigCacheCapacity(const std::string& value) {
STATUS_CHECK
(
GetGpuResourceConfigBuildIndexResources
(
gpu_ids
));
for
(
int64_t
gpu_id
:
gpu_ids
)
{
size
_t
gpu_memory
;
int64
_t
gpu_memory
;
if
(
!
ValidationUtil
::
GetGpuMemory
(
gpu_id
,
gpu_memory
).
ok
())
{
std
::
string
msg
=
"Fail to get GPU memory for GPU device: "
+
std
::
to_string
(
gpu_id
);
return
Status
(
SERVER_UNEXPECTED_ERROR
,
msg
);
...
...
core/src/db/DBImpl.cpp
浏览文件 @
b532a69c
...
...
@@ -2011,7 +2011,7 @@ DBImpl::MergeHybridFiles(const std::string& collection_id, meta::FilesHolder& fi
// if index type isn't IDMAP, set file type to TO_INDEX if file size exceed index_file_size
// else set file type to RAW, no need to build index
if
(
!
utils
::
IsRawIndexType
(
table_file
.
engine_type_
))
{
table_file
.
file_type_
=
(
segment_writer_ptr
->
Size
()
>=
table_file
.
index_file_size_
)
table_file
.
file_type_
=
(
segment_writer_ptr
->
Size
()
>=
(
size_t
)(
table_file
.
index_file_size_
)
)
?
meta
::
SegmentSchema
::
TO_INDEX
:
meta
::
SegmentSchema
::
RAW
;
}
else
{
...
...
core/src/db/engine/ExecutionEngineImpl.cpp
浏览文件 @
b532a69c
...
...
@@ -1062,7 +1062,7 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
faiss
::
ConcurrentBitsetPtr
list
;
list
=
index_
->
GetBlacklist
();
// Do OR
for
(
u
int64_t
i
=
0
;
i
<
vector_count_
;
++
i
)
{
for
(
int64_t
i
=
0
;
i
<
vector_count_
;
++
i
)
{
if
(
list
->
test
(
i
)
||
bitset
->
test
(
i
))
{
bitset
->
set
(
i
);
}
...
...
core/src/db/merge/MergeAdaptiveStrategy.cpp
浏览文件 @
b532a69c
...
...
@@ -32,7 +32,7 @@ MergeAdaptiveStrategy::RegroupFiles(meta::FilesHolder& files_holder, MergeFilesG
meta
::
SegmentsSchema
&
files
=
files_holder
.
HoldFiles
();
for
(
meta
::
SegmentsSchema
::
reverse_iterator
iter
=
files
.
rbegin
();
iter
!=
files
.
rend
();
++
iter
)
{
meta
::
SegmentSchema
&
file
=
*
iter
;
if
(
file
.
index_file_size_
>
0
&&
file
.
file_size_
>
file
.
index_file_size_
)
{
if
(
file
.
index_file_size_
>
0
&&
(
int64_t
)
file
.
file_size_
>
file
.
index_file_size_
)
{
// file that no need to merge
continue
;
}
...
...
@@ -60,7 +60,7 @@ MergeAdaptiveStrategy::RegroupFiles(meta::FilesHolder& files_holder, MergeFilesG
int64_t
sum_size
=
0
;
for
(
auto
iter
=
sort_files
.
begin
();
iter
!=
sort_files
.
end
();)
{
meta
::
SegmentSchema
&
file
=
*
iter
;
if
(
sum_size
+
file
.
file_size_
<=
index_file_size
)
{
if
(
sum_size
+
(
int64_t
)(
file
.
file_size_
)
<=
index_file_size
)
{
temp_group
.
push_back
(
file
);
sum_size
+=
file
.
file_size_
;
iter
=
sort_files
.
erase
(
iter
);
...
...
core/src/db/merge/MergeTask.cpp
浏览文件 @
b532a69c
...
...
@@ -71,7 +71,7 @@ MergeTask::Execute() {
auto
file_schema
=
file
;
file_schema
.
file_type_
=
meta
::
SegmentSchema
::
TO_DELETE
;
updated
.
push_back
(
file_schema
);
auto
size
=
segment_writer_ptr
->
Size
();
int64_t
size
=
segment_writer_ptr
->
Size
();
if
(
size
>=
file_schema
.
index_file_size_
)
{
break
;
}
...
...
@@ -104,7 +104,7 @@ MergeTask::Execute() {
// if index type isn't IDMAP, set file type to TO_INDEX if file size exceed index_file_size
// else set file type to RAW, no need to build index
if
(
!
utils
::
IsRawIndexType
(
collection_file
.
engine_type_
))
{
collection_file
.
file_type_
=
(
segment_writer_ptr
->
Size
()
>=
collection_file
.
index_file_size_
)
collection_file
.
file_type_
=
(
segment_writer_ptr
->
Size
()
>=
(
size_t
)(
collection_file
.
index_file_size_
)
)
?
meta
::
SegmentSchema
::
TO_INDEX
:
meta
::
SegmentSchema
::
RAW
;
}
else
{
...
...
core/src/db/meta/MySQLMetaImpl.cpp
浏览文件 @
b532a69c
...
...
@@ -1845,7 +1845,7 @@ MySQLMetaImpl::FilesToMerge(const std::string& collection_id, FilesHolder& files
for
(
auto
&
resRow
:
res
)
{
SegmentSchema
collection_file
;
collection_file
.
file_size_
=
resRow
[
"file_size"
];
if
(
collection_file
.
file_size_
>=
collection_schema
.
index_file_size_
)
{
if
(
(
int64_t
)(
collection_file
.
file_size_
)
>=
collection_schema
.
index_file_size_
)
{
continue
;
// skip large file
}
...
...
@@ -3001,6 +3001,7 @@ MySQLMetaImpl::DescribeHybridCollection(CollectionSchema& collection_schema, hyb
Status
MySQLMetaImpl
::
CreateHybridCollectionFile
(
milvus
::
engine
::
meta
::
SegmentSchema
&
file_schema
)
{
return
Status
::
OK
();
}
}
// namespace meta
...
...
core/src/db/meta/SqliteMetaImpl.cpp
浏览文件 @
b532a69c
...
...
@@ -1246,7 +1246,7 @@ SqliteMetaImpl::FilesToMerge(const std::string& collection_id, FilesHolder& file
for
(
auto
&
file
:
selected
)
{
SegmentSchema
collection_file
;
collection_file
.
file_size_
=
std
::
get
<
5
>
(
file
);
if
(
collection_file
.
file_size_
>=
collection_schema
.
index_file_size_
)
{
if
(
collection_file
.
file_size_
>=
(
size_t
)(
collection_schema
.
index_file_size_
)
)
{
continue
;
// skip large file
}
...
...
core/src/db/wal/WalBuffer.cpp
浏览文件 @
b532a69c
...
...
@@ -614,7 +614,7 @@ bool
MXLogBuffer
::
ResetWriteLsn
(
uint64_t
lsn
)
{
LOG_WAL_INFO_
<<
"reset write lsn "
<<
lsn
;
int32_t
old_file_no
=
mxlog_buffer_writer_
.
file_no
;
u
int32_t
old_file_no
=
mxlog_buffer_writer_
.
file_no
;
ParserLsn
(
lsn
,
mxlog_buffer_writer_
.
file_no
,
mxlog_buffer_writer_
.
buf_offset
);
if
(
old_file_no
==
mxlog_buffer_writer_
.
file_no
)
{
LOG_WAL_DEBUG_
<<
"file No. is not changed"
;
...
...
core/src/metrics/SystemInfo.cpp
浏览文件 @
b532a69c
...
...
@@ -170,7 +170,7 @@ SystemInfo::CPUCorePercent() {
std
::
vector
<
int64_t
>
cur_total_time_array
=
getTotalCpuTime
(
cur_work_time_array
);
std
::
vector
<
double
>
cpu_core_percent
;
for
(
in
t
i
=
0
;
i
<
cur_total_time_array
.
size
();
i
++
)
{
for
(
size_
t
i
=
0
;
i
<
cur_total_time_array
.
size
();
i
++
)
{
double
total_cpu_time
=
cur_total_time_array
[
i
]
-
prev_total_time_array
[
i
];
double
cpu_work_time
=
cur_work_time_array
[
i
]
-
prev_work_time_array
[
i
];
cpu_core_percent
.
push_back
((
cpu_work_time
/
total_cpu_time
)
*
100
);
...
...
@@ -254,7 +254,7 @@ SystemInfo::GPUMemoryTotal() {
#ifdef MILVUS_GPU_VERSION
nvmlMemory_t
nvmlMemory
;
for
(
in
t
i
=
0
;
i
<
num_device_
;
++
i
)
{
for
(
uint32_
t
i
=
0
;
i
<
num_device_
;
++
i
)
{
nvmlDevice_t
device
;
nvmlDeviceGetHandleByIndex
(
i
,
&
device
);
nvmlDeviceGetMemoryInfo
(
device
,
&
nvmlMemory
);
...
...
@@ -273,7 +273,7 @@ SystemInfo::GPUTemperature() {
std
::
vector
<
int64_t
>
result
;
#ifdef MILVUS_GPU_VERSION
for
(
in
t
i
=
0
;
i
<
num_device_
;
i
++
)
{
for
(
uint32_
t
i
=
0
;
i
<
num_device_
;
i
++
)
{
nvmlDevice_t
device
;
nvmlDeviceGetHandleByIndex
(
i
,
&
device
);
unsigned
int
temp
;
...
...
@@ -342,7 +342,7 @@ SystemInfo::GPUMemoryUsed() {
#ifdef MILVUS_GPU_VERSION
nvmlMemory_t
nvmlMemory
;
for
(
in
t
i
=
0
;
i
<
num_device_
;
++
i
)
{
for
(
uint32_
t
i
=
0
;
i
<
num_device_
;
++
i
)
{
nvmlDevice_t
device
;
nvmlDeviceGetHandleByIndex
(
i
,
&
device
);
nvmlDeviceGetMemoryInfo
(
device
,
&
nvmlMemory
);
...
...
@@ -355,8 +355,6 @@ SystemInfo::GPUMemoryUsed() {
std
::
pair
<
int64_t
,
int64_t
>
SystemInfo
::
Octets
()
{
pid_t
pid
=
getpid
();
// const std::string filename = "/proc/"+std::to_string(pid)+"/net/netstat";
const
std
::
string
filename
=
"/proc/net/netstat"
;
std
::
ifstream
file
(
filename
);
std
::
string
lastline
=
""
;
...
...
core/src/metrics/prometheus/PrometheusMetrics.cpp
浏览文件 @
b532a69c
...
...
@@ -204,7 +204,7 @@ PrometheusMetrics::CPUCoreUsagePercentSet() {
std
::
vector
<
double
>
cpu_core_percent
=
server
::
SystemInfo
::
GetInstance
().
CPUCorePercent
();
for
(
in
t
i
=
0
;
i
<
cpu_core_percent
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
cpu_core_percent
.
size
();
++
i
)
{
prometheus
::
Gauge
&
core_percent
=
CPU_
.
Add
({{
"CPU"
,
std
::
to_string
(
i
)}});
core_percent
.
Set
(
cpu_core_percent
[
i
]);
}
...
...
@@ -218,7 +218,7 @@ PrometheusMetrics::GPUTemperature() {
std
::
vector
<
int64_t
>
GPU_temperatures
=
server
::
SystemInfo
::
GetInstance
().
GPUTemperature
();
for
(
in
t
i
=
0
;
i
<
GPU_temperatures
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
GPU_temperatures
.
size
();
++
i
)
{
prometheus
::
Gauge
&
gpu_temp
=
GPU_temperature_
.
Add
({{
"GPU"
,
std
::
to_string
(
i
)}});
gpu_temp
.
Set
(
GPU_temperatures
[
i
]);
}
...
...
@@ -233,7 +233,7 @@ PrometheusMetrics::CPUTemperature() {
std
::
vector
<
float
>
CPU_temperatures
=
server
::
SystemInfo
::
GetInstance
().
CPUTemperature
();
float
avg_cpu_temp
=
0
;
for
(
in
t
i
=
0
;
i
<
CPU_temperatures
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
CPU_temperatures
.
size
();
++
i
)
{
avg_cpu_temp
+=
CPU_temperatures
[
i
];
}
avg_cpu_temp
/=
CPU_temperatures
.
size
();
...
...
core/src/query/BinaryQuery.cpp
浏览文件 @
b532a69c
...
...
@@ -84,6 +84,8 @@ GenBinaryQuery(BooleanQueryPtr query, BinaryQueryPtr& binary_query) {
binary_query
->
relation
=
QueryRelation
::
OR
;
return
GenBinaryQuery
(
query
,
binary_query
);
}
default:
return
Status
::
OK
();
}
}
}
...
...
@@ -94,15 +96,15 @@ GenBinaryQuery(BooleanQueryPtr query, BinaryQueryPtr& binary_query) {
switch
(
bc
->
getOccur
())
{
case
Occur
::
MUST
:
{
binary_query
->
relation
=
QueryRelation
::
AND
;
Status
s
=
GenBinaryQuery
(
bc
,
binary_query
);
return
s
;
return
GenBinaryQuery
(
bc
,
binary_query
);
}
case
Occur
::
MUST_NOT
:
case
Occur
::
SHOULD
:
{
binary_query
->
relation
=
QueryRelation
::
OR
;
Status
s
=
GenBinaryQuery
(
bc
,
binary_query
);
return
s
;
return
GenBinaryQuery
(
bc
,
binary_query
);
}
default:
return
Status
::
OK
();
}
}
...
...
core/src/scheduler/job/SearchJob.cpp
浏览文件 @
b532a69c
...
...
@@ -24,7 +24,7 @@ SearchJob::SearchJob(const std::shared_ptr<server::Context>& context, uint64_t t
SearchJob
::
SearchJob
(
const
std
::
shared_ptr
<
server
::
Context
>&
context
,
milvus
::
query
::
GeneralQueryPtr
general_query
,
std
::
unordered_map
<
std
::
string
,
engine
::
meta
::
hybrid
::
DataType
>&
attr_type
,
const
engine
::
VectorsData
&
vectors
)
:
Job
(
JobType
::
SEARCH
),
context_
(
context
),
general_query_
(
general_query
),
attr_type_
(
attr_type
),
vectors_
(
vectors
)
{
:
Job
(
JobType
::
SEARCH
),
context_
(
context
),
vectors_
(
vectors
),
general_query_
(
general_query
),
attr_type_
(
attr_type
)
{
}
bool
...
...
core/src/scheduler/resource/Resource.cpp
浏览文件 @
b532a69c
...
...
@@ -43,7 +43,7 @@ ToString(ResourceType type) {
}
Resource
::
Resource
(
std
::
string
name
,
ResourceType
type
,
uint64_t
device_id
,
bool
enable_executor
)
:
name_
(
std
::
move
(
name
)),
type_
(
type
),
device_id_
(
device_id
),
enable_executor_
(
enable_executor
)
{
:
device_id_
(
device_id
),
name_
(
std
::
move
(
name
)),
type_
(
type
),
enable_executor_
(
enable_executor
)
{
// register subscriber in tasktable
task_table_
.
RegisterSubscriber
([
&
]
{
if
(
subscriber_
)
{
...
...
core/src/scheduler/selector/FaissFlatPass.cpp
浏览文件 @
b532a69c
...
...
@@ -56,7 +56,7 @@ FaissFlatPass::Run(const TaskPtr& task) {
if
(
!
gpu_enable_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissFlatPass: gpu disable, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
}
else
if
(
search_job
->
nq
()
<
threshold_
)
{
}
else
if
(
search_job
->
nq
()
<
(
uint64_t
)
threshold_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissFlatPass: nq < gpu_search_threshold, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
...
...
core/src/scheduler/selector/FaissIVFFlatPass.cpp
浏览文件 @
b532a69c
...
...
@@ -57,7 +57,7 @@ FaissIVFFlatPass::Run(const TaskPtr& task) {
if
(
!
gpu_enable_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFFlatPass: gpu disable, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
}
else
if
(
search_job
->
nq
()
<
threshold_
)
{
}
else
if
(
search_job
->
nq
()
<
(
uint64_t
)
threshold_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFFlatPass: nq < gpu_search_threshold, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
...
...
core/src/scheduler/selector/FaissIVFPQPass.cpp
浏览文件 @
b532a69c
...
...
@@ -59,7 +59,7 @@ FaissIVFPQPass::Run(const TaskPtr& task) {
if
(
!
gpu_enable_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFPQPass: gpu disable, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
}
else
if
(
search_job
->
nq
()
<
threshold_
)
{
}
else
if
(
search_job
->
nq
()
<
(
uint64_t
)
threshold_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFPQPass: nq < gpu_search_threshold, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
...
...
core/src/scheduler/selector/FaissIVFSQ8HPass.cpp
浏览文件 @
b532a69c
...
...
@@ -57,7 +57,7 @@ FaissIVFSQ8HPass::Run(const TaskPtr& task) {
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFSQ8HPass: gpu disable, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
}
if
(
search_job
->
nq
()
<
threshold_
)
{
if
(
search_job
->
nq
()
<
(
uint64_t
)
threshold_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFSQ8HPass: nq < gpu_search_threshold, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
...
...
core/src/scheduler/selector/FaissIVFSQ8Pass.cpp
浏览文件 @
b532a69c
...
...
@@ -57,7 +57,7 @@ FaissIVFSQ8Pass::Run(const TaskPtr& task) {
if
(
!
gpu_enable_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFSQ8Pass: gpu disable, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
}
else
if
(
search_job
->
nq
()
<
threshold_
)
{
}
else
if
(
search_job
->
nq
()
<
(
uint64_t
)
threshold_
)
{
LOG_SERVER_DEBUG_
<<
LogOut
(
"[%s][%d] FaissIVFSQ8Pass: nq < gpu_search_threshold, specify cpu to search!"
,
"search"
,
0
);
res_ptr
=
ResMgrInst
::
GetInstance
()
->
GetResource
(
"cpu"
);
...
...
core/src/scheduler/task/BuildIndexTask.cpp
浏览文件 @
b532a69c
...
...
@@ -125,7 +125,6 @@ XBuildIndexTask::Execute() {
}
std
::
string
location
=
file_
->
location_
;
EngineType
engine_type
=
(
EngineType
)
file_
->
engine_type_
;
std
::
shared_ptr
<
engine
::
ExecutionEngine
>
index
;
// step 1: create collection file
...
...
core/src/scheduler/task/SearchTask.cpp
浏览文件 @
b532a69c
...
...
@@ -316,8 +316,8 @@ XSearchTask::Execute() {
return
;
}
double
span
=
rc
.
RecordSection
(
hdr
+
", do search"
);
//
search_job->AccumSearchCost(span);
//
double span = rc.RecordSection(hdr + ", do search");
// search_job->AccumSearchCost(span);
// step 3: pick up topk result
auto
spec_k
=
file_
->
row_count_
<
topk
?
file_
->
row_count_
:
topk
;
...
...
@@ -341,8 +341,8 @@ XSearchTask::Execute() {
search_job
->
GetResultIds
(),
search_job
->
GetResultDistances
());
}
span
=
rc
.
RecordSection
(
hdr
+
", reduce topk"
);
//
search_job->AccumReduceCost(span);
//
span = rc.RecordSection(hdr + ", reduce topk");
// search_job->AccumReduceCost(span);
}
catch
(
std
::
exception
&
ex
)
{
LOG_ENGINE_ERROR_
<<
LogOut
(
"[%s][%ld] SearchTask encounter exception: %s"
,
"search"
,
0
,
ex
.
what
());
// search_job->IndexSearchDone(index_id_);//mark as done avoid dead lock, even search failed
...
...
core/src/segment/Attr.cpp
浏览文件 @
b532a69c
...
...
@@ -132,7 +132,7 @@ Attr::Erase(std::vector<int32_t>& offsets) {
auto
loop_size
=
uids_
.
size
();
for
(
size_t
i
=
0
;
i
<
loop_size
;)
{
while
(
skip
!=
offsets
.
cend
()
&&
i
==
*
skip
)
{
while
(
skip
!=
offsets
.
cend
()
&&
i
==
(
size_t
)(
*
skip
)
)
{
++
i
;
++
skip
;
}
...
...
core/src/segment/SegmentWriter.cpp
浏览文件 @
b532a69c
...
...
@@ -289,7 +289,7 @@ SegmentWriter::Merge(const std::string& dir_to_merge, const std::string& name) {
}
SegmentPtr
segment_to_merge
;
segment_reader_to_merge
.
GetSegment
(
segment_to_merge
);
auto
&
uids
=
segment_to_merge
->
vectors_ptr_
->
GetUids
();
//
auto& uids = segment_to_merge->vectors_ptr_->GetUids();
recorder
.
RecordSection
(
"Loading segment"
);
...
...
core/src/segment/Vectors.cpp
浏览文件 @
b532a69c
...
...
@@ -87,7 +87,7 @@ Vectors::Erase(std::vector<int32_t>& offsets) {
auto
loop_size
=
uids_
.
size
();
for
(
size_t
i
=
0
;
i
<
loop_size
;)
{
while
(
i
==
*
skip
&&
skip
!=
offsets
.
cend
())
{
while
(
i
==
(
size_t
)(
*
skip
)
&&
skip
!=
offsets
.
cend
())
{
++
i
;
++
skip
;
}
...
...
core/src/server/delivery/RequestHandler.cpp
浏览文件 @
b532a69c
...
...
@@ -290,6 +290,7 @@ RequestHandler::DescribeHybridCollection(const std::shared_ptr<Context>& context
Status
RequestHandler
::
HasHybridCollection
(
const
std
::
shared_ptr
<
Context
>&
context
,
std
::
string
&
collection_name
,
bool
&
has_collection
)
{
return
Status
::
OK
();
}
Status
...
...
core/src/server/delivery/hybrid_request/InsertEntityRequest.cpp
浏览文件 @
b532a69c
...
...
@@ -132,7 +132,7 @@ InsertEntityRequest::OnExecute() {
// TODO(yukun): check dimension and metric_type
// step 5: insert entities
auto
vec_count
=
static_cast
<
uint64_t
>
(
vector_datas_it
->
second
.
vector_count_
);
//
auto vec_count = static_cast<uint64_t>(vector_datas_it->second.vector_count_);
engine
::
Entity
entity
;
entity
.
entity_count_
=
row_num_
;
...
...
core/src/server/delivery/request/InsertRequest.cpp
浏览文件 @
b532a69c
...
...
@@ -68,7 +68,7 @@ InsertRequest::OnExecute() {
fiu_do_on
(
"InsertRequest.OnExecute.id_array_error"
,
vectors_data_
.
id_array_
.
resize
(
vector_count
+
1
));
if
(
!
vectors_data_
.
id_array_
.
empty
())
{
if
(
vectors_data_
.
id_array_
.
size
()
!=
vector_count
)
{
if
(
vectors_data_
.
id_array_
.
size
()
!=
(
size_t
)
vector_count
)
{
std
::
string
msg
=
"The size of vector ID array must be equal to the size of the vector."
;
LOG_SERVER_ERROR_
<<
LogOut
(
"[%s][%ld] Invalid id array: %s"
,
"insert"
,
0
,
msg
.
c_str
());
return
Status
(
SERVER_ILLEGAL_VECTOR_ID
,
msg
);
...
...
core/src/server/grpc_impl/GrpcRequestHandler.cpp
浏览文件 @
b532a69c
...
...
@@ -32,6 +32,8 @@ namespace milvus {
namespace
server
{
namespace
grpc
{
const
char
*
EXTRA_PARAM_KEY
=
"params"
;
::
milvus
::
grpc
::
ErrorCode
ErrorMap
(
ErrorCode
code
)
{
static
const
std
::
map
<
ErrorCode
,
::
milvus
::
grpc
::
ErrorCode
>
code_map
=
{
...
...
@@ -897,7 +899,7 @@ GrpcRequestHandler::CreateHybridCollection(::grpc::ServerContext* context, const
std
::
vector
<
std
::
pair
<
std
::
string
,
engine
::
meta
::
hybrid
::
DataType
>>
field_types
;
std
::
vector
<
std
::
pair
<
std
::
string
,
uint64_t
>>
vector_dimensions
;
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
string
>>
field_params
;
for
(
uint64_
t
i
=
0
;
i
<
request
->
fields_size
();
++
i
)
{
for
(
in
t
i
=
0
;
i
<
request
->
fields_size
();
++
i
)
{
if
(
request
->
fields
(
i
).
type
().
has_vector_param
())
{
auto
vector_dimension
=
std
::
make_pair
(
request
->
fields
(
i
).
name
(),
request
->
fields
(
i
).
type
().
vector_param
().
dimension
());
...
...
@@ -933,6 +935,7 @@ GrpcRequestHandler::DescribeHybridCollection(::grpc::ServerContext* context,
LOG_SERVER_INFO_
<<
LogOut
(
"Request [%s] %s begin."
,
GetContext
(
context
)
->
RequestID
().
c_str
(),
__func__
);
CHECK_NULLPTR_RETURN
(
request
);
LOG_SERVER_INFO_
<<
LogOut
(
"Request [%s] %s end."
,
GetContext
(
context
)
->
RequestID
().
c_str
(),
__func__
);
return
::
grpc
::
Status
::
OK
;
}
::
grpc
::
Status
...
...
@@ -952,12 +955,12 @@ GrpcRequestHandler::InsertEntity(::grpc::ServerContext* context, const ::milvus:
std
::
vector
<
std
::
string
>
field_names
;
auto
field_size
=
request
->
entities
().
field_names_size
();
field_names
.
resize
(
field_size
-
1
);
for
(
uint64_
t
i
=
0
;
i
<
field_size
-
1
;
++
i
)
{
for
(
in
t
i
=
0
;
i
<
field_size
-
1
;
++
i
)
{
field_names
[
i
]
=
request
->
entities
().
field_names
(
i
);
}
auto
vector_size
=
request
->
entities
().
result_values_size
();
for
(
uint64_
t
i
=
0
;
i
<
vector_size
;
++
i
)
{
for
(
in
t
i
=
0
;
i
<
vector_size
;
++
i
)
{
engine
::
VectorsData
vectors
;
CopyRowRecords
(
request
->
entities
().
result_values
(
i
).
vector_value
().
value
(),
request
->
entity_id_array
(),
vectors
);
...
...
@@ -983,7 +986,7 @@ void
DeSerialization
(
const
::
milvus
::
grpc
::
GeneralQuery
&
general_query
,
query
::
BooleanQueryPtr
&
boolean_clause
)
{
if
(
general_query
.
has_boolean_query
())
{
boolean_clause
->
SetOccur
((
query
::
Occur
)
general_query
.
boolean_query
().
occur
());
for
(
uint64_
t
i
=
0
;
i
<
general_query
.
boolean_query
().
general_query_size
();
++
i
)
{
for
(
in
t
i
=
0
;
i
<
general_query
.
boolean_query
().
general_query_size
();
++
i
)
{
if
(
general_query
.
boolean_query
().
general_query
(
i
).
has_boolean_query
())
{
query
::
BooleanQueryPtr
query
=
std
::
make_shared
<
query
::
BooleanQuery
>
();
DeSerialization
(
general_query
.
boolean_query
().
general_query
(
i
),
query
);
...
...
@@ -1006,7 +1009,7 @@ DeSerialization(const ::milvus::grpc::GeneralQuery& general_query, query::Boolea
range_query
->
field_name
=
query
.
range_query
().
field_name
();
range_query
->
boost
=
query
.
range_query
().
boost
();
range_query
->
compare_expr
.
resize
(
query
.
range_query
().
operand_size
());
for
(
uint64_
t
j
=
0
;
j
<
query
.
range_query
().
operand_size
();
++
j
)
{
for
(
in
t
j
=
0
;
j
<
query
.
range_query
().
operand_size
();
++
j
)
{
range_query
->
compare_expr
[
j
].
compare_operator
=
query
::
CompareOperator
(
query
.
range_query
().
operand
(
j
).
operator_
());
range_query
->
compare_expr
[
j
].
operand
=
query
.
range_query
().
operand
(
j
).
operand
();
...
...
@@ -1070,7 +1073,7 @@ GrpcRequestHandler::HybridSearch(::grpc::ServerContext* context, const ::milvus:
std
::
vector
<
std
::
string
>
partition_list
;
partition_list
.
resize
(
request
->
partition_tag_array_size
());
for
(
uint64_
t
i
=
0
;
i
<
request
->
partition_tag_array_size
();
++
i
)
{
for
(
in
t
i
=
0
;
i
<
request
->
partition_tag_array_size
();
++
i
)
{
partition_list
[
i
]
=
request
->
partition_tag_array
(
i
);
}
...
...
core/src/server/grpc_impl/GrpcRequestHandler.h
浏览文件 @
b532a69c
...
...
@@ -57,7 +57,7 @@ namespace grpc {
::
milvus
::
grpc
::
ErrorCode
ErrorMap
(
ErrorCode
code
);
static
const
char
*
EXTRA_PARAM_KEY
=
"params"
;
extern
const
char
*
EXTRA_PARAM_KEY
;
class
GrpcRequestHandler
final
:
public
::
milvus
::
grpc
::
MilvusService
::
Service
,
public
GrpcInterceptorHookHandler
{
public:
...
...
@@ -385,7 +385,7 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
// const ::milvus::grpc::HDeleteByIDParam* request,
// ::milvus::grpc::Status* response) override;
GrpcRequestHandler
&
void
RegisterRequestHandler
(
const
RequestHandler
&
handler
)
{
request_handler_
=
handler
;
}
...
...
core/src/server/init/CpuChecker.cpp
浏览文件 @
b532a69c
...
...
@@ -29,8 +29,6 @@ Status
CpuChecker
::
CheckCpuInstructionSet
()
{
std
::
vector
<
std
::
string
>
instruction_sets
;
auto
&
instruction_set_inst
=
faiss
::
InstructionSet
::
GetInstance
();
bool
support_avx512
=
faiss
::
support_avx512
();
fiu_do_on
(
"CpuChecker.CheckCpuInstructionSet.not_support_avx512"
,
support_avx512
=
false
);
if
(
support_avx512
)
{
...
...
core/src/server/web_impl/handler/WebRequestHandler.cpp
浏览文件 @
b532a69c
...
...
@@ -487,7 +487,7 @@ WebRequestHandler::Search(const std::string& collection_name, const nlohmann::js
auto
step
=
result
.
id_list_
.
size
()
/
result
.
row_num_
;
nlohmann
::
json
search_result_json
;
for
(
size
_t
i
=
0
;
i
<
result
.
row_num_
;
i
++
)
{
for
(
int64
_t
i
=
0
;
i
<
result
.
row_num_
;
i
++
)
{
nlohmann
::
json
raw_result_json
;
for
(
size_t
j
=
0
;
j
<
step
;
j
++
)
{
nlohmann
::
json
one_result_json
;
...
...
@@ -541,6 +541,8 @@ WebRequestHandler::ProcessLeafQueryJson(const nlohmann::json& json, milvus::quer
memcpy
(
term_query
->
field_value
.
data
(),
term_value
.
data
(),
term_size
*
sizeof
(
double
));
break
;
}
default:
break
;
}
leaf_query
->
term_query
=
term_query
;
...
...
@@ -731,7 +733,7 @@ WebRequestHandler::HybridSearch(const std::string& collection_name, const nlohma
auto
step
=
result
.
id_list_
.
size
()
/
result
.
row_num_
;
nlohmann
::
json
search_result_json
;
for
(
size
_t
i
=
0
;
i
<
result
.
row_num_
;
i
++
)
{
for
(
int64
_t
i
=
0
;
i
<
result
.
row_num_
;
i
++
)
{
nlohmann
::
json
raw_result_json
;
for
(
size_t
j
=
0
;
j
<
step
;
j
++
)
{
nlohmann
::
json
one_result_json
;
...
...
@@ -837,7 +839,6 @@ WebRequestHandler::GetDevices(DevicesDto::ObjectWrapper& devices_dto) {
StatusDto
::
ObjectWrapper
WebRequestHandler
::
GetAdvancedConfig
(
AdvancedConfigDto
::
ObjectWrapper
&
advanced_config
)
{
Config
&
config
=
Config
::
GetInstance
();
std
::
string
reply
;
std
::
string
cache_cmd_prefix
=
"get_config "
+
std
::
string
(
CONFIG_CACHE
)
+
"."
;
...
...
@@ -1387,7 +1388,7 @@ WebRequestHandler::ShowPartitions(const OString& collection_name, const OQueryPa
partition_list_dto
->
count
=
partitions
.
size
();
partition_list_dto
->
partitions
=
partition_list_dto
->
partitions
->
createShared
();
if
(
offset
<
partitions
.
size
(
))
{
if
(
offset
<
(
int64_t
)(
partitions
.
size
()
))
{
for
(
int64_t
i
=
offset
;
i
<
page_size
+
offset
;
i
++
)
{
auto
partition_dto
=
PartitionFieldsDto
::
createShared
();
partition_dto
->
partition_tag
=
partitions
.
at
(
i
).
tag_
.
c_str
();
...
...
core/src/tracing/TracerUtil.cpp
浏览文件 @
b532a69c
...
...
@@ -22,6 +22,10 @@
namespace
milvus
{
namespace
tracing
{
const
char
*
TRACER_LIBRARY_CONFIG_NAME
=
"tracer_library"
;
const
char
*
TRACER_CONFIGURATION_CONFIG_NAME
=
"tracer_configuration"
;
const
char
*
TRACE_CONTEXT_HEADER_CONFIG_NAME
=
"TraceContextHeaderName"
;
const
char
*
TracerUtil
::
tracer_context_header_name_
;
void
...
...
core/src/tracing/TracerUtil.h
浏览文件 @
b532a69c
...
...
@@ -16,9 +16,9 @@
namespace
milvus
{
namespace
tracing
{
static
const
char
*
TRACER_LIBRARY_CONFIG_NAME
=
"tracer_library"
;
static
const
char
*
TRACER_CONFIGURATION_CONFIG_NAME
=
"tracer_configuration"
;
static
const
char
*
TRACE_CONTEXT_HEADER_CONFIG_NAME
=
"TraceContextHeaderName"
;
extern
const
char
*
TRACER_LIBRARY_CONFIG_NAME
;
extern
const
char
*
TRACER_CONFIGURATION_CONFIG_NAME
;
extern
const
char
*
TRACE_CONTEXT_HEADER_CONFIG_NAME
;
class
TracerUtil
{
public:
...
...
core/src/utils/CommonUtil.cpp
浏览文件 @
b532a69c
...
...
@@ -44,7 +44,7 @@ namespace server {
namespace
fs
=
boost
::
filesystem
;
bool
CommonUtil
::
GetSystemMemInfo
(
uint64_t
&
total_mem
,
u
int64_t
&
free_mem
)
{
CommonUtil
::
GetSystemMemInfo
(
int64_t
&
total_mem
,
int64_t
&
free_mem
)
{
struct
sysinfo
info
;
int
ret
=
sysinfo
(
&
info
);
total_mem
=
info
.
totalram
;
...
...
@@ -180,9 +180,9 @@ CommonUtil::GetFileName(std::string filename) {
std
::
string
CommonUtil
::
GetExePath
()
{
const
size
_t
buf_len
=
1024
;
const
int64
_t
buf_len
=
1024
;
char
buf
[
buf_len
];
ssize
_t
cnt
=
readlink
(
"/proc/self/exe"
,
buf
,
buf_len
);
int64
_t
cnt
=
readlink
(
"/proc/self/exe"
,
buf
,
buf_len
);
fiu_do_on
(
"CommonUtil.GetExePath.readlink_fail"
,
cnt
=
-
1
);
if
(
cnt
<
0
||
cnt
>=
buf_len
)
{
return
""
;
...
...
core/src/utils/CommonUtil.h
浏览文件 @
b532a69c
...
...
@@ -22,7 +22,7 @@ namespace server {
class
CommonUtil
{
public:
static
bool
GetSystemMemInfo
(
uint64_t
&
total_mem
,
u
int64_t
&
free_mem
);
GetSystemMemInfo
(
int64_t
&
total_mem
,
int64_t
&
free_mem
);
static
bool
GetSystemAvailableThreads
(
int64_t
&
thread_count
);
...
...
core/src/utils/LogUtil.cpp
浏览文件 @
b532a69c
...
...
@@ -54,14 +54,13 @@ RolloutHandler(const char* filename, std::size_t size, el::Level level) {
position
+=
2
;
}
}
int
ret
;
std
::
string
m
(
std
::
string
(
dir
)
+
"/"
+
s
);
s
=
m
;
try
{
switch
(
level
)
{
case
el
::
Level
::
Debug
:
{
s
.
append
(
"."
+
std
::
to_string
(
++
debug_idx
));
re
t
=
re
name
(
m
.
c_str
(),
s
.
c_str
());
rename
(
m
.
c_str
(),
s
.
c_str
());
if
(
enable_log_delete
&&
debug_idx
-
logs_delete_exceeds
>
0
)
{
std
::
string
to_delete
=
m
+
"."
+
std
::
to_string
(
debug_idx
-
logs_delete_exceeds
);
// std::cout << "remote " << to_delete << std::endl;
...
...
@@ -71,7 +70,7 @@ RolloutHandler(const char* filename, std::size_t size, el::Level level) {
}
case
el
::
Level
::
Warning
:
{
s
.
append
(
"."
+
std
::
to_string
(
++
warning_idx
));
re
t
=
re
name
(
m
.
c_str
(),
s
.
c_str
());
rename
(
m
.
c_str
(),
s
.
c_str
());
if
(
enable_log_delete
&&
warning_idx
-
logs_delete_exceeds
>
0
)
{
std
::
string
to_delete
=
m
+
"."
+
std
::
to_string
(
warning_idx
-
logs_delete_exceeds
);
boost
::
filesystem
::
remove
(
to_delete
);
...
...
@@ -80,7 +79,7 @@ RolloutHandler(const char* filename, std::size_t size, el::Level level) {
}
case
el
::
Level
::
Trace
:
{
s
.
append
(
"."
+
std
::
to_string
(
++
trace_idx
));
re
t
=
re
name
(
m
.
c_str
(),
s
.
c_str
());
rename
(
m
.
c_str
(),
s
.
c_str
());
if
(
enable_log_delete
&&
trace_idx
-
logs_delete_exceeds
>
0
)
{
std
::
string
to_delete
=
m
+
"."
+
std
::
to_string
(
trace_idx
-
logs_delete_exceeds
);
boost
::
filesystem
::
remove
(
to_delete
);
...
...
@@ -89,7 +88,7 @@ RolloutHandler(const char* filename, std::size_t size, el::Level level) {
}
case
el
::
Level
::
Error
:
{
s
.
append
(
"."
+
std
::
to_string
(
++
error_idx
));
re
t
=
re
name
(
m
.
c_str
(),
s
.
c_str
());
rename
(
m
.
c_str
(),
s
.
c_str
());
if
(
enable_log_delete
&&
error_idx
-
logs_delete_exceeds
>
0
)
{
std
::
string
to_delete
=
m
+
"."
+
std
::
to_string
(
error_idx
-
logs_delete_exceeds
);
boost
::
filesystem
::
remove
(
to_delete
);
...
...
@@ -98,7 +97,7 @@ RolloutHandler(const char* filename, std::size_t size, el::Level level) {
}
case
el
::
Level
::
Fatal
:
{
s
.
append
(
"."
+
std
::
to_string
(
++
fatal_idx
));
re
t
=
re
name
(
m
.
c_str
(),
s
.
c_str
());
rename
(
m
.
c_str
(),
s
.
c_str
());
if
(
enable_log_delete
&&
fatal_idx
-
logs_delete_exceeds
>
0
)
{
std
::
string
to_delete
=
m
+
"."
+
std
::
to_string
(
fatal_idx
-
logs_delete_exceeds
);
boost
::
filesystem
::
remove
(
to_delete
);
...
...
@@ -107,7 +106,7 @@ RolloutHandler(const char* filename, std::size_t size, el::Level level) {
}
default:
{
s
.
append
(
"."
+
std
::
to_string
(
++
global_idx
));
re
t
=
re
name
(
m
.
c_str
(),
s
.
c_str
());
rename
(
m
.
c_str
(),
s
.
c_str
());
if
(
enable_log_delete
&&
global_idx
-
logs_delete_exceeds
>
0
)
{
std
::
string
to_delete
=
m
+
"."
+
std
::
to_string
(
global_idx
-
logs_delete_exceeds
);
boost
::
filesystem
::
remove
(
to_delete
);
...
...
core/src/utils/ValidationUtil.cpp
浏览文件 @
b532a69c
...
...
@@ -216,7 +216,7 @@ ValidationUtil::ValidateIndexParams(const milvus::json& index_params,
// special check for 'm' parameter
std
::
vector
<
int64_t
>
resset
;
milvus
::
knowhere
::
IVFPQConfAdapter
::
GetValidMList
(
collection_schema
.
dimension_
,
resset
);
int64_t
m_value
=
index_params
[
index_params
,
knowhere
::
IndexParams
::
m
];
int64_t
m_value
=
index_params
[
knowhere
::
IndexParams
::
m
];
if
(
resset
.
empty
())
{
std
::
string
msg
=
"Invalid collection dimension, unable to get reasonable values for 'm'"
;
LOG_SERVER_ERROR_
<<
msg
;
...
...
@@ -504,7 +504,7 @@ ValidationUtil::ValidateGpuIndex(int32_t gpu_index) {
#ifdef MILVUS_GPU_VERSION
Status
ValidationUtil
::
GetGpuMemory
(
int32_t
gpu_index
,
size
_t
&
memory
)
{
ValidationUtil
::
GetGpuMemory
(
int32_t
gpu_index
,
int64
_t
&
memory
)
{
fiu_return_on
(
"ValidationUtil.GetGpuMemory.return_error"
,
Status
(
SERVER_UNEXPECTED_ERROR
,
""
));
cudaDeviceProp
deviceProp
;
...
...
core/src/utils/ValidationUtil.h
浏览文件 @
b532a69c
...
...
@@ -72,7 +72,7 @@ class ValidationUtil {
#ifdef MILVUS_GPU_VERSION
static
Status
GetGpuMemory
(
int32_t
gpu_index
,
size
_t
&
memory
);
GetGpuMemory
(
int32_t
gpu_index
,
int64
_t
&
memory
);
#endif
static
Status
...
...
core/unittest/server/test_config.cpp
浏览文件 @
b532a69c
...
...
@@ -52,10 +52,6 @@ TEST_F(ConfigTest, CONFIG_TEST) {
milvus
::
server
::
ConfigNode
&
root_config
=
config_mgr
->
GetRootNode
();
milvus
::
server
::
ConfigNode
&
server_config
=
root_config
.
GetChild
(
"server_config"
);
milvus
::
server
::
ConfigNode
&
db_config
=
root_config
.
GetChild
(
"db_config"
);
milvus
::
server
::
ConfigNode
&
metric_config
=
root_config
.
GetChild
(
"metric_config"
);
milvus
::
server
::
ConfigNode
&
cache_config
=
root_config
.
GetChild
(
"cache_config"
);
milvus
::
server
::
ConfigNode
&
wal_config
=
root_config
.
GetChild
(
"wal_config"
);
milvus
::
server
::
ConfigNode
invalid_config
=
root_config
.
GetChild
(
"invalid_config"
);
const
auto
&
im_config_mgr
=
*
static_cast
<
milvus
::
server
::
YamlConfigMgr
*>
(
config_mgr
);
...
...
core/unittest/server/test_util.cpp
浏览文件 @
b532a69c
...
...
@@ -65,7 +65,7 @@ TEST(UtilTest, SIGNAL_TEST) {
}
TEST
(
UtilTest
,
COMMON_TEST
)
{
u
int64_t
total_mem
=
0
,
free_mem
=
0
;
int64_t
total_mem
=
0
,
free_mem
=
0
;
milvus
::
server
::
CommonUtil
::
GetSystemMemInfo
(
total_mem
,
free_mem
);
ASSERT_GT
(
total_mem
,
0
);
ASSERT_GT
(
free_mem
,
0
);
...
...
@@ -685,7 +685,7 @@ TEST(ValidationUtilTest, VALIDATE_GPU_TEST) {
ASSERT_NE
(
milvus
::
server
::
ValidationUtil
::
ValidateGpuIndex
(
0
).
code
(),
milvus
::
SERVER_SUCCESS
);
fiu_disable
(
"ValidationUtil.ValidateGpuIndex.get_device_count_fail"
);
size
_t
memory
=
0
;
int64
_t
memory
=
0
;
ASSERT_EQ
(
milvus
::
server
::
ValidationUtil
::
GetGpuMemory
(
0
,
memory
).
code
(),
milvus
::
SERVER_SUCCESS
);
ASSERT_NE
(
milvus
::
server
::
ValidationUtil
::
GetGpuMemory
(
100
,
memory
).
code
(),
milvus
::
SERVER_SUCCESS
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录