* fix #2264

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* typo

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* fix ut

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* typo

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* Remove unnecessary memcpy

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* remove SearchByID from C++SDK

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* #2338

Signed-off-by: yhmo <yihua.mo@zilliz.com>
This commit is contained in:
groot 2020-05-14 07:50:26 -05:00 committed by GitHub
parent d160b279fc
commit b7f410e43f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 10 deletions

View File

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

View File

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