提交 d5f7526c 编写于 作者: G groot 提交者: JinHai-CN

#2338 (#2345)

* fix #2264
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* typo
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* fix ut
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* typo
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* Remove unnecessary memcpy
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* remove SearchByID from C++SDK
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* #2338
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>
上级 7f872486
......@@ -1731,7 +1731,7 @@ MySQLMetaImpl::FilesToMerge(const std::string& collection_id, FilesHolder& files
} // Scoped Connection
Status ret;
int64_t files_count = 0;
SegmentsSchema files;
for (auto& resRow : res) {
SegmentSchema collection_file;
collection_file.file_size_ = resRow["file_size"];
......@@ -1759,12 +1759,15 @@ MySQLMetaImpl::FilesToMerge(const std::string& collection_id, FilesHolder& files
continue;
}
files_holder.MarkFile(collection_file);
files_count++;
files.emplace_back(collection_file);
}
if (files_count > 0) {
LOG_ENGINE_DEBUG_ << "Collect " << files_count << " to-merge files in collection " << collection_id;
// no need to merge if files count less than 2
if (files.size() > 1) {
LOG_ENGINE_DEBUG_ << "Collect " << files.size() << " to-merge files in collection " << collection_id;
for (auto& file : files) {
files_holder.MarkFile(file);
}
}
return ret;
} catch (std::exception& e) {
......
......@@ -1148,7 +1148,7 @@ SqliteMetaImpl::FilesToMerge(const std::string& collection_id, FilesHolder& file
}
Status result;
int64_t files_count = 0;
SegmentsSchema files;
for (auto& file : selected) {
SegmentSchema collection_file;
collection_file.file_size_ = std::get<5>(file);
......@@ -1174,12 +1174,15 @@ SqliteMetaImpl::FilesToMerge(const std::string& collection_id, FilesHolder& file
result = status;
}
files_holder.MarkFile(collection_file);
files_count++;
files.emplace_back(collection_file);
}
if (files_count > 0) {
LOG_ENGINE_DEBUG_ << "Collect " << files_count << " to-merge files in collection " << collection_id;
// no need to merge if files count less than 2
if (files.size() > 1) {
LOG_ENGINE_DEBUG_ << "Collect " << files.size() << " to-merge files in collection " << collection_id;
for (auto& file : files) {
files_holder.MarkFile(file);
}
}
return result;
} catch (std::exception& e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册