From 7c6a033a6ac5f34a482e6c4014791371ad13aa4d Mon Sep 17 00:00:00 2001 From: Xu Peng Date: Fri, 19 Apr 2019 10:16:52 +0800 Subject: [PATCH] fix(db): set new file rows to 0 Former-commit-id: ca814fc5f6c81679e25ec4cd195b430a89b52383 --- cpp/src/db/DBImpl.cpp | 2 ++ cpp/src/db/DBMetaImpl.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/cpp/src/db/DBImpl.cpp b/cpp/src/db/DBImpl.cpp index b92518d696..7dc61679c3 100644 --- a/cpp/src/db/DBImpl.cpp +++ b/cpp/src/db/DBImpl.cpp @@ -133,6 +133,7 @@ Status DBImpl::merge_files(const std::string& group_id, const meta::DateT& date, } else { group_file.file_type = meta::GroupFileSchema::RAW; } + group_file.rows = index_size; updated.push_back(group_file); status = _pMeta->update_files(updated); @@ -188,6 +189,7 @@ Status DBImpl::build_index(const meta::GroupFileSchema& file) { /* std::cout << "raw size=" << from_index->ntotal << " index size=" << index->ntotal << std::endl; */ write_index(index, group_file.location.c_str()); group_file.file_type = meta::GroupFileSchema::INDEX; + group_file.rows = file.dimension * index->ntotal; auto to_remove = file; to_remove.file_type = meta::GroupFileSchema::TO_DELETE; diff --git a/cpp/src/db/DBMetaImpl.cpp b/cpp/src/db/DBMetaImpl.cpp index 126a64c8af..3b0f520673 100644 --- a/cpp/src/db/DBMetaImpl.cpp +++ b/cpp/src/db/DBMetaImpl.cpp @@ -165,6 +165,7 @@ Status DBMetaImpl::add_group_file(GroupFileSchema& group_file) { group_file.file_type = GroupFileSchema::NEW; group_file.file_id = ss.str(); group_file.dimension = group_info.dimension; + group_file.rows = 0; GetGroupFilePath(group_file); {