fix(db): set new file rows to 0

Former-commit-id: a8690d08c1563f0c7ddd91d5709912a5aab49899
This commit is contained in:
Xu Peng 2019-04-19 10:16:52 +08:00 committed by xj.lin
parent a9ed75fc46
commit fe93299d9a
2 changed files with 3 additions and 0 deletions

View File

@ -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;

View File

@ -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);
{