diff --git a/cmake/bazel.cmake b/cmake/bazel.cmake index d8ddba0..2572915 100644 --- a/cmake/bazel.cmake +++ b/cmake/bazel.cmake @@ -625,11 +625,16 @@ function(_targets_link_dependencies _NAME) APPEND LIBS_INCS "$" ) + list( + APPEND LIBS_SYSTEM_INCS + "$" + ) endif() endforeach() if(LIBS_DEPS) add_dependencies(${_NAME} ${LIBS_DEPS}) + target_include_directories(${_NAME} SYSTEM PRIVATE "${LIBS_SYSTEM_INCS}") target_include_directories(${_NAME} PRIVATE "${LIBS_INCS}") endif() endfunction() diff --git a/src/ailego/utility/float_helper.cc b/src/ailego/utility/float_helper.cc index 6e33fed..2d77f53 100644 --- a/src/ailego/utility/float_helper.cc +++ b/src/ailego/utility/float_helper.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include #include #include @@ -428,8 +429,9 @@ static inline float float32(uint16_t val) { uint16_t hval = static_cast(val >> 10); uint32_t bits = mantissa_table[offset_table[hval] + (val & 0x3FF)] + exponent_table[hval]; - float *p = reinterpret_cast(&bits); - return (*p); + float result; + std::memcpy(&result, &bits, sizeof(result)); + return result; } // Refer: https://github.com/Maratyszcza/FP16/blob/master/third-party/half.hpp diff --git a/src/core/algorithm/flat_sparse/flat_sparse_streamer.h b/src/core/algorithm/flat_sparse/flat_sparse_streamer.h index 794d49b..81f8c71 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_streamer.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_streamer.h @@ -158,10 +158,10 @@ class FlatSparseStreamer : public IndexStreamer { enum State { STATE_INIT = 0, STATE_INITED = 1, STATE_OPENED = 2 }; IndexMeta meta_{}; + Stats stats_{}; FlatSparseStreamerEntity entity_; uint32_t magic_{0U}; - Stats stats_{}; State state_{STATE_INIT}; //! avoid add vector while dumping index diff --git a/src/core/algorithm/hnsw/hnsw_context.cc b/src/core/algorithm/hnsw/hnsw_context.cc index b930e41..5ad6c93 100644 --- a/src/core/algorithm/hnsw/hnsw_context.cc +++ b/src/core/algorithm/hnsw/hnsw_context.cc @@ -102,7 +102,7 @@ int HnswContext::update(const ailego::Params ¶ms) { } if (params.has(p)) { - bool bf_enabled; + bool bf_enabled = false; params.get(p, &bf_enabled); if (bf_enabled ^ (filter_mode_ == VisitFilter::BloomFilter)) { need_update = true; diff --git a/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_context.cc b/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_context.cc index 5a528e3..9866598 100644 --- a/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_context.cc +++ b/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_context.cc @@ -103,7 +103,7 @@ int HnswRabitqContext::update(const ailego::Params ¶ms) { } if (params.has(p)) { - bool bf_enabled; + bool bf_enabled = false; params.get(p, &bf_enabled); if (bf_enabled ^ (filter_mode_ == VisitFilter::BloomFilter)) { need_update = true; diff --git a/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_streamer.h b/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_streamer.h index 0ec9a5d..4301372 100644 --- a/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_streamer.h +++ b/src/core/algorithm/hnsw_rabitq/hnsw_rabitq_streamer.h @@ -196,6 +196,7 @@ class HnswRabitqStreamer : public IndexStreamer { } }; + Stats stats_{}; HnswRabitqStreamerEntity entity_; HnswRabitqAlgorithm::UPointer alg_; IndexMeta meta_{}; @@ -211,8 +212,6 @@ class HnswRabitqStreamer : public IndexStreamer { HnswRabitqQueryAlgorithm::UPointer query_alg_; // query algorithm // provider_ provides raw vector, which is used to build graph IndexProvider::Pointer provider_{}; - - Stats stats_{}; std::mutex mutex_{}; size_t max_index_size_{0UL}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc index de3dfdd..142e151 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc @@ -98,7 +98,7 @@ int HnswSparseContext::update(const ailego::Params ¶ms) { } if (params.has(p)) { - bool bf_enabled; + bool bf_enabled = false; params.get(p, &bf_enabled); if (bf_enabled ^ (filter_mode_ == VisitFilter::BloomFilter)) { need_update = true; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h index fa2712b..d38e93a 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h @@ -176,6 +176,7 @@ class HnswSparseStreamer : public IndexStreamer { } }; + Stats stats_{}; HnswSparseStreamerEntity entity_; HnswSparseAlgorithm::UPointer alg_; IndexMeta meta_{}; @@ -183,7 +184,6 @@ class HnswSparseStreamer : public IndexStreamer { IndexMetric::MatrixSparseDistance add_distance_{}; IndexMetric::MatrixSparseDistance search_distance_{}; - Stats stats_{}; std::mutex mutex_{}; size_t max_index_size_{0UL}; diff --git a/src/core/algorithm/vamana/vamana_entity.h b/src/core/algorithm/vamana/vamana_entity.h index fca4159..1efff0e 100644 --- a/src/core/algorithm/vamana/vamana_entity.h +++ b/src/core/algorithm/vamana/vamana_entity.h @@ -218,19 +218,20 @@ class VamanaEntity { std::vector &vec_blocks) const = 0; virtual const Neighbors get_neighbors(node_id_t id) const = 0; - virtual int add_vector(key_t key, const void *vec, node_id_t *id) { + virtual int add_vector(key_t /*key*/, const void * /*vec*/, + node_id_t * /*id*/) { return IndexError_NotImplemented; } - virtual int add_vector_with_id(node_id_t id, const void *vec) { + virtual int add_vector_with_id(node_id_t /*id*/, const void * /*vec*/) { return IndexError_NotImplemented; } virtual int update_neighbors( - node_id_t id, - const std::vector> &neighbors) { + node_id_t /*id*/, + const std::vector> & /*neighbors*/) { return IndexError_NotImplemented; } - virtual void add_neighbor(node_id_t id, uint32_t size, - node_id_t neighbor_id) {} + virtual void add_neighbor(node_id_t /*id*/, uint32_t /*size*/, + node_id_t /*neighbor_id*/) {} // --- Neighbor distance storage (CSR-like, lazy-loaded) --- // Each node has max_degree dist_t slots, the i-th slot stores the distance @@ -250,19 +251,20 @@ class VamanaEntity { // Get pointer to the distance array for node `id`. // Returns nullptr if dist storage is not loaded. - virtual const dist_t *get_neighbor_dists(node_id_t id) const { + virtual const dist_t *get_neighbor_dists(node_id_t /*id*/) const { return nullptr; } // Update all neighbor distances for node `id` from a prune result. virtual void update_neighbor_dists( - node_id_t id, - const std::vector> &neighbors) {} + node_id_t /*id*/, + const std::vector> & /*neighbors*/) {} // Set the distance for the `idx`-th neighbor of node `id`. - virtual void set_neighbor_dist(node_id_t id, uint32_t idx, dist_t dist) {} + virtual void set_neighbor_dist(node_id_t /*id*/, uint32_t /*idx*/, + dist_t /*dist*/) {} - virtual int dump(const IndexDumper::Pointer &dumper) { + virtual int dump(const IndexDumper::Pointer & /*dumper*/) { return IndexError_NotImplemented; } diff --git a/src/core/algorithm/vamana/vamana_streamer.h b/src/core/algorithm/vamana/vamana_streamer.h index 5520b37..efe0cf7 100644 --- a/src/core/algorithm/vamana/vamana_streamer.h +++ b/src/core/algorithm/vamana/vamana_streamer.h @@ -173,7 +173,6 @@ class VamanaStreamer : public IndexStreamer { size_t bruteforce_threshold_{VamanaEntity::kDefaultBruteForceThreshold}; size_t max_scan_limit_{VamanaEntity::kDefaultMaxScanLimit}; size_t min_scan_limit_{VamanaEntity::kDefaultMinScanLimit}; - float bf_negative_prob_{VamanaEntity::kDefaultBFNegativeProbability}; float max_scan_ratio_{VamanaEntity::kDefaultScanRatio}; uint32_t magic_{0U}; diff --git a/src/core/algorithm/vamana/vamana_streamer_entity.h b/src/core/algorithm/vamana/vamana_streamer_entity.h index ae29187..87033ed 100644 --- a/src/core/algorithm/vamana/vamana_streamer_entity.h +++ b/src/core/algorithm/vamana/vamana_streamer_entity.h @@ -175,8 +175,8 @@ class VamanaStreamerEntity : public VamanaEntity { use_key_info_map_(use_key_info_map), keys_map_lock_(keys_map_lock), keys_map_(keys_map), - node_chunks_(std::move(node_chunks)), - broker_(broker) { + broker_(broker), + node_chunks_(std::move(node_chunks)) { *mutable_header() = hd; neighbor_size_ = neighbors_size(); } diff --git a/src/core/framework/index_mapping.cc b/src/core/framework/index_mapping.cc index d74806b..7f5f5a1 100644 --- a/src/core/framework/index_mapping.cc +++ b/src/core/framework/index_mapping.cc @@ -135,8 +135,9 @@ int IndexMapping::create(const std::string &path, size_t seg_meta_capacity) { int IndexMapping::init_meta_section() { if (current_header_start_offset_ % ailego::MemoryHelper::PageSize() != 0) { - LOG_ERROR("File offset %llu is not a multiple of the page size: %zu", - current_header_start_offset_, ailego::MemoryHelper::PageSize()); + LOG_ERROR("File offset %zu is not a multiple of the page size: %zu", + (size_t)current_header_start_offset_, + ailego::MemoryHelper::PageSize()); return IndexError_InvalidValue; } @@ -261,7 +262,6 @@ void IndexMapping::close(void) { void IndexMapping::refresh(uint64_t check_point) { // support add_with_id for (auto item : header_addr_map_) { - auto header_start_offset = item.first; auto header = item.second; auto footer = reinterpret_cast( reinterpret_cast(header) + header->meta_footer_offset); @@ -461,8 +461,8 @@ int IndexMapping::flush(void) { auto header = item.second; if (file_.write(header_start_offset, header, header->content_offset) != header->content_offset) { - LOG_ERROR("Failed to write segment, size %llu, %s", - header->content_offset, + LOG_ERROR("Failed to write segment, size %zu, %s", + (size_t)header->content_offset, ailego::FileHelper::GetLastErrorString().c_str()); return IndexError_WriteData; } diff --git a/src/core/interface/indexes/hnsw_rabitq_index.cc b/src/core/interface/indexes/hnsw_rabitq_index.cc index 14c0de2..0c77b05 100644 --- a/src/core/interface/indexes/hnsw_rabitq_index.cc +++ b/src/core/interface/indexes/hnsw_rabitq_index.cc @@ -27,6 +27,7 @@ namespace zvec::core_interface { int HNSWRabitqIndex::CreateAndInitStreamer(const BaseIndexParam ¶m) { #if !RABITQ_SUPPORTED + (void)param; LOG_ERROR("RaBitQ is not supported on this platform (Linux x86_64 only)"); return core::IndexError_Unsupported; #else @@ -87,6 +88,8 @@ int HNSWRabitqIndex::_prepare_for_search( const BaseIndexQueryParam::Pointer &search_param, core::IndexContext::Pointer &context) { #if !RABITQ_SUPPORTED + (void)search_param; + (void)context; LOG_ERROR("RaBitQ is not supported on this platform (Linux x86_64 only)"); return core::IndexError_Unsupported; #else @@ -125,6 +128,7 @@ int HNSWRabitqIndex::_prepare_for_search( int HNSWRabitqIndex::_get_coarse_search_topk( const BaseIndexQueryParam::Pointer &search_param) { #if !RABITQ_SUPPORTED + (void)search_param; LOG_ERROR("RaBitQ is not supported on this platform (Linux x86_64 only)"); return -1; #else diff --git a/src/core/mixed_reducer/mixed_streamer_reducer.cc b/src/core/mixed_reducer/mixed_streamer_reducer.cc index bb84e3d..cf20a1b 100644 --- a/src/core/mixed_reducer/mixed_streamer_reducer.cc +++ b/src/core/mixed_reducer/mixed_streamer_reducer.cc @@ -349,9 +349,6 @@ void MixedStreamerReducer::add_vec(int *result) { void MixedStreamerReducer::add_vec_with_builder(int *result) { ailego::ElapsedTime timer; - auto target_streamer_query_meta = IndexQueryMeta{ - IndexMeta::MetaType::MT_DENSE, target_streamer_->meta().data_type(), - target_streamer_->meta().dimension()}; AILEGO_DEFER([&]() { // make producer quit diff --git a/src/core/quantizer/mips_converter.cc b/src/core/quantizer/mips_converter.cc index 343e157..9f85409 100644 --- a/src/core/quantizer/mips_converter.cc +++ b/src/core/quantizer/mips_converter.cc @@ -532,7 +532,7 @@ class MipsConverter : public IndexConverter { switch (holder->data_type()) { case IndexMeta::DataType::DT_FP16: for (; iter->is_valid(); iter->next()) { - float score; + float score = 0.0f; ailego::Norm2Matrix::Compute( reinterpret_cast(iter->data()), dim, &score); @@ -549,7 +549,7 @@ class MipsConverter : public IndexConverter { case IndexMeta::DataType::DT_FP32: for (; iter->is_valid(); iter->next()) { - float score; + float score = 0.0f; ailego::Norm2Matrix::Compute( reinterpret_cast(iter->data()), dim, &score); diff --git a/src/core/quantizer/mips_reformer.cc b/src/core/quantizer/mips_reformer.cc index 3e76211..106c68e 100644 --- a/src/core/quantizer/mips_reformer.cc +++ b/src/core/quantizer/mips_reformer.cc @@ -111,7 +111,7 @@ class MipsReformer : public IndexReformer { out->resize((qmeta.dimension() + m_value_) * sizeof(ailego::Float16)); if (normalize_) { - float norm; + float norm = 0.0f; ailego::Norm2Matrix::Compute( reinterpret_cast(query), qmeta.dimension(), &norm); @@ -137,7 +137,7 @@ class MipsReformer : public IndexReformer { out->resize((qmeta.dimension() + m_value_) * sizeof(float)); if (normalize_) { - float norm; + float norm = 0.0f; ailego::Normalizer::L2(reinterpret_cast(&(*out)[0]), qmeta.dimension(), &norm); } @@ -155,7 +155,7 @@ class MipsReformer : public IndexReformer { out->resize((qmeta.dimension() + m_value_) * sizeof(ailego::Float16)); if (normalize_) { - float norm; + float norm = 0.0f; ailego::Normalizer::L2( reinterpret_cast(&(*out)[0]), qmeta.dimension(), &norm); @@ -193,7 +193,7 @@ class MipsReformer : public IndexReformer { reinterpret_cast(query) + i * qmeta.dimension(); if (normalize_) { - float norm; + float norm = 0.0f; ailego::Norm2Matrix::Compute(sub_query, qmeta.dimension(), &norm); ailego::FloatHelper::ToFP16( @@ -222,7 +222,7 @@ class MipsReformer : public IndexReformer { out->resize(offset + (qmeta.dimension() + m_value_) * sizeof(float)); if (normalize_) { - float norm; + float norm = 0.0f; ailego::Normalizer::L2( reinterpret_cast(&(*out)[offset]), qmeta.dimension(), &norm); @@ -250,7 +250,7 @@ class MipsReformer : public IndexReformer { (qmeta.dimension() + m_value_) * sizeof(ailego::Float16)); if (normalize_) { - float norm; + float norm = 0.0f; ailego::Normalizer::L2( reinterpret_cast(&(*out)[offset]), qmeta.dimension(), &norm); diff --git a/src/core/utility/buffer_storage.cc b/src/core/utility/buffer_storage.cc index 62d442a..df4e123 100644 --- a/src/core/utility/buffer_storage.cc +++ b/src/core/utility/buffer_storage.cc @@ -179,7 +179,7 @@ class BufferStorage : public IndexStorage { } //! Initialize storage - int init(const ailego::Params ¶ms) override { + int init(const ailego::Params & /*params*/) override { return 0; } @@ -204,9 +204,9 @@ class BufferStorage : public IndexStorage { return ret; } LOG_INFO( - "BufferStorage opened: file=%s, max_segment_size=%lu, " + "BufferStorage opened: file=%s, max_segment_size=%zu, " "segment_count=%zu", - file_name_.c_str(), max_segment_size_, segments_.size()); + file_name_.c_str(), (size_t)max_segment_size_, segments_.size()); return 0; } @@ -515,7 +515,6 @@ class BufferStorage : public IndexStorage { ailego::VecBufferPool::Pointer buffer_pool_{nullptr}; ailego::VecBufferPoolHandle::Pointer buffer_pool_handle_{nullptr}; uint64_t current_header_start_offset_{0u}; - uint64_t buffer_size_{2lu * 1024 * 1024 * 1024}; // 2G }; INDEX_FACTORY_REGISTER_STORAGE(BufferStorage); diff --git a/src/db/index/storage/bufferpool_forward_store.cc b/src/db/index/storage/bufferpool_forward_store.cc index 4d2b2f6..f777507 100644 --- a/src/db/index/storage/bufferpool_forward_store.cc +++ b/src/db/index/storage/bufferpool_forward_store.cc @@ -189,7 +189,6 @@ TablePtr BufferPoolForwardStore::fetch(const std::vector &columns, std::vector>>> sorted_scalars(col_indices.size()); - auto &buf_mgr = ailego::BufferManager::Instance(); for (const auto &[rg_id, pairs] : rg_to_local) { for (size_t i = 0; i < col_indices.size(); ++i) { int col_idx = col_indices[i]; @@ -317,7 +316,6 @@ ExecBatchPtr BufferPoolForwardStore::fetch( int64_t offset = GetRowGroupOffset(rg_id); std::vector scalars; - auto &buf_mgr = ailego::BufferManager::Instance(); for (size_t i = 0; i < col_indices.size(); ++i) { int col_idx = col_indices[i]; auto buffer_id = ailego::ParquetBufferID(file_path_, col_idx, rg_id); diff --git a/src/db/index/storage/lazy_record_batch_reader.h b/src/db/index/storage/lazy_record_batch_reader.h index 422708e..451bba8 100644 --- a/src/db/index/storage/lazy_record_batch_reader.h +++ b/src/db/index/storage/lazy_record_batch_reader.h @@ -127,7 +127,6 @@ class ParquetRecordBatchReader : public arrow::RecordBatchReader { std::vector> chunks(col_indices_.size()); if (with_cache_) { - auto &buf_mgr = ailego::BufferManager::Instance(); for (size_t col_idx = 0; col_idx < col_indices_.size(); ++col_idx) { auto buffer_id = ailego::ParquetBufferID(file_path_, col_idx, rg_id); auto buffer_handle = diff --git a/src/include/zvec/db/schema.h b/src/include/zvec/db/schema.h index bce2a1f..80e6cab 100644 --- a/src/include/zvec/db/schema.h +++ b/src/include/zvec/db/schema.h @@ -77,7 +77,6 @@ class FieldSchema { } FieldSchema(FieldSchema &&) = default; FieldSchema &operator=(FieldSchema &&) = default; - ; ~FieldSchema() = default; public: @@ -304,6 +303,18 @@ class CollectionSchema { max_doc_count_per_segment_ = other.max_doc_count_per_segment_; } + CollectionSchema &operator=(const CollectionSchema &other) { + if (this == &other) { + return *this; + } + name_ = other.name_; + fields_.clear(); + fields_map_.clear(); + copy_fields(other.fields_); + max_doc_count_per_segment_ = other.max_doc_count_per_segment_; + return *this; + } + public: std::string to_string() const; diff --git a/src/turbo/avx512_vnni/record_quantized_int8/common.h b/src/turbo/avx512_vnni/record_quantized_int8/common.h index d1dfb89..465caf6 100644 --- a/src/turbo/avx512_vnni/record_quantized_int8/common.h +++ b/src/turbo/avx512_vnni/record_quantized_int8/common.h @@ -30,7 +30,7 @@ #ifdef _MSC_VER #define TURBO_ALWAYS_INLINE __forceinline #else -#define TURBO_ALWAYS_INLINE __attribute__((always_inline)) +#define TURBO_ALWAYS_INLINE inline __attribute__((always_inline)) #endif namespace zvec::turbo::avx512_vnni::internal { diff --git a/src/turbo/avx512_vnni/record_quantized_int8/cosine.cc b/src/turbo/avx512_vnni/record_quantized_int8/cosine.cc index 54caed6..a3a6b48 100644 --- a/src/turbo/avx512_vnni/record_quantized_int8/cosine.cc +++ b/src/turbo/avx512_vnni/record_quantized_int8/cosine.cc @@ -97,7 +97,7 @@ void cosine_int8_batch_distance(const void *const *vectors, const void *query, float qb = q_tail[1]; float qs = q_tail[2]; - for (int i = 0; i < n; ++i) { + for (size_t i = 0; i < n; ++i) { const float *m_tail = reinterpret_cast( reinterpret_cast(vectors[i]) + original_dim); float ma = m_tail[0]; diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt index a9041d4..8f32b87 100644 --- a/thirdparty/protobuf/CMakeLists.txt +++ b/thirdparty/protobuf/CMakeLists.txt @@ -27,13 +27,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -Wno-unused-function ) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(libprotobuf PRIVATE - -Wno-deprecated-declarations + target_compile_options(libprotobuf PRIVATE + -Wno-deprecated-declarations -Wno-unused-function -Wno-maybe-uninitialized -Wno-sign-compare -Wno-return-type -Wno-stringop-overflow + -Wno-stringop-overread + -Wno-array-bounds ) target_compile_options(libprotoc PRIVATE -Wno-unused-private-field diff --git a/tools/core/local_builder.cc b/tools/core/local_builder.cc index 59ba816..52ae832 100644 --- a/tools/core/local_builder.cc +++ b/tools/core/local_builder.cc @@ -166,6 +166,11 @@ int setup_hnsw_rabitq_streamer(const IndexStreamer::Pointer &streamer, hnsw_rabitq_streamer->set_provider(provider); return 0; #else + (void)streamer; + (void)meta; + (void)config_root; + (void)converter_name; + (void)build_holder; cerr << "HNSW RaBitQ is not supported on this platform" << endl; return -1; #endif @@ -311,20 +316,20 @@ int do_build_sparse_by_streamer(IndexStreamer::Pointer &streamer, add_to_streamer_sparse = [&](uint64_t pkey, const uint32_t sparse_count, const uint32_t *sparse_indices, const void *sparse_query, - const IndexQueryMeta &qmeta, + const IndexQueryMeta &query_meta, IndexContext::Pointer &context) -> int { return streamer->add_impl(pkey, sparse_count, sparse_indices, sparse_query, - qmeta, context); + query_meta, context); }; if (g_disable_id_map) { add_to_streamer_sparse = [&](uint64_t pkey, const uint32_t sparse_count, const uint32_t *sparse_indices, const void *sparse_query, - const IndexQueryMeta &qmeta, + const IndexQueryMeta &query_meta, IndexContext::Pointer &context) -> int { return streamer->add_with_id_impl(static_cast(pkey), sparse_count, sparse_indices, - sparse_query, qmeta, context); + sparse_query, query_meta, context); }; } @@ -490,16 +495,16 @@ int do_build_by_streamer(IndexStreamer::Pointer &streamer, std::function add_to_streamer = [&](uint64_t pkey, const void *query, - const IndexQueryMeta &qmeta, + const IndexQueryMeta &query_meta, IndexContext::Pointer &context) -> int { - return streamer->add_impl(pkey, query, qmeta, context); + return streamer->add_impl(pkey, query, query_meta, context); }; if (g_disable_id_map) { add_to_streamer = [&](uint64_t pkey, const void *query, - const IndexQueryMeta &qmeta, + const IndexQueryMeta &query_meta, IndexStreamer::Context::Pointer &context) -> int { return streamer->add_with_id_impl(static_cast(pkey), query, - qmeta, context); + query_meta, context); }; }