mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-31 07:55:38 +08:00
fix(db): fix size api for db meta
Former-commit-id: 88add7eef97827063e8e87f0d84aec62e66f7ca6
This commit is contained in:
parent
3f28d33b6e
commit
b2f079ed67
@ -489,13 +489,19 @@ Status DBMetaImpl::archive_files() {
|
||||
}
|
||||
|
||||
Status DBMetaImpl::size(long& result) {
|
||||
result = 0;
|
||||
try {
|
||||
auto sum_c = ConnectorPtr->sum(
|
||||
&GroupFileSchema::rows,
|
||||
auto selected = ConnectorPtr->select(columns(sum(&GroupFileSchema::rows)),
|
||||
where(
|
||||
c(&GroupFileSchema::file_type) != (int)GroupFileSchema::TO_DELETE
|
||||
));
|
||||
result = *sum_c*sizeof(float);
|
||||
|
||||
for (auto& sub_query : selected) {
|
||||
if(!std::get<0>(sub_query)) {
|
||||
continue;
|
||||
}
|
||||
result += (long)(*std::get<0>(sub_query))*sizeof(float);
|
||||
}
|
||||
} catch (std::exception & e) {
|
||||
LOG(DEBUG) << e.what();
|
||||
throw e;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user