mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix(db): fix size api for db meta
Former-commit-id: b58a3f27ee9b574af78894eb6fb5120904430c66
This commit is contained in:
parent
c90aee8972
commit
dfb0952880
@ -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