Unverified Commit b7f410e4 authored by groot's avatar groot Committed by GitHub
Browse files

#2338 (#2345)



* fix #2264

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

* typo

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

* fix ut

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

* typo

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

* Remove unnecessary memcpy

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

* remove SearchByID from C++SDK

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

* #2338

Signed-off-by: default avataryhmo <yihua.mo@zilliz.com>
parent d160b279
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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) {
+8 −5
Original line number Diff line number Diff line
@@ -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) {