diff --git a/internal/core/src/common/FieldMeta.h b/internal/core/src/common/FieldMeta.h index 48e5024e14..6ef5856b84 100644 --- a/internal/core/src/common/FieldMeta.h +++ b/internal/core/src/common/FieldMeta.h @@ -218,7 +218,7 @@ class FieldMeta { : name_(name), id_(id), type_(type), - vector_info_(VectorInfo{dim, metric_type}) { + vector_info_(VectorInfo{dim, std::move(metric_type)}) { Assert(datatype_is_vector(type_)); } diff --git a/internal/core/src/exec/Driver.h b/internal/core/src/exec/Driver.h index 12d1228a7c..693812a61f 100644 --- a/internal/core/src/exec/Driver.h +++ b/internal/core/src/exec/Driver.h @@ -78,7 +78,7 @@ class BlockingState { ContinueFuture&& future, Operator* op, BlockingReason reason) - : driver_(std::move(driver_)), + : driver_(std::move(driver)), future_(std::move(future)), operator_(op), reason_(reason) { diff --git a/internal/core/src/exec/Task.cpp b/internal/core/src/exec/Task.cpp index 2b643c71e8..28abe68743 100644 --- a/internal/core/src/exec/Task.cpp +++ b/internal/core/src/exec/Task.cpp @@ -19,6 +19,7 @@ #include #include #include +#include "log/Log.h" namespace milvus { namespace exec { @@ -139,6 +140,7 @@ Task::Next(ContinueFuture* future) { "Task has already finished processing."); if (driver_factories_.empty()) { + LOG_SEGCORE_WARNING_ << "create driver..."; AssertInfo( consumer_supplier_ == nullptr, "Single-threaded execution doesn't support delivering results to a " @@ -163,6 +165,7 @@ Task::Next(ContinueFuture* future) { CreateDriversLocked(self, kUngroupedGroupId, drivers); drivers_ = std::move(drivers); + LOG_SEGCORE_WARNING_ << "create driver done"; } const auto num_drivers = drivers_.size(); @@ -188,7 +191,9 @@ Task::Next(ContinueFuture* future) { std::shared_ptr blocking_state; + LOG_SEGCORE_WARNING_ << "driver fetch next result..."; auto result = drivers_[i]->Next(blocking_state); + LOG_SEGCORE_WARNING_ << "driver fetch next result done"; if (result) { return result; diff --git a/internal/core/src/index/ScalarIndexSort.cpp b/internal/core/src/index/ScalarIndexSort.cpp index a96642e591..d69ac0df15 100644 --- a/internal/core/src/index/ScalarIndexSort.cpp +++ b/internal/core/src/index/ScalarIndexSort.cpp @@ -82,7 +82,7 @@ ScalarIndexSort::BuildV2(const Config& config) { field_datas.push_back(field_data); } int64_t total_num_rows = 0; - for (auto data : field_datas) { + for (const auto& data : field_datas) { total_num_rows += data->get_num_rows(); } if (total_num_rows == 0) { @@ -92,7 +92,7 @@ ScalarIndexSort::BuildV2(const Config& config) { data_.reserve(total_num_rows); int64_t offset = 0; - for (auto data : field_datas) { + for (const auto& data : field_datas) { auto slice_num = data->get_num_rows(); for (size_t i = 0; i < slice_num; ++i) { auto value = reinterpret_cast(data->RawValue(i)); @@ -122,7 +122,7 @@ ScalarIndexSort::Build(const Config& config) { file_manager_->CacheRawDataToMemory(insert_files.value()); int64_t total_num_rows = 0; - for (auto data : field_datas) { + for (const auto& data : field_datas) { total_num_rows += data->get_num_rows(); } if (total_num_rows == 0) { @@ -132,7 +132,7 @@ ScalarIndexSort::Build(const Config& config) { data_.reserve(total_num_rows); int64_t offset = 0; - for (auto data : field_datas) { + for (const auto& data : field_datas) { auto slice_num = data->get_num_rows(); for (size_t i = 0; i < slice_num; ++i) { auto value = reinterpret_cast(data->RawValue(i)); diff --git a/internal/core/src/mmap/Utils.h b/internal/core/src/mmap/Utils.h index 4a22a3981c..7b1dc8308d 100644 --- a/internal/core/src/mmap/Utils.h +++ b/internal/core/src/mmap/Utils.h @@ -34,7 +34,7 @@ namespace milvus { inline size_t GetDataSize(const std::vector& datas) { size_t total_size{0}; - for (auto data : datas) { + for (const auto& data : datas) { total_size += data->Size(); } @@ -42,7 +42,7 @@ GetDataSize(const std::vector& datas) { } inline void* -FillField(DataType data_type, const FieldDataPtr data, void* dst) { +FillField(DataType data_type, const FieldDataPtr& data, void* dst) { char* dest = reinterpret_cast(dst); if (datatype_is_variable(data_type)) { switch (data_type) {