diff --git a/examples/c++/core/main.cc b/examples/c++/core/main.cc index d269c894..ac941f14 100644 --- a/examples/c++/core/main.cc +++ b/examples/c++/core/main.cc @@ -1,3 +1,89 @@ +#include +#include +#include +#include +#include +#include + +using namespace zvec::core_interface; + +constexpr uint32_t kDimension = 64; +const std::string index_name{"test.index"}; + +Index::Pointer create_index(const BaseIndexParam::Pointer ¶m, + int doc_num = 10) { + auto index = IndexFactory::CreateAndInitIndex(*param); + if (!index) { + std::cout << "Failed to create index." << std::endl; + return nullptr; + } + + int ret = index->Open( + index_name, StorageOptions{StorageOptions::StorageType::kMMAP, true}); + if (ret != 0) { + std::cout << "Failed to open index." << std::endl; + return nullptr; + } + + for (int i = 0; i < doc_num; ++i) { + std::vector vector(kDimension, i / 10.0f + 0.1f); + VectorData vector_data; + vector_data.vector = DenseVector{vector.data()}; + ret = index->Add(vector_data, i); + if (ret != 0) { + std::cout << "Failed to add to index." << std::endl; + return nullptr; + } + } + + ret = index->Train(); + if (ret != 0) { + std::cout << "Failed to train index." << std::endl; + return nullptr; + } + + return index; +} + int main() { + char cmd_buf[100]; + snprintf(cmd_buf, 100, "rm -f %s", index_name.c_str()); + system(cmd_buf); + + auto param = HNSWIndexParamBuilder() + .WithMetricType(MetricType::kInnerProduct) + .WithDataType(DataType::DT_FP32) + .WithDimension(kDimension) + .WithIsSparse(false) + .Build(); + auto index = create_index(param, 1); + std::cout << "index stats: " << index->GetDocCount() << std::endl; + + // query + auto query_param = HNSWQueryParamBuilder() + .with_topk(10) + .with_fetch_vector(true) + .with_ef_search(20) + .build(); + + SearchResult result; + VectorData query; + std::vector vector(kDimension, 0.1f); + query.vector = DenseVector{vector.data()}; + int ret = index->Search(query, query_param, &result); + if (ret != 0) { + std::cout << "Failed to search index." << std::endl; + return -1; + } + + std::cout << "query results: " << result.doc_list_.size() << std::endl; + if (result.doc_list_.size() == 0) { + std::cout << "No results found." << std::endl; + return -1; + } + + std::cout << "key: " << result.doc_list_[0].key() + << ", score: " << result.doc_list_[0].score() << std::endl; + return 0; } \ No newline at end of file diff --git a/src/ailego/algorithm/binary_quantizer.h b/src/ailego/algorithm/binary_quantizer.h index 89057feb..f2dd8475 100644 --- a/src/ailego/algorithm/binary_quantizer.h +++ b/src/ailego/algorithm/binary_quantizer.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/algorithm/integer_quantizer.cc b/src/ailego/algorithm/integer_quantizer.cc index 0b072937..a637306b 100644 --- a/src/ailego/algorithm/integer_quantizer.cc +++ b/src/ailego/algorithm/integer_quantizer.cc @@ -17,8 +17,8 @@ #include #include #include -#include #include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/algorithm/integer_quantizer.h b/src/ailego/algorithm/integer_quantizer.h index 07a77e57..cdaf38ad 100644 --- a/src/ailego/algorithm/integer_quantizer.h +++ b/src/ailego/algorithm/integer_quantizer.h @@ -16,7 +16,7 @@ #include #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/algorithm/kmeans.h b/src/ailego/algorithm/kmeans.h index 1a928d09..097b71ec 100644 --- a/src/ailego/algorithm/kmeans.h +++ b/src/ailego/algorithm/kmeans.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -25,8 +24,10 @@ #include #include #include -#include +#include +#include #include +#include #include "lloyd_cluster.h" namespace zvec { diff --git a/src/ailego/algorithm/lloyd_cluster.h b/src/ailego/algorithm/lloyd_cluster.h index 42276339..f7f3c96f 100644 --- a/src/ailego/algorithm/lloyd_cluster.h +++ b/src/ailego/algorithm/lloyd_cluster.h @@ -17,8 +17,8 @@ #include #include #include -#include -#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/buffer/buffer_manager.cc b/src/ailego/buffer/buffer_manager.cc index acdb37b6..ac2945b0 100644 --- a/src/ailego/buffer/buffer_manager.cc +++ b/src/ailego/buffer/buffer_manager.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "buffer_manager.h" #include #include -#include #include #include #include -#include "ailego/internal/platform.h" +#include +#include +#include #ifdef __clang__ #pragma clang diagnostic push diff --git a/src/ailego/container/bitmap.h b/src/ailego/container/bitmap.h index c95dcf7c..72d5b50d 100644 --- a/src/ailego/container/bitmap.h +++ b/src/ailego/container/bitmap.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/container/bloom_filter.h b/src/ailego/container/bloom_filter.h index 714032ec..9a8cacd9 100644 --- a/src/ailego/container/bloom_filter.h +++ b/src/ailego/container/bloom_filter.h @@ -15,8 +15,8 @@ #pragma once #include -#include -#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/container/params.cc b/src/ailego/container/params.cc index cd62e7b4..33e731af 100644 --- a/src/ailego/container/params.cc +++ b/src/ailego/container/params.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "params.h" #include -#include -#include "ailego/logger/logger.h" +#include +#include +#include //! Global environ variable extern char **environ; diff --git a/src/ailego/container/vector_array.h b/src/ailego/container/vector_array.h index dfc82ef4..fe7a9142 100644 --- a/src/ailego/container/vector_array.h +++ b/src/ailego/container/vector_array.h @@ -14,8 +14,8 @@ #pragma once -#include "ailego/internal/platform.h" -#include "vector.h" +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/encoding/json/mod_json.c b/src/ailego/encoding/json/mod_json.c index aff816f3..ea6a1103 100644 --- a/src/ailego/encoding/json/mod_json.c +++ b/src/ailego/encoding/json/mod_json.c @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "mod_json.h" #include #include #include #include +#include #ifndef MOD_JSON_TOKEN_DEFOPTS #define MOD_JSON_TOKEN_DEFOPTS 0 /* default options of token */ diff --git a/src/ailego/hash/crc32c.cc b/src/ailego/hash/crc32c.cc index 20157dfa..bb5ab58e 100644 --- a/src/ailego/hash/crc32c.cc +++ b/src/ailego/hash/crc32c.cc @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "crc32c.h" #include +#include +#include #if !defined(__SSE4_2__) && !defined(__ARM_FEATURE_CRC32) /** diff --git a/src/ailego/io/file.cc b/src/ailego/io/file.cc index 63bc162a..79e58a1c 100644 --- a/src/ailego/io/file.cc +++ b/src/ailego/io/file.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "file.h" -#include "ailego/internal/platform.h" +#include +#include #if !defined(_WIN64) && !defined(_WIN32) #include #include diff --git a/src/ailego/io/file_lock.h b/src/ailego/io/file_lock.h index 5e79f51b..a571d547 100644 --- a/src/ailego/io/file_lock.h +++ b/src/ailego/io/file_lock.h @@ -14,7 +14,7 @@ #pragma once -#include "file.h" +#include namespace zvec { namespace ailego { diff --git a/src/ailego/logger/logger.cc b/src/ailego/logger/logger.cc index 69bf2baf..deecb885 100644 --- a/src/ailego/logger/logger.cc +++ b/src/ailego/logger/logger.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "logger.h" #include #include #include -#include -#include +#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/math/cosine_distance_matrix.h b/src/ailego/math/cosine_distance_matrix.h index 8f4aabda..2f5ab51f 100644 --- a/src/ailego/math/cosine_distance_matrix.h +++ b/src/ailego/math/cosine_distance_matrix.h @@ -14,13 +14,9 @@ #pragma once -#include -#include -#include -#include -#include "distance_utility.h" +#include +#include #include "inner_product_matrix.h" -#include "norm2_matrix.h" namespace zvec { namespace ailego { diff --git a/src/ailego/math/distance_matrix_fp16.i b/src/ailego/math/distance_matrix_fp16.i index ac8b4346..26ab75f0 100644 --- a/src/ailego/math/distance_matrix_fp16.i +++ b/src/ailego/math/distance_matrix_fp16.i @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include "matrix_define.i" #include #if !defined(__AVX__) diff --git a/src/ailego/math/distance_matrix_fp32.i b/src/ailego/math/distance_matrix_fp32.i index 4f610d6e..a9ddcd07 100644 --- a/src/ailego/math/distance_matrix_fp32.i +++ b/src/ailego/math/distance_matrix_fp32.i @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include "matrix_define.i" #if !defined(__AVX__) diff --git a/src/ailego/math/distance_matrix_int32.i b/src/ailego/math/distance_matrix_int32.i index 867d92d5..fbbd5a4f 100644 --- a/src/ailego/math/distance_matrix_int32.i +++ b/src/ailego/math/distance_matrix_int32.i @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include "matrix_define.i" #if defined(__AVX__) && defined(__GNUC__) diff --git a/src/ailego/math/distance_matrix_int64.i b/src/ailego/math/distance_matrix_int64.i index 63603099..0364d1ec 100644 --- a/src/ailego/math/distance_matrix_int64.i +++ b/src/ailego/math/distance_matrix_int64.i @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include "matrix_define.i" #if defined(__AVX__) diff --git a/src/ailego/math/distance_utility.h b/src/ailego/math/distance_utility.h index 070745a9..b892e2a3 100644 --- a/src/ailego/math/distance_utility.h +++ b/src/ailego/math/distance_utility.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/math/euclidean_distance_matrix.h b/src/ailego/math/euclidean_distance_matrix.h index a70d3bb5..91555070 100644 --- a/src/ailego/math/euclidean_distance_matrix.h +++ b/src/ailego/math/euclidean_distance_matrix.h @@ -14,9 +14,9 @@ #pragma once -#include #include -#include +#include +#include #include "distance_utility.h" namespace zvec { diff --git a/src/ailego/math/hamming_distance_matrix.cc b/src/ailego/math/hamming_distance_matrix.cc index 7e7d0581..0e990d4c 100644 --- a/src/ailego/math/hamming_distance_matrix.cc +++ b/src/ailego/math/hamming_distance_matrix.cc @@ -13,6 +13,8 @@ // limitations under the License. #include "hamming_distance_matrix.h" +#include +#include #include "distance_matrix_popcnt.i" namespace zvec { diff --git a/src/ailego/math/hamming_distance_matrix.h b/src/ailego/math/hamming_distance_matrix.h index ace83970..5178e161 100644 --- a/src/ailego/math/hamming_distance_matrix.h +++ b/src/ailego/math/hamming_distance_matrix.h @@ -15,8 +15,8 @@ #pragma once #include -#include -#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/math/inner_product_matrix.h b/src/ailego/math/inner_product_matrix.h index 71ac75cc..e1e87183 100644 --- a/src/ailego/math/inner_product_matrix.h +++ b/src/ailego/math/inner_product_matrix.h @@ -17,9 +17,9 @@ #include #include #include -#include #include -#include +#include +#include #include "distance_utility.h" namespace zvec { diff --git a/src/ailego/math/matrix_utility.i b/src/ailego/math/matrix_utility.i index c8c42971..34951478 100644 --- a/src/ailego/math/matrix_utility.i +++ b/src/ailego/math/matrix_utility.i @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/math/mips_euclidean_distance_matrix.h b/src/ailego/math/mips_euclidean_distance_matrix.h index 162228cc..666d16ce 100644 --- a/src/ailego/math/mips_euclidean_distance_matrix.h +++ b/src/ailego/math/mips_euclidean_distance_matrix.h @@ -14,10 +14,10 @@ #pragma once -#include #include #include -#include +#include +#include #include "distance_utility.h" namespace zvec { diff --git a/src/ailego/math/norm1_matrix.h b/src/ailego/math/norm1_matrix.h index 3e23fa45..7e8d9cbc 100644 --- a/src/ailego/math/norm1_matrix.h +++ b/src/ailego/math/norm1_matrix.h @@ -14,10 +14,9 @@ #pragma once -#include -#include #include -#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/math/norm1_matrix_fp16.cc b/src/ailego/math/norm1_matrix_fp16.cc index 2238605d..ce36de7e 100644 --- a/src/ailego/math/norm1_matrix_fp16.cc +++ b/src/ailego/math/norm1_matrix_fp16.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include "norm1_matrix.h" #include "norm_matrix_fp16.i" diff --git a/src/ailego/math/norm1_matrix_fp32.cc b/src/ailego/math/norm1_matrix_fp32.cc index de4205b8..15bd3f73 100644 --- a/src/ailego/math/norm1_matrix_fp32.cc +++ b/src/ailego/math/norm1_matrix_fp32.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include "norm1_matrix.h" #include "norm_matrix_fp32.i" diff --git a/src/ailego/math/norm2_matrix.h b/src/ailego/math/norm2_matrix.h index 9d976cf4..3c905147 100644 --- a/src/ailego/math/norm2_matrix.h +++ b/src/ailego/math/norm2_matrix.h @@ -15,9 +15,9 @@ #pragma once #include -#include #include -#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/math/norm2_matrix_fp16.cc b/src/ailego/math/norm2_matrix_fp16.cc index 5c0579eb..28dbadb9 100644 --- a/src/ailego/math/norm2_matrix_fp16.cc +++ b/src/ailego/math/norm2_matrix_fp16.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include "norm2_matrix.h" #include "norm_matrix_fp16.i" diff --git a/src/ailego/math_batch/cosine_distance_batch.h b/src/ailego/math_batch/cosine_distance_batch.h index d0185d36..b8a8309a 100644 --- a/src/ailego/math_batch/cosine_distance_batch.h +++ b/src/ailego/math_batch/cosine_distance_batch.h @@ -16,9 +16,9 @@ #include #include -#include #include -#include +#include +#include #include "inner_product_distance_batch.h" namespace zvec::ailego::DistanceBatch { diff --git a/src/ailego/math_batch/distance_batch.h b/src/ailego/math_batch/distance_batch.h index 8301ac67..87a80ebb 100644 --- a/src/ailego/math_batch/distance_batch.h +++ b/src/ailego/math_batch/distance_batch.h @@ -14,7 +14,7 @@ #pragma once -#include +#include "ailego/math/distance_matrix.h" #include "cosine_distance_batch.h" #include "inner_product_distance_batch.h" #include "utils.h" diff --git a/src/ailego/math_batch/inner_product_distance_batch.h b/src/ailego/math_batch/inner_product_distance_batch.h index 66553ff8..3a65a275 100644 --- a/src/ailego/math_batch/inner_product_distance_batch.h +++ b/src/ailego/math_batch/inner_product_distance_batch.h @@ -16,9 +16,9 @@ #include #include -#include #include -#include +#include +#include #include "inner_product_distance_batch_impl.h" #include "inner_product_distance_batch_impl_fp16.h" #include "inner_product_distance_batch_impl_int8.h" diff --git a/src/ailego/math_batch/inner_product_distance_batch_impl.h b/src/ailego/math_batch/inner_product_distance_batch_impl.h index bfe8fc69..1554426f 100644 --- a/src/ailego/math_batch/inner_product_distance_batch_impl.h +++ b/src/ailego/math_batch/inner_product_distance_batch_impl.h @@ -15,10 +15,10 @@ #pragma once #include -#include #include #include -#include +#include +#include namespace zvec::ailego::DistanceBatch { diff --git a/src/ailego/math_batch/inner_product_distance_batch_impl_fp16.h b/src/ailego/math_batch/inner_product_distance_batch_impl_fp16.h index 7f4f72ea..db9e81e0 100644 --- a/src/ailego/math_batch/inner_product_distance_batch_impl_fp16.h +++ b/src/ailego/math_batch/inner_product_distance_batch_impl_fp16.h @@ -15,10 +15,10 @@ #pragma once #include -#include #include #include -#include +#include +#include namespace zvec::ailego::DistanceBatch { diff --git a/src/ailego/math_batch/inner_product_distance_batch_impl_int8.h b/src/ailego/math_batch/inner_product_distance_batch_impl_int8.h index 2f5be38b..9f49effd 100644 --- a/src/ailego/math_batch/inner_product_distance_batch_impl_int8.h +++ b/src/ailego/math_batch/inner_product_distance_batch_impl_int8.h @@ -15,9 +15,9 @@ #pragma once #include -#include #include -#include +#include +#include namespace zvec::ailego::DistanceBatch { diff --git a/src/ailego/math_batch/utils.h b/src/ailego/math_batch/utils.h index 15f37a4e..4b19b0db 100644 --- a/src/ailego/math_batch/utils.h +++ b/src/ailego/math_batch/utils.h @@ -14,9 +14,6 @@ #pragma once -#include -#include - namespace zvec::ailego::DistanceBatch { typedef void (*DistanceBatchQueryPreprocessFunc)(void *query, size_t dim); diff --git a/src/ailego/parallel/lock.h b/src/ailego/parallel/lock.h index 7bbd457f..0d19f1a6 100644 --- a/src/ailego/parallel/lock.h +++ b/src/ailego/parallel/lock.h @@ -20,8 +20,8 @@ #if __cplusplus >= 201703L #include #endif -#include #include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/parallel/semaphore.h b/src/ailego/parallel/semaphore.h index 263a1f4e..89fdbefd 100644 --- a/src/ailego/parallel/semaphore.h +++ b/src/ailego/parallel/semaphore.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/parallel/thread_pool.cc b/src/ailego/parallel/thread_pool.cc index fff37889..54a8970e 100644 --- a/src/ailego/parallel/thread_pool.cc +++ b/src/ailego/parallel/thread_pool.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "thread_pool.h" +#include #if (defined(__linux) || defined(__linux__)) && !defined(__ANDROID__) #include diff --git a/src/ailego/pattern/scope_guard.h b/src/ailego/pattern/scope_guard.h index f37feaa2..075fd399 100644 --- a/src/ailego/pattern/scope_guard.h +++ b/src/ailego/pattern/scope_guard.h @@ -14,7 +14,7 @@ #pragma once -#include "closure.h" +#include namespace zvec { namespace ailego { diff --git a/src/ailego/utility/bit_string_helper.h b/src/ailego/utility/bit_string_helper.h index 43fef95d..a50e1eeb 100644 --- a/src/ailego/utility/bit_string_helper.h +++ b/src/ailego/utility/bit_string_helper.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include namespace zvec { diff --git a/src/ailego/utility/bitset_helper.cc b/src/ailego/utility/bitset_helper.cc index a4e61fff..19be3484 100644 --- a/src/ailego/utility/bitset_helper.cc +++ b/src/ailego/utility/bitset_helper.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "bitset_helper.h" +#include #ifndef __SSE4_2__ #define bitset_popcount32 ailego_popcount32 diff --git a/src/ailego/utility/bitset_helper.h b/src/ailego/utility/bitset_helper.h index a759b68a..56ac7e93 100644 --- a/src/ailego/utility/bitset_helper.h +++ b/src/ailego/utility/bitset_helper.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include namespace zvec { diff --git a/src/ailego/utility/concurrency_helper.cc b/src/ailego/utility/concurrency_helper.cc index 08b47132..3f79c9ca 100644 --- a/src/ailego/utility/concurrency_helper.cc +++ b/src/ailego/utility/concurrency_helper.cc @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include "file_helper.h" namespace zvec { namespace ailego { diff --git a/src/ailego/utility/dl_helper.h b/src/ailego/utility/dl_helper.h index 4ae1c8e3..d72b0dc3 100644 --- a/src/ailego/utility/dl_helper.h +++ b/src/ailego/utility/dl_helper.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/utility/file_helper.cc b/src/ailego/utility/file_helper.cc index 095fb826..1ea6a802 100644 --- a/src/ailego/utility/file_helper.cc +++ b/src/ailego/utility/file_helper.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "file_helper.h" +#include #if defined(_WIN32) || defined(_WIN64) #include diff --git a/src/ailego/utility/float_helper.cc b/src/ailego/utility/float_helper.cc index c2a8b96c..6e33fedd 100644 --- a/src/ailego/utility/float_helper.cc +++ b/src/ailego/utility/float_helper.cc @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include // #if defined(__F16C__) && defined(__AVX__) diff --git a/src/ailego/utility/matrix_helper.h b/src/ailego/utility/matrix_helper.h index 2fea3572..1a05ad5f 100644 --- a/src/ailego/utility/matrix_helper.h +++ b/src/ailego/utility/matrix_helper.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/utility/memory_helper.cc b/src/ailego/utility/memory_helper.cc index bb4ef8d3..8d99ca2a 100644 --- a/src/ailego/utility/memory_helper.cc +++ b/src/ailego/utility/memory_helper.cc @@ -16,10 +16,8 @@ #include #include #include -#include -#include +#include #include -#include "file_helper.h" #if defined(_WIN64) || defined(_WIN32) #include diff --git a/src/ailego/utility/memory_helper.h b/src/ailego/utility/memory_helper.h index b145f034..b6104a84 100644 --- a/src/ailego/utility/memory_helper.h +++ b/src/ailego/utility/memory_helper.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/utility/process_helper.h b/src/ailego/utility/process_helper.h index f28594b0..d1fa2375 100644 --- a/src/ailego/utility/process_helper.h +++ b/src/ailego/utility/process_helper.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/utility/time_helper.cc b/src/ailego/utility/time_helper.cc index 36b63c18..4bcca6f2 100644 --- a/src/ailego/utility/time_helper.cc +++ b/src/ailego/utility/time_helper.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "time_helper.h" +#include #if defined(_WIN64) || defined(_WIN32) #include diff --git a/src/ailego/version.i b/src/ailego/version.i index 198dbb83..c1b14be2 100644 --- a/src/ailego/version.i +++ b/src/ailego/version.i @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ailego/internal/platform.h" +#include #ifndef AILEGO_VERSION_TO_STRING_ #define AILEGO_VERSION_TO_STRING_(x) #x diff --git a/src/core/algorithm/cluster/kmeans_cluster.cc b/src/core/algorithm/cluster/kmeans_cluster.cc index 21ccf409..507159b8 100644 --- a/src/core/algorithm/cluster/kmeans_cluster.cc +++ b/src/core/algorithm/cluster/kmeans_cluster.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include #include -#include "framework/index_cluster.h" -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include +#include +#include #include "cluster_params.h" #include "linear_seeker.h" #include "vector_mean.h" diff --git a/src/core/algorithm/cluster/opt_kmeans_cluster.cc b/src/core/algorithm/cluster/opt_kmeans_cluster.cc index b1b7c761..49ae8f5f 100644 --- a/src/core/algorithm/cluster/opt_kmeans_cluster.cc +++ b/src/core/algorithm/cluster/opt_kmeans_cluster.cc @@ -13,9 +13,9 @@ // limitations under the License. #include #include -#include "framework/index_cluster.h" -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include +#include #include "cluster_params.h" namespace zvec { diff --git a/src/core/algorithm/cluster/seeker.h b/src/core/algorithm/cluster/seeker.h index 46af1154..6f14f57a 100644 --- a/src/core/algorithm/cluster/seeker.h +++ b/src/core/algorithm/cluster/seeker.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_framework.h" +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/cluster/stratified_cluster.cc b/src/core/algorithm/cluster/stratified_cluster.cc index 09a031fb..ae529c27 100644 --- a/src/core/algorithm/cluster/stratified_cluster.cc +++ b/src/core/algorithm/cluster/stratified_cluster.cc @@ -11,10 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include -#include "framework/index_cluster.h" -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include +#include +#include #include "cluster_params.h" namespace zvec { diff --git a/src/core/algorithm/cluster/stratified_cluster_trainer.cc b/src/core/algorithm/cluster/stratified_cluster_trainer.cc index e2f96a68..2b47075c 100644 --- a/src/core/algorithm/cluster/stratified_cluster_trainer.cc +++ b/src/core/algorithm/cluster/stratified_cluster_trainer.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "stratified_cluster_trainer.h" -#include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_helper.h" +#include +#include +#include +#include #include "cluster_params.h" namespace zvec { diff --git a/src/core/algorithm/cluster/stratified_cluster_trainer.h b/src/core/algorithm/cluster/stratified_cluster_trainer.h index 08f58756..0a82c1ec 100644 --- a/src/core/algorithm/cluster/stratified_cluster_trainer.h +++ b/src/core/algorithm/cluster/stratified_cluster_trainer.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "framework/index_cluster.h" -#include "framework/index_trainer.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/cluster/vector_mean.h b/src/core/algorithm/cluster/vector_mean.h index 529f19c3..43c91536 100644 --- a/src/core/algorithm/cluster/vector_mean.h +++ b/src/core/algorithm/cluster/vector_mean.h @@ -17,9 +17,9 @@ #include #include #include -#include -#include +#include #include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/flat/flat_builder.h b/src/core/algorithm/flat/flat_builder.h index 78af5aac..5a48c6e5 100644 --- a/src/core/algorithm/flat/flat_builder.h +++ b/src/core/algorithm/flat/flat_builder.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include -#include +#include +#include #include "flat_utility.h" namespace zvec { diff --git a/src/core/algorithm/flat/flat_searcher.cc b/src/core/algorithm/flat/flat_searcher.cc index 8c9b918f..ef4e7d4b 100644 --- a/src/core/algorithm/flat/flat_searcher.cc +++ b/src/core/algorithm/flat/flat_searcher.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "flat_searcher.h" -#include -#include +#include +#include #include "flat_distance_matrix.h" #include "flat_searcher_context.h" #include "flat_searcher_provider.h" diff --git a/src/core/algorithm/flat/flat_searcher.h b/src/core/algorithm/flat/flat_searcher.h index 12eccd6a..78dcb1d3 100644 --- a/src/core/algorithm/flat/flat_searcher.h +++ b/src/core/algorithm/flat/flat_searcher.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include -#include "framework/index_searcher.h" +#include +#include #include "flat_distance_matrix.h" #include "flat_index_format.h" diff --git a/src/core/algorithm/flat/flat_searcher_context.h b/src/core/algorithm/flat/flat_searcher_context.h index f92b679d..a50e4754 100644 --- a/src/core/algorithm/flat/flat_searcher_context.h +++ b/src/core/algorithm/flat/flat_searcher_context.h @@ -14,8 +14,8 @@ #pragma once -#include -#include +#include +#include #include "flat_index_format.h" #include "flat_searcher.h" #include "flat_utility.h" diff --git a/src/core/algorithm/flat/flat_streamer.cc b/src/core/algorithm/flat/flat_streamer.cc index 20830b7f..a721cf5b 100644 --- a/src/core/algorithm/flat/flat_streamer.cc +++ b/src/core/algorithm/flat/flat_streamer.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "flat_streamer.h" -#include +#include #include "flat_streamer_context.h" #include "flat_streamer_dumper.h" #include "flat_streamer_provider.h" diff --git a/src/core/algorithm/flat/flat_streamer.h b/src/core/algorithm/flat/flat_streamer.h index dde1f40f..66ceba6a 100644 --- a/src/core/algorithm/flat/flat_streamer.h +++ b/src/core/algorithm/flat/flat_streamer.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include #include "flat_streamer_entity.h" #include "flat_utility.h" diff --git a/src/core/algorithm/flat/flat_streamer_entity.cc b/src/core/algorithm/flat/flat_streamer_entity.cc index 639f3838..988f5fdf 100644 --- a/src/core/algorithm/flat/flat_streamer_entity.cc +++ b/src/core/algorithm/flat/flat_streamer_entity.cc @@ -14,7 +14,7 @@ #include "flat_streamer_entity.h" #include -#include "framework/index_error.h" +#include #include "flat_utility.h" namespace zvec { diff --git a/src/core/algorithm/flat/flat_streamer_entity.h b/src/core/algorithm/flat/flat_streamer_entity.h index 06c691da..6ac410a8 100644 --- a/src/core/algorithm/flat/flat_streamer_entity.h +++ b/src/core/algorithm/flat/flat_streamer_entity.h @@ -17,10 +17,10 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include #include "flat_index_format.h" #include "flat_utility.h" diff --git a/src/core/algorithm/flat/flat_utility.h b/src/core/algorithm/flat/flat_utility.h index 3689ecce..a8e05bc6 100644 --- a/src/core/algorithm/flat/flat_utility.h +++ b/src/core/algorithm/flat/flat_utility.h @@ -15,11 +15,11 @@ #include #include -#include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_meta.h" -#include "framework/index_metric.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_builder.cc b/src/core/algorithm/flat_sparse/flat_sparse_builder.cc index 1ed689f1..34fcda5b 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_builder.cc +++ b/src/core/algorithm/flat_sparse/flat_sparse_builder.cc @@ -16,10 +16,10 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include #include "flat_sparse_index_format.h" #include "flat_sparse_utility.h" diff --git a/src/core/algorithm/flat_sparse/flat_sparse_builder.h b/src/core/algorithm/flat_sparse/flat_sparse_builder.h index 4e9f2b10..de439d8a 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_builder.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_builder.h @@ -15,11 +15,11 @@ #pragma once #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_context.h b/src/core/algorithm/flat_sparse/flat_sparse_context.h index 48f5a6af..95d397c5 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_context.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_context.h @@ -15,9 +15,9 @@ #pragma once #include -#include -#include #include +#include +#include #include "flat_sparse_entity.h" #include "flat_sparse_searcher.h" #include "flat_sparse_streamer.h" diff --git a/src/core/algorithm/flat_sparse/flat_sparse_entity.h b/src/core/algorithm/flat_sparse/flat_sparse_entity.h index 7b1e0f8c..daa3f860 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_entity.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_entity.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include #include "flat_sparse_index_format.h" namespace zvec { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_index_format.h b/src/core/algorithm/flat_sparse/flat_sparse_index_format.h index e1414806..23b59749 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_index_format.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_index_format.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_provider.h b/src/core/algorithm/flat_sparse/flat_sparse_provider.h index 0f50b4c4..ce758f82 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_provider.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_provider.h @@ -15,9 +15,9 @@ #pragma once #include -#include #include -#include "framework/index_logger.h" +#include +#include #include "flat_sparse_streamer_entity.h" namespace zvec { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_searcher.cc b/src/core/algorithm/flat_sparse/flat_sparse_searcher.cc index 4094825c..3e9fce03 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_searcher.cc +++ b/src/core/algorithm/flat_sparse/flat_sparse_searcher.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "flat_sparse_searcher.h" -#include #include +#include #include "flat_sparse_context.h" #include "flat_sparse_provider.h" #include "flat_sparse_search.h" diff --git a/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.cc b/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.cc index f0d331aa..91357a59 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.cc +++ b/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "flat_sparse_searcher_entity.h" -#include -#include +#include +#include #include "flat_sparse_utility.h" namespace zvec { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.h b/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.h index 32f8d8da..f87c294e 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_searcher_entity.h @@ -14,7 +14,7 @@ #pragma once -#include +#include #include "flat_sparse_entity.h" #include "flat_sparse_index_format.h" diff --git a/src/core/algorithm/flat_sparse/flat_sparse_streamer.cc b/src/core/algorithm/flat_sparse/flat_sparse_streamer.cc index 7d2815dd..4df83d8f 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_streamer.cc +++ b/src/core/algorithm/flat_sparse/flat_sparse_streamer.cc @@ -14,10 +14,10 @@ #include "flat_sparse_streamer.h" #include -#include #include -#include "framework/index_error.h" -#include "framework/index_meta.h" +#include +#include +#include #include "flat_sparse_context.h" #include "flat_sparse_provider.h" #include "flat_sparse_search.h" diff --git a/src/core/algorithm/flat_sparse/flat_sparse_streamer.h b/src/core/algorithm/flat_sparse/flat_sparse_streamer.h index fa443dcd..794d49bf 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_streamer.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_streamer.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include #include "flat_sparse_streamer_entity.h" namespace zvec { diff --git a/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.cc b/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.cc index 3e294a66..53d8a24c 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.cc +++ b/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.cc @@ -16,11 +16,11 @@ #include #include #include -#include #include -#include "ailego/utility/time_helper.h" -#include "framework/index_error.h" -#include "framework/index_logger.h" +#include +#include +#include +#include #include "flat_sparse_index_format.h" #include "flat_sparse_utility.h" diff --git a/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.h b/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.h index d1adff4d..6ef2f9fa 100644 --- a/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.h +++ b/src/core/algorithm/flat_sparse/flat_sparse_streamer_entity.h @@ -20,11 +20,11 @@ #include #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include "flat_sparse_entity.h" #include "flat_sparse_index_format.h" #include "flat_sparse_utility.h" diff --git a/src/core/algorithm/hnsw/hnsw_builder.cc b/src/core/algorithm/hnsw/hnsw_builder.cc index 301c655c..73de7ae6 100644 --- a/src/core/algorithm/hnsw/hnsw_builder.cc +++ b/src/core/algorithm/hnsw/hnsw_builder.cc @@ -15,9 +15,9 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_logger.h" +#include +#include +#include #include "hnsw_algorithm.h" #include "hnsw_params.h" diff --git a/src/core/algorithm/hnsw/hnsw_builder.h b/src/core/algorithm/hnsw/hnsw_builder.h index e85534a1..e1145283 100644 --- a/src/core/algorithm/hnsw/hnsw_builder.h +++ b/src/core/algorithm/hnsw/hnsw_builder.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include -#include "framework/index_builder.h" +#include +#include #include "hnsw_algorithm.h" #include "hnsw_builder_entity.h" diff --git a/src/core/algorithm/hnsw/hnsw_builder_entity.cc b/src/core/algorithm/hnsw/hnsw_builder_entity.cc index 380eade6..472d98ee 100644 --- a/src/core/algorithm/hnsw/hnsw_builder_entity.cc +++ b/src/core/algorithm/hnsw/hnsw_builder_entity.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "hnsw_builder_entity.h" #include -#include +#include #include "utility/sparse_utility.h" namespace zvec { diff --git a/src/core/algorithm/hnsw/hnsw_builder_entity.h b/src/core/algorithm/hnsw/hnsw_builder_entity.h index 5edfd6d3..1708e338 100644 --- a/src/core/algorithm/hnsw/hnsw_builder_entity.h +++ b/src/core/algorithm/hnsw/hnsw_builder_entity.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include +#include #include "hnsw_entity.h" namespace zvec { diff --git a/src/core/algorithm/hnsw/hnsw_chunk.cc b/src/core/algorithm/hnsw/hnsw_chunk.cc index 166aa043..a1e8891c 100644 --- a/src/core/algorithm/hnsw/hnsw_chunk.cc +++ b/src/core/algorithm/hnsw/hnsw_chunk.cc @@ -14,12 +14,12 @@ #include "hnsw_chunk.h" #include #include -#include -#include -#include "framework/index_error.h" -#include "framework/index_helper.h" -#include "framework/index_logger.h" -#include "framework/index_streamer.h" +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/hnsw/hnsw_chunk.h b/src/core/algorithm/hnsw/hnsw_chunk.h index 5633b0b5..b19d3094 100644 --- a/src/core/algorithm/hnsw/hnsw_chunk.h +++ b/src/core/algorithm/hnsw/hnsw_chunk.h @@ -19,13 +19,13 @@ #include #include #include -#include #include +#include #include -#include "framework/index_error.h" -#include "framework/index_logger.h" -#include "framework/index_storage.h" -#include "framework/index_streamer.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/hnsw/hnsw_context.h b/src/core/algorithm/hnsw/hnsw_context.h index 88c6f4f2..3358e863 100644 --- a/src/core/algorithm/hnsw/hnsw_context.h +++ b/src/core/algorithm/hnsw/hnsw_context.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_context.h" +#include #include "utility/sparse_utility.h" #include "utility/visit_filter.h" #include "hnsw_dist_calculator.h" diff --git a/src/core/algorithm/hnsw/hnsw_dist_calculator.h b/src/core/algorithm/hnsw/hnsw_dist_calculator.h index fa86ea15..84faba40 100644 --- a/src/core/algorithm/hnsw/hnsw_dist_calculator.h +++ b/src/core/algorithm/hnsw/hnsw_dist_calculator.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_meta.h" +#include #include "hnsw_entity.h" namespace zvec { diff --git a/src/core/algorithm/hnsw/hnsw_entity.cc b/src/core/algorithm/hnsw/hnsw_entity.cc index d5b34216..24a3af56 100644 --- a/src/core/algorithm/hnsw/hnsw_entity.cc +++ b/src/core/algorithm/hnsw/hnsw_entity.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "hnsw_entity.h" -#include "framework/index_stats.h" +#include #include "utility/sparse_utility.h" namespace zvec { diff --git a/src/core/algorithm/hnsw/hnsw_entity.h b/src/core/algorithm/hnsw/hnsw_entity.h index cc4c92e4..363a7252 100644 --- a/src/core/algorithm/hnsw/hnsw_entity.h +++ b/src/core/algorithm/hnsw/hnsw_entity.h @@ -14,12 +14,12 @@ #pragma once #include -#include #include -#include "ailego/logger/logger.h" -#include "framework/index_dumper.h" -#include "framework/index_error.h" -#include "framework/index_storage.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/hnsw/hnsw_index_provider.h b/src/core/algorithm/hnsw/hnsw_index_provider.h index b5a6f31a..4a6ccaeb 100644 --- a/src/core/algorithm/hnsw/hnsw_index_provider.h +++ b/src/core/algorithm/hnsw/hnsw_index_provider.h @@ -13,9 +13,9 @@ // limitations under the License. #pragma once -#include "framework/index_provider.h" -#include "framework/index_searcher.h" -#include "framework/index_streamer.h" +#include +#include +#include #include "hnsw_entity.h" namespace zvec { diff --git a/src/core/algorithm/hnsw/hnsw_searcher.h b/src/core/algorithm/hnsw/hnsw_searcher.h index 306e2c94..4c8a3146 100644 --- a/src/core/algorithm/hnsw/hnsw_searcher.h +++ b/src/core/algorithm/hnsw/hnsw_searcher.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_framework.h" +#include #include "hnsw_searcher_entity.h" #include "hnsw_streamer.h" diff --git a/src/core/algorithm/hnsw/hnsw_searcher_entity.cc b/src/core/algorithm/hnsw/hnsw_searcher_entity.cc index 5b9c8c56..6661c1db 100644 --- a/src/core/algorithm/hnsw/hnsw_searcher_entity.cc +++ b/src/core/algorithm/hnsw/hnsw_searcher_entity.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "hnsw_searcher_entity.h" -#include +#include #include "utility/sparse_utility.h" namespace zvec { diff --git a/src/core/algorithm/hnsw/hnsw_streamer.h b/src/core/algorithm/hnsw/hnsw_streamer.h index a2162cbd..daadd8dd 100644 --- a/src/core/algorithm/hnsw/hnsw_streamer.h +++ b/src/core/algorithm/hnsw/hnsw_streamer.h @@ -14,7 +14,7 @@ #pragma once #include -#include "framework/index_framework.h" +#include #include "hnsw_algorithm.h" #include "hnsw_streamer_entity.h" diff --git a/src/core/algorithm/hnsw/hnsw_streamer_entity.h b/src/core/algorithm/hnsw/hnsw_streamer_entity.h index 7031b564..1a01b141 100644 --- a/src/core/algorithm/hnsw/hnsw_streamer_entity.h +++ b/src/core/algorithm/hnsw/hnsw_streamer_entity.h @@ -15,11 +15,11 @@ #pragma once #include -#include #include #include #include -#include "framework/index_framework.h" +#include +#include #include "hnsw_chunk.h" #include "hnsw_entity.h" #include "hnsw_index_hash.h" diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.cc index 758d367d..0d8d27ed 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.cc @@ -15,9 +15,9 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_logger.h" +#include +#include +#include #include "hnsw_sparse_algorithm.h" #include "hnsw_sparse_params.h" diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h index c5080ce1..35c45cc3 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include -#include "framework/index_builder.h" +#include +#include #include "hnsw_sparse_algorithm.h" #include "hnsw_sparse_builder_entity.h" diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.cc index a27accfb..48c20d72 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "hnsw_sparse_builder_entity.h" -#include +#include #include "utility/sparse_utility.h" namespace zvec { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.h index 464e1dc1..de35fae7 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_builder_entity.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include +#include #include "hnsw_sparse_entity.h" namespace zvec { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.cc index eb0e74b0..b728bedc 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.cc @@ -14,12 +14,12 @@ #include "hnsw_sparse_chunk.h" #include #include -#include -#include -#include "framework/index_error.h" -#include "framework/index_helper.h" -#include "framework/index_logger.h" -#include "framework/index_streamer.h" +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h index a850350a..a0269891 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_chunk.h @@ -19,13 +19,13 @@ #include #include #include -#include #include +#include #include -#include "framework/index_error.h" -#include "framework/index_logger.h" -#include "framework/index_storage.h" -#include "framework/index_streamer.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h index 4f31a6d5..04a0a3b6 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_context.h" +#include #include "utility/sparse_utility.h" #include "utility/visit_filter.h" #include "hnsw_sparse_dist_calculator.h" diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_dist_calculator.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_dist_calculator.h index 4a6782b9..06cb76e4 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_dist_calculator.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_dist_calculator.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_meta.h" +#include #include "hnsw_sparse_entity.h" namespace zvec { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h index 24d36817..7e6c16eb 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h @@ -15,12 +15,12 @@ #pragma once #include -#include #include -#include "ailego/logger/logger.h" -#include "framework/index_dumper.h" -#include "framework/index_error.h" -#include "framework/index_storage.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h index dec40909..5cb3db6b 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_framework.h" +#include #include "hnsw_sparse_searcher_entity.h" #include "hnsw_sparse_streamer.h" diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.cc index fdf5092e..8ef79adf 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_entity.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "hnsw_sparse_searcher_entity.h" -#include +#include #include "utility/sparse_utility.h" namespace zvec { diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h index 21c6be68..fcdcbe5b 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h @@ -14,7 +14,7 @@ #pragma once #include -#include "framework/index_framework.h" +#include #include "hnsw_sparse_algorithm.h" #include "hnsw_sparse_streamer_entity.h" diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h index 97d321db..84087afc 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_entity.h @@ -14,11 +14,11 @@ #pragma once #include -#include #include #include #include -#include "framework/index_framework.h" +#include +#include #include "hnsw_sparse_chunk.h" #include "hnsw_sparse_entity.h" #include "hnsw_sparse_index_hash.h" diff --git a/src/core/algorithm/ivf/ivf_builder.h b/src/core/algorithm/ivf/ivf_builder.h index 72ec7669..1dd9556a 100644 --- a/src/core/algorithm/ivf/ivf_builder.h +++ b/src/core/algorithm/ivf/ivf_builder.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "framework/index_builder.h" -#include "framework/index_meta.h" +#include +#include #include "ivf_centroid_index.h" namespace zvec { diff --git a/src/core/algorithm/ivf/ivf_centroid_index.cc b/src/core/algorithm/ivf/ivf_centroid_index.cc index c662f487..108b5af0 100644 --- a/src/core/algorithm/ivf/ivf_centroid_index.cc +++ b/src/core/algorithm/ivf/ivf_centroid_index.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "ivf_centroid_index.h" -#include "framework/index_framework.h" +#include +#include #include "metric/metric_params.h" -#include "quantizer/quantizer_params.h" namespace zvec { namespace core { diff --git a/src/core/algorithm/ivf/ivf_centroid_index.h b/src/core/algorithm/ivf/ivf_centroid_index.h index bdbab8df..db841598 100644 --- a/src/core/algorithm/ivf/ivf_centroid_index.h +++ b/src/core/algorithm/ivf/ivf_centroid_index.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include -#include "framework/index_framework.h" +#include +#include #include "ivf_params.h" #include "ivf_utility.h" diff --git a/src/core/algorithm/ivf/ivf_distance_calculator.h b/src/core/algorithm/ivf/ivf_distance_calculator.h index 7ae0fe6d..17a075dd 100644 --- a/src/core/algorithm/ivf/ivf_distance_calculator.h +++ b/src/core/algorithm/ivf/ivf_distance_calculator.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include -#include "framework/index_framework.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/ivf/ivf_dumper.h b/src/core/algorithm/ivf/ivf_dumper.h index 781271b7..d8ab9935 100644 --- a/src/core/algorithm/ivf/ivf_dumper.h +++ b/src/core/algorithm/ivf/ivf_dumper.h @@ -13,9 +13,9 @@ // limitations under the License. #pragma once -#include "framework/index_framework.h" +#include +#include #include "metric/metric_params.h" -#include "quantizer/quantizer_params.h" #include "ivf_index_format.h" #include "ivf_params.h" #include "ivf_utility.h" diff --git a/src/core/algorithm/ivf/ivf_entity.h b/src/core/algorithm/ivf/ivf_entity.h index 184548cd..c9d3d964 100644 --- a/src/core/algorithm/ivf/ivf_entity.h +++ b/src/core/algorithm/ivf/ivf_entity.h @@ -13,9 +13,9 @@ // limitations under the License. #pragma once -#include "framework/index_framework.h" +#include +#include #include "metric/metric_params.h" -#include "quantizer/quantizer_params.h" #include "ivf_distance_calculator.h" #include "ivf_index_format.h" #include "ivf_params.h" diff --git a/src/core/algorithm/ivf/ivf_index_format.h b/src/core/algorithm/ivf/ivf_index_format.h index 61be68b2..d86ae52b 100644 --- a/src/core/algorithm/ivf/ivf_index_format.h +++ b/src/core/algorithm/ivf/ivf_index_format.h @@ -14,7 +14,7 @@ #pragma once #include -#include "framework/index_framework.h" +#include namespace zvec { namespace core { diff --git a/src/core/algorithm/ivf/ivf_index_provider.h b/src/core/algorithm/ivf/ivf_index_provider.h index 13de55fe..fda8b332 100644 --- a/src/core/algorithm/ivf/ivf_index_provider.h +++ b/src/core/algorithm/ivf/ivf_index_provider.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_searcher.h" +#include #include "ivf_entity.h" namespace zvec { diff --git a/src/core/algorithm/ivf/ivf_searcher.cc b/src/core/algorithm/ivf/ivf_searcher.cc index ddcb869f..972fc868 100644 --- a/src/core/algorithm/ivf/ivf_searcher.cc +++ b/src/core/algorithm/ivf/ivf_searcher.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "ivf_searcher.h" -#include -#include +#include +#include #include "ivf_centroid_index.h" #include "ivf_index_provider.h" #include "ivf_params.h" diff --git a/src/core/algorithm/ivf/ivf_searcher.h b/src/core/algorithm/ivf/ivf_searcher.h index 37d44e96..9dd974d1 100644 --- a/src/core/algorithm/ivf/ivf_searcher.h +++ b/src/core/algorithm/ivf/ivf_searcher.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_searcher.h" +#include #include "ivf_centroid_index.h" #include "ivf_entity.h" #include "ivf_searcher_context.h" diff --git a/src/core/algorithm/ivf/ivf_searcher_context.h b/src/core/algorithm/ivf/ivf_searcher_context.h index 959ac93c..4d0183e4 100644 --- a/src/core/algorithm/ivf/ivf_searcher_context.h +++ b/src/core/algorithm/ivf/ivf_searcher_context.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include +#include #include "ivf_entity.h" #include "ivf_utility.h" diff --git a/src/core/algorithm/ivf/ivf_streamer.cc b/src/core/algorithm/ivf/ivf_streamer.cc index d9fdb8e3..a2c92414 100644 --- a/src/core/algorithm/ivf/ivf_streamer.cc +++ b/src/core/algorithm/ivf/ivf_streamer.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "ivf_streamer.h" -#include -#include +#include +#include #include "ivf_centroid_index.h" #include "ivf_index_provider.h" #include "ivf_params.h" diff --git a/src/core/algorithm/ivf/ivf_streamer.h b/src/core/algorithm/ivf/ivf_streamer.h index f395f6d8..57bdda0e 100644 --- a/src/core/algorithm/ivf/ivf_streamer.h +++ b/src/core/algorithm/ivf/ivf_streamer.h @@ -14,7 +14,7 @@ #ifndef __IVF_STREAMER_H__ #define __IVF_STREAMER_H__ -#include "framework/index_streamer.h" +#include #include "ivf_centroid_index.h" #include "ivf_entity.h" #include "ivf_searcher_context.h" diff --git a/src/core/algorithm/ivf/ivf_utility.h b/src/core/algorithm/ivf/ivf_utility.h index 01cd39b5..38e41a4f 100644 --- a/src/core/algorithm/ivf/ivf_utility.h +++ b/src/core/algorithm/ivf/ivf_utility.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_cluster.cc b/src/core/framework/index_cluster.cc index 118c946d..5fbda920 100644 --- a/src/core/framework/index_cluster.cc +++ b/src/core/framework/index_cluster.cc @@ -12,9 +12,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_cluster.h" -#include "index_bundle.h" -#include "index_error.h" + +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_context.cc b/src/core/framework/index_context.cc index e7ffa36d..08812d54 100644 --- a/src/core/framework/index_context.cc +++ b/src/core/framework/index_context.cc @@ -11,9 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_context.h" + #include #include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_converter.cc b/src/core/framework/index_converter.cc index 251ee7b4..dcf8480d 100644 --- a/src/core/framework/index_converter.cc +++ b/src/core/framework/index_converter.cc @@ -11,9 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_converter.h" -#include "index_error.h" -#include "index_helper.h" + +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_error.cc b/src/core/framework/index_error.cc index e7184bff..0a259ec3 100644 --- a/src/core/framework/index_error.cc +++ b/src/core/framework/index_error.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_error.h" +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_factory.cc b/src/core/framework/index_factory.cc index 687100f0..69fe0e98 100644 --- a/src/core/framework/index_factory.cc +++ b/src/core/framework/index_factory.cc @@ -11,7 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_factory.h" + +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_flow.cc b/src/core/framework/index_flow.cc index c68a9a12..d375c73f 100644 --- a/src/core/framework/index_flow.cc +++ b/src/core/framework/index_flow.cc @@ -11,9 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_flow.h" + #include -#include "index_helper.h" +#include +#include +#include +#include //! Default storage #define INDEX_FLOW_STORAGE_DEFAULT "MMapFileReadStorage" diff --git a/src/core/framework/index_framework.h b/src/core/framework/index_framework.h deleted file mode 100644 index d4a12bc4..00000000 --- a/src/core/framework/index_framework.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2025-present the zvec project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#pragma once - -#include "index_builder.h" -#include "index_bundle.h" -#include "index_cluster.h" -#include "index_converter.h" -#include "index_factory.h" -#include "index_filter.h" -#include "index_flow.h" -#include "index_helper.h" -#include "index_holder.h" -#include "index_mapping.h" -#include "index_memory.h" -#include "index_meta.h" -#include "index_plugin.h" -#include "index_runner.h" -#include "index_searcher.h" -#include "index_trainer.h" diff --git a/src/core/framework/index_helper.cc b/src/core/framework/index_helper.cc index a19d7490..80b12f40 100644 --- a/src/core/framework/index_helper.cc +++ b/src/core/framework/index_helper.cc @@ -11,9 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_helper.h" + #include -#include "index_error.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_logger.cc b/src/core/framework/index_logger.cc index b54f318f..4ab6e2eb 100644 --- a/src/core/framework/index_logger.cc +++ b/src/core/framework/index_logger.cc @@ -11,12 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_logger.h" #include #include #include -#include -#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_mapping.cc b/src/core/framework/index_mapping.cc index 5287779c..41475d0e 100644 --- a/src/core/framework/index_mapping.cc +++ b/src/core/framework/index_mapping.cc @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "index_mapping.h" -#include -#include "index_error.h" -#include "index_logger.h" +#include +#include +#include +#include +#include "ailego/utility/memory_helper.h" #ifdef __linux__ #include diff --git a/src/core/framework/index_meta.cc b/src/core/framework/index_meta.cc index 920a134f..11d54cb6 100644 --- a/src/core/framework/index_meta.cc +++ b/src/core/framework/index_meta.cc @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_meta.h" -#include -#include + +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_plugin.cc b/src/core/framework/index_plugin.cc index 5c0e5b8b..f9209a68 100644 --- a/src/core/framework/index_plugin.cc +++ b/src/core/framework/index_plugin.cc @@ -11,8 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_plugin.h" #include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_version.cc b/src/core/framework/index_version.cc index cd206b0d..9cd33e7f 100644 --- a/src/core/framework/index_version.cc +++ b/src/core/framework/index_version.cc @@ -11,8 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "index_version.h" + #include +#include namespace zvec { diff --git a/src/core/interface/index.cc b/src/core/interface/index.cc index 1b6fd503..aca40949 100644 --- a/src/core/interface/index.cc +++ b/src/core/interface/index.cc @@ -12,12 +12,38 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "index.h" -#include "framework/index_error.h" -#include "framework/index_storage.h" +#include +#include +#include +#include +#include "mixed_reducer/mixed_reducer_params.h" namespace zvec::core_interface { +// eliminate the pre-alloc of the context pool +thread_local static std::array() - 1) * 2> + _context_list; + + +bool Index::init_context() { + context_index_ = (magic_enum::enum_integer(param_.index_type) - 1) * 2 + + static_cast(is_sparse_); + if (_context_list[context_index_] == nullptr) { + if ((_context_list[context_index_] = streamer_->create_context()) == + nullptr) { + LOG_ERROR("Failed to create context"); + return false; + } + } + return true; +} + +core::IndexContext::Pointer &Index::acquire_context() { + init_context(); + return _context_list[context_index_]; +} + int Index::ParseMetricName(const BaseIndexParam ¶m) { std::string metric_name; if (is_sparse_) { diff --git a/src/core/interface/index_factory.cc b/src/core/interface/index_factory.cc index f924632c..699c9ce0 100644 --- a/src/core/interface/index_factory.cc +++ b/src/core/interface/index_factory.cc @@ -11,15 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// Created by wangjianning.wjn on 8/28/25. -// -#include "core/framework/index_factory.h" -#include "ailego/container/params.h" -#include "core/framework/index_meta.h" -#include "utils/utils.h" -#include "index_factory.h" +#include +#include +#include +#include +#include +#include "core/interface/utils/utils.h" namespace zvec::core_interface { @@ -113,4 +111,180 @@ BaseIndexParam::Pointer IndexFactory::DeserializeIndexParamFromJson( } } +template , bool> > +std::string IndexFactory::QueryParamSerializeToJson(const QueryParamType ¶m, + bool omit_empty_value) { + ailego::JsonObject json_obj; + + // BaseIndexQueryParam + // omit filter & bf_pks + if (!omit_empty_value || param.topk != 0) { + json_obj.set("topk", ailego::JsonValue(param.topk)); + } + if (!omit_empty_value || param.fetch_vector) { + json_obj.set("fetch_vector", ailego::JsonValue(param.fetch_vector)); + } + if (!omit_empty_value || param.radius != 0.0f) { + json_obj.set("radius", ailego::JsonValue(param.radius)); + } + if (!omit_empty_value || param.is_linear) { + json_obj.set("is_linear", ailego::JsonValue(param.is_linear)); + } + + IndexType index_type{IndexType::kNone}; + if constexpr (std::is_same_v) { + // index_type + index_type = IndexType::kFlat; + } else if constexpr (std::is_same_v) { + if (!omit_empty_value || param.ef_search != 0) { + json_obj.set("ef_search", ailego::JsonValue(param.ef_search)); + } + index_type = IndexType::kHNSW; + } else if constexpr (std::is_same_v) { + if (!omit_empty_value || param.nprobe != 0) { + json_obj.set("nprobe", ailego::JsonValue(param.nprobe)); + } + index_type = IndexType::kIVF; + // json_obj.set("l1QueryParam", + // ailego::JsonValue(QueryParamSerializeToJson(param.l1QueryParam))); + // json_obj.set("l2QueryParam", + // ailego::JsonValue(QueryParamSerializeToJson(param.l2QueryParam))); + } + + json_obj.set("index_type", + ailego::JsonValue(magic_enum::enum_name(index_type).data())); + + return ailego::JsonValue(json_obj).as_json_string().as_stl_string(); +} + +template std::string +IndexFactory::QueryParamSerializeToJson( + const BaseIndexQueryParam ¶m, bool omit_empty_value); +template std::string IndexFactory::QueryParamSerializeToJson( + const FlatQueryParam ¶m, bool omit_empty_value); +template std::string IndexFactory::QueryParamSerializeToJson( + const HNSWQueryParam ¶m, bool omit_empty_value); +template std::string IndexFactory::QueryParamSerializeToJson( + const IVFQueryParam ¶m, bool omit_empty_value); + +template , bool> > +typename QueryParamType::Pointer IndexFactory::QueryParamDeserializeFromJson( + const std::string &json_str) { + ailego::JsonValue tmp_json_value; + if (!tmp_json_value.parse(json_str)) { + LOG_ERROR("Failed to parse json string: %s", json_str.c_str()); + return nullptr; + } + ailego::JsonObject json_obj = tmp_json_value.as_object(); + + auto parse_common_fields = [&](auto ¶m) -> bool { + if (!extract_value_from_json(json_obj, "topk", param->topk, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize topk"); + return false; + } + + if (!extract_value_from_json(json_obj, "fetch_vector", param->fetch_vector, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize fetch_vector"); + return false; + } + + if (!extract_value_from_json(json_obj, "radius", param->radius, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize radius"); + return false; + } + + if (!extract_value_from_json(json_obj, "is_linear", param->is_linear, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize is_linear"); + return false; + } + return true; + }; + + IndexType index_type; + + if (!extract_enum_from_json(json_obj, "index_type", index_type, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize index type"); + return nullptr; + } + + if constexpr (std::is_same_v) { + if (index_type == IndexType::kFlat) { + auto param = std::make_shared(); + if (!parse_common_fields(param)) { + return nullptr; + } + return param; + } else if (index_type == IndexType::kHNSW) { + auto param = std::make_shared(); + if (!parse_common_fields(param)) { + return nullptr; + } + if (!extract_value_from_json(json_obj, "ef_search", param->ef_search, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize ef_search"); + return nullptr; + } + return param; + } else if (index_type == IndexType::kIVF) { + auto param = std::make_shared(); + if (!parse_common_fields(param)) { + return nullptr; + } + if (!extract_value_from_json(json_obj, "nprobe", param->nprobe, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize nprobe"); + return nullptr; + } + return param; + } else { + LOG_ERROR("Unsupported index type: %s", + magic_enum::enum_name(index_type).data()); + return nullptr; + } + } else { + auto param = std::make_shared(); + if (!parse_common_fields(param)) { + return nullptr; + } + if constexpr (std::is_same_v) { + } else if constexpr (std::is_same_v) { + if (!extract_value_from_json(json_obj, "ef_search", param->ef_search, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize ef_search"); + return nullptr; + } + } else if constexpr (std::is_same_v) { + if (!extract_value_from_json(json_obj, "nprobe", param->nprobe, + tmp_json_value)) { + LOG_ERROR("Failed to deserialize nprobe"); + return nullptr; + } + } else { + LOG_ERROR("Unsupported index type: %s", + magic_enum::enum_name(index_type).data()); + return nullptr; + } + return param; + } +} + +template BaseIndexQueryParam::Pointer +IndexFactory::QueryParamDeserializeFromJson( + const std::string &json_str); +template FlatQueryParam::Pointer IndexFactory::QueryParamDeserializeFromJson< + FlatQueryParam>(const std::string &json_str); +template HNSWQueryParam::Pointer IndexFactory::QueryParamDeserializeFromJson< + HNSWQueryParam>(const std::string &json_str); +template IVFQueryParam::Pointer IndexFactory::QueryParamDeserializeFromJson< + IVFQueryParam>(const std::string &json_str); + } // namespace zvec::core_interface diff --git a/src/core/interface/index_factory.h b/src/core/interface/index_factory.h deleted file mode 100644 index a5414a25..00000000 --- a/src/core/interface/index_factory.h +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2025-present the zvec project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Created by wangjianning.wjn on 8/28/25. -// - -#ifndef ZVEC_INDEX_FACTORY_H -#define ZVEC_INDEX_FACTORY_H - -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include "index.h" -#include "index_param.h" - -namespace zvec::core_interface { - -// 索引的工厂类 -class IndexFactory { - public: - static Index::Pointer CreateAndInitIndex(const BaseIndexParam ¶m); - - static BaseIndexParam::Pointer DeserializeIndexParamFromJson( - const std::string &json_str); - - - static std::string QueryParamSerializeToJson( - const BaseIndexQueryParam ¶m); - - - template < - typename QueryParamType, - std::enable_if_t, - bool> = true> - static std::string QueryParamSerializeToJson(const QueryParamType ¶m, - bool omit_empty_value = false); - - template < - typename QueryParamType, - std::enable_if_t, - bool> = true> - static typename QueryParamType::Pointer QueryParamDeserializeFromJson( - const std::string &json_str); - - // register() -- Index class should have a `create` interface -}; - - -template , bool> > -std::string IndexFactory::QueryParamSerializeToJson(const QueryParamType ¶m, - bool omit_empty_value) { - ailego::JsonObject json_obj; - - // BaseIndexQueryParam - // omit filter & bf_pks - if (!omit_empty_value || param.topk != 0) { - json_obj.set("topk", ailego::JsonValue(param.topk)); - } - if (!omit_empty_value || param.fetch_vector) { - json_obj.set("fetch_vector", ailego::JsonValue(param.fetch_vector)); - } - if (!omit_empty_value || param.radius != 0.0f) { - json_obj.set("radius", ailego::JsonValue(param.radius)); - } - if (!omit_empty_value || param.is_linear) { - json_obj.set("is_linear", ailego::JsonValue(param.is_linear)); - } - - IndexType index_type; - if constexpr (std::is_same_v) { - // index_type - index_type = IndexType::kFlat; - } else if constexpr (std::is_same_v) { - if (!omit_empty_value || param.ef_search != 0) { - json_obj.set("ef_search", ailego::JsonValue(param.ef_search)); - } - index_type = IndexType::kHNSW; - } else if constexpr (std::is_same_v) { - if (!omit_empty_value || param.nprobe != 0) { - json_obj.set("nprobe", ailego::JsonValue(param.nprobe)); - } - index_type = IndexType::kIVF; - // json_obj.set("l1QueryParam", - // ailego::JsonValue(QueryParamSerializeToJson(param.l1QueryParam))); - // json_obj.set("l2QueryParam", - // ailego::JsonValue(QueryParamSerializeToJson(param.l2QueryParam))); - } - - json_obj.set("index_type", - ailego::JsonValue(magic_enum::enum_name(index_type).data())); - - return ailego::JsonValue(json_obj).as_json_string().as_stl_string(); -} - -template , bool> > -typename QueryParamType::Pointer IndexFactory::QueryParamDeserializeFromJson( - const std::string &json_str) { - ailego::JsonValue tmp_json_value; - if (!tmp_json_value.parse(json_str)) { - LOG_ERROR("Failed to parse json string: %s", json_str.c_str()); - return nullptr; - } - ailego::JsonObject json_obj = tmp_json_value.as_object(); - - auto parse_common_fields = [&](auto ¶m) -> bool { - if (!extract_value_from_json(json_obj, "topk", param->topk, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize topk"); - return false; - } - - if (!extract_value_from_json(json_obj, "fetch_vector", param->fetch_vector, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize fetch_vector"); - return false; - } - - if (!extract_value_from_json(json_obj, "radius", param->radius, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize radius"); - return false; - } - - if (!extract_value_from_json(json_obj, "is_linear", param->is_linear, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize is_linear"); - return false; - } - return true; - }; - - IndexType index_type; - - if (!extract_enum_from_json(json_obj, "index_type", index_type, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize index type"); - return nullptr; - } - - if constexpr (std::is_same_v) { - if (index_type == IndexType::kFlat) { - auto param = std::make_shared(); - if (!parse_common_fields(param)) { - return nullptr; - } - return param; - } else if (index_type == IndexType::kHNSW) { - auto param = std::make_shared(); - if (!parse_common_fields(param)) { - return nullptr; - } - if (!extract_value_from_json(json_obj, "ef_search", param->ef_search, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize ef_search"); - return nullptr; - } - return param; - } else if (index_type == IndexType::kIVF) { - auto param = std::make_shared(); - if (!parse_common_fields(param)) { - return nullptr; - } - if (!extract_value_from_json(json_obj, "nprobe", param->nprobe, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize nprobe"); - return nullptr; - } - return param; - } else { - LOG_ERROR("Unsupported index type: %s", - magic_enum::enum_name(index_type).data()); - return nullptr; - } - } else { - auto param = std::make_shared(); - if (!parse_common_fields(param)) { - return nullptr; - } - if constexpr (std::is_same_v) { - } else if constexpr (std::is_same_v) { - if (!extract_value_from_json(json_obj, "ef_search", param->ef_search, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize ef_search"); - return nullptr; - } - } else if constexpr (std::is_same_v) { - if (!extract_value_from_json(json_obj, "nprobe", param->nprobe, - tmp_json_value)) { - LOG_ERROR("Failed to deserialize nprobe"); - return nullptr; - } - } else { - LOG_ERROR("Unsupported index type: %s", - magic_enum::enum_name(index_type).data()); - return nullptr; - } - return param; - } -} - - -} // namespace zvec::core_interface - - -#endif // ZVEC_INDEX_FACTORY_H diff --git a/src/core/interface/index_param.cc b/src/core/interface/index_param.cc index 394788b9..71e40123 100644 --- a/src/core/interface/index_param.cc +++ b/src/core/interface/index_param.cc @@ -1,6 +1,20 @@ -#include "index_param.h" -#include -#include +// Copyright 2025-present the zvec project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "core/interface/utils/utils.h" namespace zvec { namespace core_interface { @@ -127,6 +141,22 @@ bool HNSWIndexParam::DeserializeFromJsonObject( return true; } +ailego::JsonObject QuantizerParam::SerializeToJsonObject( + bool omit_empty_value) const { + ailego::JsonObject json_obj; + if (!omit_empty_value || type != QuantizerType::kNone) { + json_obj.set("type", + zvec::ailego::JsonValue(magic_enum::enum_name(type).data())); + } + return json_obj; +} + +bool QuantizerParam::DeserializeFromJsonObject( + const ailego::JsonObject &json_obj) { + DESERIALIZE_ENUM_FIELD(json_obj, type, QuantizerType); + return true; +} + // bool BaseIndexQueryParam::DeserializeFromJsonObject( // const ailego::JsonObject &json_obj) { // DESERIALIZE_ENUM_FIELD(json_obj, index_type, IndexType); diff --git a/src/core/interface/indexes/flat_index.cc b/src/core/interface/indexes/flat_index.cc index 0e7e5fd0..baf8e22e 100644 --- a/src/core/interface/indexes/flat_index.cc +++ b/src/core/interface/indexes/flat_index.cc @@ -11,14 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// Created by wangjianning.wjn on 8/28/25. -// #include #include +#include #include "algorithm/flat/flat_utility.h" -#include "interface/index.h" namespace zvec::core_interface { diff --git a/src/core/interface/indexes/hnsw_index.cc b/src/core/interface/indexes/hnsw_index.cc index 7d42691c..921db8ff 100644 --- a/src/core/interface/indexes/hnsw_index.cc +++ b/src/core/interface/indexes/hnsw_index.cc @@ -14,9 +14,9 @@ #include #include +#include #include "algorithm/hnsw/hnsw_params.h" #include "algorithm/hnsw_sparse/hnsw_sparse_params.h" -#include "interface/index.h" namespace zvec::core_interface { diff --git a/src/core/interface/indexes/ivf_index.cc b/src/core/interface/indexes/ivf_index.cc index debd80ee..0cfba037 100644 --- a/src/core/interface/indexes/ivf_index.cc +++ b/src/core/interface/indexes/ivf_index.cc @@ -14,8 +14,8 @@ #include #include +#include #include "algorithm/ivf/ivf_params.h" -#include "interface/index.h" namespace zvec::core_interface { diff --git a/src/core/interface/utils/utils.h b/src/core/interface/utils/utils.h index 74c542f1..5fc5365d 100644 --- a/src/core/interface/utils/utils.h +++ b/src/core/interface/utils/utils.h @@ -14,12 +14,13 @@ #pragma once -#include -#include #include +#include +#include namespace zvec { namespace core_interface { + template constexpr bool extract_enum_from_json(const ailego::JsonObject &json_obj, const char *key, EnumType &enum_value, diff --git a/src/core/metric/cosine_metric.cc b/src/core/metric/cosine_metric.cc index 525d3fbd..1b0fb052 100644 --- a/src/core/metric/cosine_metric.cc +++ b/src/core/metric/cosine_metric.cc @@ -14,8 +14,8 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/metric/euclidean_metric.cc b/src/core/metric/euclidean_metric.cc index 8c74b7d1..a1a8d598 100644 --- a/src/core/metric/euclidean_metric.cc +++ b/src/core/metric/euclidean_metric.cc @@ -14,9 +14,9 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_metric.h" +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/metric/hamming_metric.cc b/src/core/metric/hamming_metric.cc index b3125dcf..ee19c066 100644 --- a/src/core/metric/hamming_metric.cc +++ b/src/core/metric/hamming_metric.cc @@ -11,9 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #include -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include +#include "ailego/math_batch/distance_batch.h" namespace zvec { namespace core { diff --git a/src/core/metric/inner_product_metric.cc b/src/core/metric/inner_product_metric.cc index 9f6a746f..8ef0a11b 100644 --- a/src/core/metric/inner_product_metric.cc +++ b/src/core/metric/inner_product_metric.cc @@ -13,9 +13,9 @@ // limitations under the License. #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_metric.h" +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/metric/mips_euclidean_metric.cc b/src/core/metric/mips_euclidean_metric.cc index b8140c71..280bfa75 100644 --- a/src/core/metric/mips_euclidean_metric.cc +++ b/src/core/metric/mips_euclidean_metric.cc @@ -15,8 +15,8 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include #include "metric_params.h" namespace zvec { diff --git a/src/core/metric/quantized_integer_metric.cc b/src/core/metric/quantized_integer_metric.cc index 6e3f87f4..56e95634 100644 --- a/src/core/metric/quantized_integer_metric.cc +++ b/src/core/metric/quantized_integer_metric.cc @@ -16,8 +16,8 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include #include "metric_params.h" #include "quantized_integer_metric_batch.h" #include "quantized_integer_metric_matrix.h" diff --git a/src/core/metric/quantized_integer_metric_matrix.h b/src/core/metric/quantized_integer_metric_matrix.h index 11dc9b7c..c7cf460d 100644 --- a/src/core/metric/quantized_integer_metric_matrix.h +++ b/src/core/metric/quantized_integer_metric_matrix.h @@ -18,8 +18,8 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" +#include +#include #include "metric_params.h" diff --git a/src/core/mixed_reducer/mixed_streamer_reducer.cc b/src/core/mixed_reducer/mixed_streamer_reducer.cc index f4ea0638..b5e241bb 100644 --- a/src/core/mixed_reducer/mixed_streamer_reducer.cc +++ b/src/core/mixed_reducer/mixed_streamer_reducer.cc @@ -13,14 +13,15 @@ // limitations under the License. #include "mixed_streamer_reducer.h" #include -#include -#include -#include -#include -#include -#include #include +#include #include +#include +#include +#include +#include +#include +#include "mixed_reducer/mixed_reducer_params.h" namespace zvec { namespace core { diff --git a/src/core/mixed_reducer/mixed_streamer_reducer.h b/src/core/mixed_reducer/mixed_streamer_reducer.h index 494224b6..ec4c6240 100644 --- a/src/core/mixed_reducer/mixed_streamer_reducer.h +++ b/src/core/mixed_reducer/mixed_streamer_reducer.h @@ -16,13 +16,12 @@ #include #include #include -#include -#include -#include -#include #include -#include "framework/index_error.h" -#include "mixed_reducer_params.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/quantizer/binary_converter.cc b/src/core/quantizer/binary_converter.cc index 9fe46dd1..852d1920 100644 --- a/src/core/quantizer/binary_converter.cc +++ b/src/core/quantizer/binary_converter.cc @@ -14,8 +14,8 @@ #include #include #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/quantizer/binary_reformer.cc b/src/core/quantizer/binary_reformer.cc index 4ff0a04e..78ddffd3 100644 --- a/src/core/quantizer/binary_reformer.cc +++ b/src/core/quantizer/binary_reformer.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/quantizer/cosine_converter.cc b/src/core/quantizer/cosine_converter.cc index 4e3dbee9..e8deaca8 100644 --- a/src/core/quantizer/cosine_converter.cc +++ b/src/core/quantizer/cosine_converter.cc @@ -16,8 +16,8 @@ #include #include #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include #include "record_quantizer.h" #include "../metric/metric_params.h" diff --git a/src/core/quantizer/cosine_reformer.cc b/src/core/quantizer/cosine_reformer.cc index 2595f21e..5823728d 100644 --- a/src/core/quantizer/cosine_reformer.cc +++ b/src/core/quantizer/cosine_reformer.cc @@ -15,8 +15,8 @@ #include #include #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include #include "record_quantizer.h" namespace zvec { diff --git a/src/core/quantizer/half_float_converter.cc b/src/core/quantizer/half_float_converter.cc index 2db004b5..4b426d42 100644 --- a/src/core/quantizer/half_float_converter.cc +++ b/src/core/quantizer/half_float_converter.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_framework.h" +#include namespace zvec { namespace core { diff --git a/src/core/quantizer/half_float_reformer.cc b/src/core/quantizer/half_float_reformer.cc index cffe3229..0803a859 100644 --- a/src/core/quantizer/half_float_reformer.cc +++ b/src/core/quantizer/half_float_reformer.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_factory.h" +#include #include "record_quantizer.h" namespace zvec { diff --git a/src/core/quantizer/integer_quantizer_converter.cc b/src/core/quantizer/integer_quantizer_converter.cc index e9bc64f0..91757a5d 100644 --- a/src/core/quantizer/integer_quantizer_converter.cc +++ b/src/core/quantizer/integer_quantizer_converter.cc @@ -16,8 +16,8 @@ #include #include #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include #include "record_quantizer.h" #include "../metric/metric_params.h" diff --git a/src/core/quantizer/integer_quantizer_reformer.cc b/src/core/quantizer/integer_quantizer_reformer.cc index cad431fa..9c741036 100644 --- a/src/core/quantizer/integer_quantizer_reformer.cc +++ b/src/core/quantizer/integer_quantizer_reformer.cc @@ -16,8 +16,8 @@ #include #include #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include #include "record_quantizer.h" namespace zvec { diff --git a/src/core/quantizer/mips_converter.cc b/src/core/quantizer/mips_converter.cc index 910443b6..343e1579 100644 --- a/src/core/quantizer/mips_converter.cc +++ b/src/core/quantizer/mips_converter.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include -#include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/quantizer/mips_reformer.cc b/src/core/quantizer/mips_reformer.cc index b656a968..3e762112 100644 --- a/src/core/quantizer/mips_reformer.cc +++ b/src/core/quantizer/mips_reformer.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_factory.h" -#include "quantizer_params.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/quantizer/record_quantizer.h b/src/core/quantizer/record_quantizer.h index 4170251e..06744f69 100644 --- a/src/core/quantizer/record_quantizer.h +++ b/src/core/quantizer/record_quantizer.h @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "framework/index_meta.h" +#include #pragma once diff --git a/src/core/utility/basic_refiner.cc b/src/core/utility/basic_refiner.cc index dbe1759d..dd3fdfaa 100644 --- a/src/core/utility/basic_refiner.cc +++ b/src/core/utility/basic_refiner.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "framework/index_factory.h" -#include "framework/index_refiner.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/utility/buffer_storage.cc b/src/core/utility/buffer_storage.cc index caa59b2f..4ac3c6b3 100644 --- a/src/core/utility/buffer_storage.cc +++ b/src/core/utility/buffer_storage.cc @@ -13,11 +13,11 @@ // limitations under the License. #include -#include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_mapping.h" -#include "framework/index_version.h" +#include +#include +#include +#include +#include #include "utility_params.h" namespace zvec { diff --git a/src/core/utility/file_dumper.cc b/src/core/utility/file_dumper.cc index aa40736f..c77b1e10 100644 --- a/src/core/utility/file_dumper.cc +++ b/src/core/utility/file_dumper.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_format.h" -#include "framework/index_packer.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/utility/file_read_storage.cc b/src/core/utility/file_read_storage.cc index 11948cfd..8f2b79fe 100644 --- a/src/core/utility/file_read_storage.cc +++ b/src/core/utility/file_read_storage.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_unpacker.h" +#include +#include +#include +#include #include "utility_params.h" namespace zvec { diff --git a/src/core/utility/memory_dumper.cc b/src/core/utility/memory_dumper.cc index ae24c539..10a1dc35 100644 --- a/src/core/utility/memory_dumper.cc +++ b/src/core/utility/memory_dumper.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_format.h" -#include "framework/index_memory.h" -#include "framework/index_packer.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/utility/memory_read_storage.cc b/src/core/utility/memory_read_storage.cc index 8c339ce8..38eb9ea7 100644 --- a/src/core/utility/memory_read_storage.cc +++ b/src/core/utility/memory_read_storage.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_format.h" -#include "framework/index_memory.h" -#include "framework/index_unpacker.h" +#include +#include +#include +#include +#include #include "utility_params.h" namespace zvec { diff --git a/src/core/utility/mmap_file_read_storage.cc b/src/core/utility/mmap_file_read_storage.cc index 93a311ca..8d620305 100644 --- a/src/core/utility/mmap_file_read_storage.cc +++ b/src/core/utility/mmap_file_read_storage.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include -#include "framework/index_factory.h" -#include "framework/index_format.h" -#include "framework/index_unpacker.h" +#include +#include +#include +#include #include "utility_params.h" namespace zvec { diff --git a/src/core/utility/mmap_file_storage.cc b/src/core/utility/mmap_file_storage.cc index 17d25152..e4a8e238 100644 --- a/src/core/utility/mmap_file_storage.cc +++ b/src/core/utility/mmap_file_storage.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_mapping.h" -#include "framework/index_version.h" +#include +#include +#include +#include #include "utility_params.h" namespace zvec { diff --git a/src/core/utility/sparse_utility.h b/src/core/utility/sparse_utility.h index 7a7928d3..6f057c55 100644 --- a/src/core/utility/sparse_utility.h +++ b/src/core/utility/sparse_utility.h @@ -18,9 +18,9 @@ #include #include #include -#include "framework/index_document.h" -#include "framework/index_logger.h" -#include "framework/index_meta.h" +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/utility/visit_filter.h b/src/core/utility/visit_filter.h index 30ed168d..348da17f 100644 --- a/src/core/utility/visit_filter.h +++ b/src/core/utility/visit_filter.h @@ -22,8 +22,8 @@ #include #include #include -#include "framework/index_error.h" -#include "framework/index_logger.h" +#include +#include namespace zvec { namespace core { diff --git a/src/db/collection.cc b/src/db/collection.cc index ff260bc9..6704f0f0 100644 --- a/src/db/collection.cc +++ b/src/db/collection.cc @@ -20,17 +20,17 @@ #include #include #include -#include #include -#include +#include +#include #include +#include #include #include #include #include #include #include -#include "ailego/logger/logger.h" #include "db/common/constants.h" #include "db/common/file_helper.h" #include "db/common/profiler.h" diff --git a/src/db/common/concurrent_roaring_bitmap.cc b/src/db/common/concurrent_roaring_bitmap.cc index 258c3f1e..9cc298ab 100644 --- a/src/db/common/concurrent_roaring_bitmap.cc +++ b/src/db/common/concurrent_roaring_bitmap.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "concurrent_roaring_bitmap.h" -#include +#include namespace zvec { diff --git a/src/db/common/concurrent_roaring_bitmap.h b/src/db/common/concurrent_roaring_bitmap.h index 54f13628..8d5f106b 100644 --- a/src/db/common/concurrent_roaring_bitmap.h +++ b/src/db/common/concurrent_roaring_bitmap.h @@ -18,11 +18,11 @@ #include #include #include -#include -#include #include +#include +#include +#include #include -#include "ailego/internal/platform.h" namespace zvec { diff --git a/src/db/common/file_helper.h b/src/db/common/file_helper.h index 4fb95621..ee2408a6 100644 --- a/src/db/common/file_helper.h +++ b/src/db/common/file_helper.h @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include namespace zvec { diff --git a/src/db/common/global_resource.cc b/src/db/common/global_resource.cc index d17b38e8..2f4ad1ca 100644 --- a/src/db/common/global_resource.cc +++ b/src/db/common/global_resource.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "db/common/global_resource.h" #include -#include +#include #include namespace zvec { diff --git a/src/db/common/global_resource.h b/src/db/common/global_resource.h index ea3e8128..816e4508 100644 --- a/src/db/common/global_resource.h +++ b/src/db/common/global_resource.h @@ -14,8 +14,8 @@ #pragma once #include +#include #include -#include "ailego/parallel/thread_pool.h" namespace zvec { diff --git a/src/db/common/glogger.h b/src/db/common/glogger.h index 9b129a06..93fd9a7c 100644 --- a/src/db/common/glogger.h +++ b/src/db/common/glogger.h @@ -11,8 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include -#include +#include +#include #ifdef __GNUC__ #pragma GCC diagnostic push diff --git a/src/db/common/logger.h b/src/db/common/logger.h index bbc60d3a..d0f7eb00 100644 --- a/src/db/common/logger.h +++ b/src/db/common/logger.h @@ -14,11 +14,11 @@ #pragma once -#include -#include #include +#include +#include +#include #include -#include "ailego/pattern/factory.h" #include "db/common/constants.h" #include "error_code.h" diff --git a/src/db/common/profiler.h b/src/db/common/profiler.h index 24fa9b2b..52b8838f 100644 --- a/src/db/common/profiler.h +++ b/src/db/common/profiler.h @@ -15,9 +15,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "error_code.h" namespace zvec { diff --git a/src/db/common/rocbsdb_context.cc b/src/db/common/rocbsdb_context.cc index 6db1110d..790456ab 100644 --- a/src/db/common/rocbsdb_context.cc +++ b/src/db/common/rocbsdb_context.cc @@ -13,11 +13,11 @@ // limitations under the License. -#include #include #include #include #include +#include #include "rocksdb_context.h" diff --git a/src/db/common/rocksdb_context.h b/src/db/common/rocksdb_context.h index a833f9d3..302d7ca8 100644 --- a/src/db/common/rocksdb_context.h +++ b/src/db/common/rocksdb_context.h @@ -16,8 +16,8 @@ #pragma once -#include #include +#include #include diff --git a/src/db/common/typedef.h b/src/db/common/typedef.h index 8c621429..d284389c 100644 --- a/src/db/common/typedef.h +++ b/src/db/common/typedef.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include +#include #include "error_code.h" using idx_t = uint64_t; diff --git a/src/db/index/column/inverted_column/inverted_codec.h b/src/db/index/column/inverted_column/inverted_codec.h index 62fb76ac..37e3fbd0 100644 --- a/src/db/index/column/inverted_column/inverted_codec.h +++ b/src/db/index/column/inverted_column/inverted_codec.h @@ -17,8 +17,8 @@ #include -#include #include +#include #include #include #include "db/common/constants.h" diff --git a/src/db/index/column/inverted_column/inverted_column_indexer_write.cc b/src/db/index/column/inverted_column/inverted_column_indexer_write.cc index ce707520..d41a26c7 100644 --- a/src/db/index/column/inverted_column/inverted_column_indexer_write.cc +++ b/src/db/index/column/inverted_column/inverted_column_indexer_write.cc @@ -13,8 +13,8 @@ // limitations under the License. -#include #include +#include #include "inverted_codec.h" #include "inverted_column_indexer.h" diff --git a/src/db/index/column/inverted_column/inverted_doc_range.h b/src/db/index/column/inverted_column/inverted_doc_range.h index bdb10329..3a38ece2 100644 --- a/src/db/index/column/inverted_column/inverted_doc_range.h +++ b/src/db/index/column/inverted_column/inverted_doc_range.h @@ -19,8 +19,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/src/db/index/column/inverted_column/inverted_indexer.cc b/src/db/index/column/inverted_column/inverted_indexer.cc index 375703bc..4997ab11 100644 --- a/src/db/index/column/inverted_column/inverted_indexer.cc +++ b/src/db/index/column/inverted_column/inverted_indexer.cc @@ -14,7 +14,7 @@ #include "inverted_indexer.h" -#include +#include #include "inverted_rocksdb_merger.h" diff --git a/src/db/index/column/vector_column/engine_helper.hpp b/src/db/index/column/vector_column/engine_helper.hpp index c2865c5c..de1cfc6c 100644 --- a/src/db/index/column/vector_column/engine_helper.hpp +++ b/src/db/index/column/vector_column/engine_helper.hpp @@ -15,11 +15,11 @@ #include #include +#include +#include #include #include #include -#include "core/interface/index.h" -#include "vector_column_indexer.h" #include "vector_column_params.h" diff --git a/src/db/index/column/vector_column/vector_column_indexer.cc b/src/db/index/column/vector_column/vector_column_indexer.cc index d56a2cb3..1859e249 100644 --- a/src/db/index/column/vector_column/vector_column_indexer.cc +++ b/src/db/index/column/vector_column/vector_column_indexer.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "vector_column_indexer.h" #include +#include #include #include "engine_helper.hpp" diff --git a/src/db/index/column/vector_column/vector_column_indexer.h b/src/db/index/column/vector_column/vector_column_indexer.h index 756e93f4..80766e1d 100644 --- a/src/db/index/column/vector_column/vector_column_indexer.h +++ b/src/db/index/column/vector_column/vector_column_indexer.h @@ -16,13 +16,12 @@ #include #include #include -#include #include #include +#include +#include #include #include -#include "core/interface/index.h" -#include "core/interface/index_param.h" #include "db/common/constants.h" #include "db/common/typedef.h" #include "db/index/column/common/index_results.h" diff --git a/src/db/index/column/vector_column/vector_column_params.h b/src/db/index/column/vector_column/vector_column_params.h index 1db49438..86b32ebb 100644 --- a/src/db/index/column/vector_column/vector_column_params.h +++ b/src/db/index/column/vector_column/vector_column_params.h @@ -17,13 +17,11 @@ #include #include #include -#include -#include -// #include -// #include "common/constants.h" +#include +#include +#include #include #include -#include "core/interface/index_param.h" #include "db/index/common/index_filter.h" namespace zvec { diff --git a/src/db/index/column/vector_column/vector_index_results.h b/src/db/index/column/vector_column/vector_index_results.h index 44bdf046..154ff6e4 100644 --- a/src/db/index/column/vector_column/vector_index_results.h +++ b/src/db/index/column/vector_column/vector_index_results.h @@ -15,7 +15,7 @@ #include #include -#include "core/framework/index_document.h" +#include #include "db/common/typedef.h" #include "db/index/column/common/index_results.h" diff --git a/src/db/index/common/id_map.cc b/src/db/index/common/id_map.cc index 73e58d84..e1e03cf3 100644 --- a/src/db/index/common/id_map.cc +++ b/src/db/index/common/id_map.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "id_map.h" -#include +#include #include "db/common/constants.h" diff --git a/src/db/index/common/id_map.h b/src/db/index/common/id_map.h index 02ac9aa4..59e6b3ec 100644 --- a/src/db/index/common/id_map.h +++ b/src/db/index/common/id_map.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include "db/common/rocksdb_context.h" diff --git a/src/db/index/common/type_helper.cc b/src/db/index/common/type_helper.cc index 7c5911eb..7f622bb2 100644 --- a/src/db/index/common/type_helper.cc +++ b/src/db/index/common/type_helper.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "type_helper.h" -#include "core/framework/index_meta.h" +#include namespace zvec { diff --git a/src/db/index/common/type_helper.h b/src/db/index/common/type_helper.h index 71ce4a7e..33440dc5 100644 --- a/src/db/index/common/type_helper.h +++ b/src/db/index/common/type_helper.h @@ -11,9 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include +#include #include #include "proto/zvec.pb.h" diff --git a/src/db/index/common/version_manager.cc b/src/db/index/common/version_manager.cc index 97e3c3c7..47be9cb7 100644 --- a/src/db/index/common/version_manager.cc +++ b/src/db/index/common/version_manager.cc @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/src/db/index/segment/segment.cc b/src/db/index/segment/segment.cc index 6fc2ac30..1afa038e 100644 --- a/src/db/index/segment/segment.cc +++ b/src/db/index/segment/segment.cc @@ -21,16 +21,16 @@ #include #include #include -#include #include -#include -#include #include #include #include #include #include #include +#include +#include +#include #include #include #include diff --git a/src/db/index/segment/segment_helper.cc b/src/db/index/segment/segment_helper.cc index 08a7a81d..45b2dfb3 100644 --- a/src/db/index/segment/segment_helper.cc +++ b/src/db/index/segment/segment_helper.cc @@ -18,9 +18,9 @@ #include #include #include +#include #include #include -#include "ailego/logger/logger.h" #include "db/common/constants.h" #include "db/common/file_helper.h" #include "db/common/global_resource.h" diff --git a/src/db/index/storage/bufferpool_forward_store.cc b/src/db/index/storage/bufferpool_forward_store.cc index 60b0ad3c..a8cbaee3 100644 --- a/src/db/index/storage/bufferpool_forward_store.cc +++ b/src/db/index/storage/bufferpool_forward_store.cc @@ -13,8 +13,6 @@ // limitations under the License. #include "bufferpool_forward_store.h" -#include -#include #include #include #include @@ -23,6 +21,8 @@ #include #include #include +#include +#include #include "db/index/storage/store_helper.h" #include "lazy_record_batch_reader.h" diff --git a/src/db/index/storage/bufferpool_forward_store.h b/src/db/index/storage/bufferpool_forward_store.h index c0c357af..c8410553 100644 --- a/src/db/index/storage/bufferpool_forward_store.h +++ b/src/db/index/storage/bufferpool_forward_store.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include #include "base_forward_store.h" diff --git a/src/db/index/storage/chunked_file_writer.cc b/src/db/index/storage/chunked_file_writer.cc index 490078fb..0295b99c 100644 --- a/src/db/index/storage/chunked_file_writer.cc +++ b/src/db/index/storage/chunked_file_writer.cc @@ -14,10 +14,10 @@ #include "chunked_file_writer.h" #include -#include #include #include #include +#include namespace zvec { diff --git a/src/db/index/storage/lazy_record_batch_reader.h b/src/db/index/storage/lazy_record_batch_reader.h index 3289bf44..c9e124c5 100644 --- a/src/db/index/storage/lazy_record_batch_reader.h +++ b/src/db/index/storage/lazy_record_batch_reader.h @@ -14,9 +14,9 @@ // limitations under the License. #pragma once -#include #include #include +#include #include "db/common/constants.h" diff --git a/src/db/index/storage/memory_forward_store.cc b/src/db/index/storage/memory_forward_store.cc index 4fd832b4..94a6aa33 100644 --- a/src/db/index/storage/memory_forward_store.cc +++ b/src/db/index/storage/memory_forward_store.cc @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -26,6 +25,7 @@ #include #include #include +#include #include "db/common/constants.h" #include "db/index/storage/base_forward_store.h" diff --git a/src/db/index/storage/mmap_forward_store.cc b/src/db/index/storage/mmap_forward_store.cc index f96127c0..dcaff40b 100644 --- a/src/db/index/storage/mmap_forward_store.cc +++ b/src/db/index/storage/mmap_forward_store.cc @@ -14,11 +14,11 @@ #include "mmap_forward_store.h" #include -#include #include #include #include #include +#include #include "db/index/storage/base_forward_store.h" #include "lazy_record_batch_reader.h" diff --git a/src/db/index/storage/wal/local_wal_file.cc b/src/db/index/storage/wal/local_wal_file.cc index 680d8719..91490b21 100644 --- a/src/db/index/storage/wal/local_wal_file.cc +++ b/src/db/index/storage/wal/local_wal_file.cc @@ -14,8 +14,8 @@ #include "local_wal_file.h" #include -#include -#include +#include +#include #include "db/common/error_code.h" #include "db/common/file_helper.h" #include "db/common/typedef.h" diff --git a/src/db/index/storage/wal/local_wal_file.h b/src/db/index/storage/wal/local_wal_file.h index efcfd063..d4f392fa 100644 --- a/src/db/index/storage/wal/local_wal_file.h +++ b/src/db/index/storage/wal/local_wal_file.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "wal_file.h" namespace zvec { diff --git a/src/db/sqlengine/analyzer/query_analyzer.cc b/src/db/sqlengine/analyzer/query_analyzer.cc index bd01174e..4d981370 100644 --- a/src/db/sqlengine/analyzer/query_analyzer.cc +++ b/src/db/sqlengine/analyzer/query_analyzer.cc @@ -14,13 +14,13 @@ #include "query_analyzer.h" #include -#include +#include #include #include +#include #include #include #include -#include "core/framework/index_meta.h" #include "db/common/constants.h" #include "db/common/error_code.h" #include "db/index/common/type_helper.h" diff --git a/src/db/sqlengine/analyzer/query_info.h b/src/db/sqlengine/analyzer/query_info.h index 5dfd7381..653231a7 100644 --- a/src/db/sqlengine/analyzer/query_info.h +++ b/src/db/sqlengine/analyzer/query_info.h @@ -18,8 +18,8 @@ #include #include #include -#include -#include +#include +#include #include #include "db/common/constants.h" #include "db/sqlengine/common/group_by.h" diff --git a/src/db/sqlengine/analyzer/query_info_helper.cc b/src/db/sqlengine/analyzer/query_info_helper.cc index 058f7ba9..77692cc9 100644 --- a/src/db/sqlengine/analyzer/query_info_helper.cc +++ b/src/db/sqlengine/analyzer/query_info_helper.cc @@ -14,7 +14,7 @@ #include "query_info_helper.h" #include -#include +#include #include namespace zvec::sqlengine { diff --git a/src/db/sqlengine/analyzer/query_node.cc b/src/db/sqlengine/analyzer/query_node.cc index 50764e6a..2a8aa815 100644 --- a/src/db/sqlengine/analyzer/query_node.cc +++ b/src/db/sqlengine/analyzer/query_node.cc @@ -15,7 +15,7 @@ #include "query_node.h" #include #include -#include +#include #include "query_info.h" namespace zvec::sqlengine { diff --git a/src/db/sqlengine/analyzer/query_node_walker.cc b/src/db/sqlengine/analyzer/query_node_walker.cc index 2993f046..c2d59247 100644 --- a/src/db/sqlengine/analyzer/query_node_walker.cc +++ b/src/db/sqlengine/analyzer/query_node_walker.cc @@ -14,7 +14,7 @@ #include "query_node_walker.h" #include -#include +#include #include #include #include diff --git a/src/db/sqlengine/common/util.cc b/src/db/sqlengine/common/util.cc index 5c5d231b..3f18bfe4 100644 --- a/src/db/sqlengine/common/util.cc +++ b/src/db/sqlengine/common/util.cc @@ -18,9 +18,9 @@ #include #include #include -#include #include #include +#include #include namespace zvec::sqlengine { diff --git a/src/db/sqlengine/parser/zvec_cached_sql_parser.cc b/src/db/sqlengine/parser/zvec_cached_sql_parser.cc index 52147693..bc030bd3 100644 --- a/src/db/sqlengine/parser/zvec_cached_sql_parser.cc +++ b/src/db/sqlengine/parser/zvec_cached_sql_parser.cc @@ -15,7 +15,7 @@ #include "zvec_cached_sql_parser.h" #include #include -#include +#include #include #include "atn/ParserATNSimulator.h" #include "db/sqlengine/antlr/gen/SQLLexer.h" diff --git a/src/db/sqlengine/parser/zvec_parser.cc b/src/db/sqlengine/parser/zvec_parser.cc index 91ce93dc..de5ae79b 100644 --- a/src/db/sqlengine/parser/zvec_parser.cc +++ b/src/db/sqlengine/parser/zvec_parser.cc @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include #include #include "db/sqlengine/common/util.h" #include "tree/ParseTree.h" diff --git a/src/db/sqlengine/parser/zvec_sql_parser.cc b/src/db/sqlengine/parser/zvec_sql_parser.cc index 1d472f35..c21943f4 100644 --- a/src/db/sqlengine/parser/zvec_sql_parser.cc +++ b/src/db/sqlengine/parser/zvec_sql_parser.cc @@ -15,7 +15,7 @@ #include "zvec_sql_parser.h" #include #include -#include +#include #include "atn/ParserATNSimulator.h" #include "db/sqlengine/antlr/gen/SQLLexer.h" #include "db/sqlengine/antlr/gen/SQLParser.h" diff --git a/src/db/sqlengine/planner/doc_filter.cc b/src/db/sqlengine/planner/doc_filter.cc index 43ce1d5a..f91535a8 100644 --- a/src/db/sqlengine/planner/doc_filter.cc +++ b/src/db/sqlengine/planner/doc_filter.cc @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include "ailego/logger/logger.h" #include "db/sqlengine/planner/invert_search.h" namespace zvec::sqlengine { diff --git a/src/db/sqlengine/planner/invert_recall_node.cc b/src/db/sqlengine/planner/invert_recall_node.cc index 432d390c..2656c48a 100644 --- a/src/db/sqlengine/planner/invert_recall_node.cc +++ b/src/db/sqlengine/planner/invert_recall_node.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "db/sqlengine/planner/invert_recall_node.h" -#include #include +#include #include "db/sqlengine/planner/invert_search.h" namespace cp = arrow::compute; diff --git a/src/db/sqlengine/planner/invert_search.cc b/src/db/sqlengine/planner/invert_search.cc index 8cd76ab2..0f898015 100644 --- a/src/db/sqlengine/planner/invert_search.cc +++ b/src/db/sqlengine/planner/invert_search.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "invert_search.h" -#include +#include #include #include "db/sqlengine/analyzer/query_node.h" #include "db/sqlengine/common/util.h" diff --git a/src/db/sqlengine/planner/optimizer.cc b/src/db/sqlengine/planner/optimizer.cc index f63950e1..faacd1f5 100644 --- a/src/db/sqlengine/planner/optimizer.cc +++ b/src/db/sqlengine/planner/optimizer.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "optimizer.h" -#include +#include #include #include #include "db/sqlengine/analyzer/query_info_helper.h" diff --git a/src/db/sqlengine/planner/plan_info.cc b/src/db/sqlengine/planner/plan_info.cc index 6f7681c5..780fe553 100644 --- a/src/db/sqlengine/planner/plan_info.cc +++ b/src/db/sqlengine/planner/plan_info.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "plan_info.h" -#include #include +#include #include #include "db/common/error_code.h" diff --git a/src/db/sqlengine/planner/query_planner.cc b/src/db/sqlengine/planner/query_planner.cc index e4d87786..c0c588a3 100644 --- a/src/db/sqlengine/planner/query_planner.cc +++ b/src/db/sqlengine/planner/query_planner.cc @@ -16,10 +16,10 @@ #include #include #include -#include -#include #include #include +#include +#include #include #include #include diff --git a/src/db/sqlengine/planner/segment_node.cc b/src/db/sqlengine/planner/segment_node.cc index 9c2edf46..aa772910 100644 --- a/src/db/sqlengine/planner/segment_node.cc +++ b/src/db/sqlengine/planner/segment_node.cc @@ -15,9 +15,9 @@ #include "db/sqlengine/planner/segment_node.h" #include #include -#include -#include #include +#include +#include namespace zvec::sqlengine { diff --git a/src/db/sqlengine/planner/segment_node.h b/src/db/sqlengine/planner/segment_node.h index 88524059..352a9531 100644 --- a/src/db/sqlengine/planner/segment_node.h +++ b/src/db/sqlengine/planner/segment_node.h @@ -17,10 +17,10 @@ #include #include #include -#include #include #include #include +#include #include #include "db/sqlengine/planner/plan_info.h" diff --git a/src/db/sqlengine/planner/vector_recall_node.cc b/src/db/sqlengine/planner/vector_recall_node.cc index aa5dd1e4..f56bb44e 100644 --- a/src/db/sqlengine/planner/vector_recall_node.cc +++ b/src/db/sqlengine/planner/vector_recall_node.cc @@ -16,11 +16,11 @@ #include #include #include -#include #include #include -#include +#include #include +#include #include #include #include diff --git a/src/db/sqlengine/sqlengine_impl.cc b/src/db/sqlengine/sqlengine_impl.cc index f889adb1..072c1033 100644 --- a/src/db/sqlengine/sqlengine_impl.cc +++ b/src/db/sqlengine/sqlengine_impl.cc @@ -14,7 +14,7 @@ #include "db/sqlengine/sqlengine_impl.h" #include -#include +#include #include #include #include "db/common/constants.h" diff --git a/src/ailego/buffer/buffer_manager.h b/src/include/zvec/ailego/buffer/buffer_manager.h similarity index 99% rename from src/ailego/buffer/buffer_manager.h rename to src/include/zvec/ailego/buffer/buffer_manager.h index f9e2120a..8aebf759 100644 --- a/src/ailego/buffer/buffer_manager.h +++ b/src/include/zvec/ailego/buffer/buffer_manager.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include namespace arrow { diff --git a/src/ailego/container/blob.h b/src/include/zvec/ailego/container/blob.h similarity index 98% rename from src/ailego/container/blob.h rename to src/include/zvec/ailego/container/blob.h index 2e45f7c6..9803b42f 100644 --- a/src/ailego/container/blob.h +++ b/src/include/zvec/ailego/container/blob.h @@ -16,7 +16,7 @@ #include #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/container/cube.h b/src/include/zvec/ailego/container/cube.h similarity index 99% rename from src/ailego/container/cube.h rename to src/include/zvec/ailego/container/cube.h index d9ed2020..021cdd50 100644 --- a/src/ailego/container/cube.h +++ b/src/include/zvec/ailego/container/cube.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/container/heap.h b/src/include/zvec/ailego/container/heap.h similarity index 100% rename from src/ailego/container/heap.h rename to src/include/zvec/ailego/container/heap.h diff --git a/src/ailego/container/hypercube.h b/src/include/zvec/ailego/container/hypercube.h similarity index 99% rename from src/ailego/container/hypercube.h rename to src/include/zvec/ailego/container/hypercube.h index 490714e1..75845ad1 100644 --- a/src/ailego/container/hypercube.h +++ b/src/include/zvec/ailego/container/hypercube.h @@ -16,7 +16,7 @@ #include #include -#include "cube.h" +#include namespace zvec { namespace ailego { diff --git a/src/ailego/container/params.h b/src/include/zvec/ailego/container/params.h similarity index 99% rename from src/ailego/container/params.h rename to src/include/zvec/ailego/container/params.h index 464bb6df..6e14a591 100644 --- a/src/ailego/container/params.h +++ b/src/include/zvec/ailego/container/params.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/container/vector.h b/src/include/zvec/ailego/container/vector.h similarity index 99% rename from src/ailego/container/vector.h rename to src/include/zvec/ailego/container/vector.h index 98cdef35..b6f23c82 100644 --- a/src/ailego/container/vector.h +++ b/src/include/zvec/ailego/container/vector.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/encoding/json.h b/src/include/zvec/ailego/encoding/json.h similarity index 92% rename from src/ailego/encoding/json.h rename to src/include/zvec/ailego/encoding/json.h index 6f8d34fa..595de104 100644 --- a/src/ailego/encoding/json.h +++ b/src/include/zvec/ailego/encoding/json.h @@ -14,4 +14,4 @@ #pragma once -#include "json/mod_json_plus.h" +#include diff --git a/src/ailego/encoding/json/mod_json.h b/src/include/zvec/ailego/encoding/json/mod_json.h similarity index 100% rename from src/ailego/encoding/json/mod_json.h rename to src/include/zvec/ailego/encoding/json/mod_json.h diff --git a/src/ailego/encoding/json/mod_json_plus.h b/src/include/zvec/ailego/encoding/json/mod_json_plus.h similarity index 100% rename from src/ailego/encoding/json/mod_json_plus.h rename to src/include/zvec/ailego/encoding/json/mod_json_plus.h diff --git a/src/ailego/hash/crc32c.h b/src/include/zvec/ailego/hash/crc32c.h similarity index 95% rename from src/ailego/hash/crc32c.h rename to src/include/zvec/ailego/hash/crc32c.h index c365af36..1add6301 100644 --- a/src/ailego/hash/crc32c.h +++ b/src/include/zvec/ailego/hash/crc32c.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/hash/jump_hash.h b/src/include/zvec/ailego/hash/jump_hash.h similarity index 96% rename from src/ailego/hash/jump_hash.h rename to src/include/zvec/ailego/hash/jump_hash.h index c9589385..74a1a9bd 100644 --- a/src/ailego/hash/jump_hash.h +++ b/src/include/zvec/ailego/hash/jump_hash.h @@ -14,8 +14,7 @@ #pragma once -#include - +#include namespace zvec { namespace ailego { diff --git a/src/ailego/internal/platform.h b/src/include/zvec/ailego/internal/platform.h similarity index 100% rename from src/ailego/internal/platform.h rename to src/include/zvec/ailego/internal/platform.h diff --git a/src/ailego/io/file.h b/src/include/zvec/ailego/io/file.h similarity index 99% rename from src/ailego/io/file.h rename to src/include/zvec/ailego/io/file.h index 54f6b6d0..e884bdbf 100644 --- a/src/ailego/io/file.h +++ b/src/include/zvec/ailego/io/file.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/io/mmap_file.h b/src/include/zvec/ailego/io/mmap_file.h similarity index 98% rename from src/ailego/io/mmap_file.h rename to src/include/zvec/ailego/io/mmap_file.h index 41a39022..f6404a6b 100644 --- a/src/ailego/io/mmap_file.h +++ b/src/include/zvec/ailego/io/mmap_file.h @@ -14,8 +14,8 @@ #pragma once -#include "ailego/internal/platform.h" -#include "file.h" +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/logger/logger.h b/src/include/zvec/ailego/logger/logger.h similarity index 98% rename from src/ailego/logger/logger.h rename to src/include/zvec/ailego/logger/logger.h index bf921f48..872d529f 100644 --- a/src/ailego/logger/logger.h +++ b/src/include/zvec/ailego/logger/logger.h @@ -16,8 +16,8 @@ #include #include -#include "ailego/container/params.h" -#include "ailego/pattern/factory.h" +#include +#include //! Register Index Logger #define FACTORY_REGISTER_LOGGER_ALIAS(__NAME__, __IMPL__, ...) \ diff --git a/src/ailego/parallel/thread_pool.h b/src/include/zvec/ailego/parallel/thread_pool.h similarity index 99% rename from src/ailego/parallel/thread_pool.h rename to src/include/zvec/ailego/parallel/thread_pool.h index 8bf56c05..150f014c 100644 --- a/src/ailego/parallel/thread_pool.h +++ b/src/include/zvec/ailego/parallel/thread_pool.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/parallel/thread_queue.h b/src/include/zvec/ailego/parallel/thread_queue.h similarity index 98% rename from src/ailego/parallel/thread_queue.h rename to src/include/zvec/ailego/parallel/thread_queue.h index 3940e724..c98a4369 100644 --- a/src/ailego/parallel/thread_queue.h +++ b/src/include/zvec/ailego/parallel/thread_queue.h @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/pattern/closure.h b/src/include/zvec/ailego/pattern/closure.h similarity index 100% rename from src/ailego/pattern/closure.h rename to src/include/zvec/ailego/pattern/closure.h diff --git a/src/ailego/pattern/factory.h b/src/include/zvec/ailego/pattern/factory.h similarity index 100% rename from src/ailego/pattern/factory.h rename to src/include/zvec/ailego/pattern/factory.h diff --git a/src/ailego/utility/file_helper.h b/src/include/zvec/ailego/utility/file_helper.h similarity index 100% rename from src/ailego/utility/file_helper.h rename to src/include/zvec/ailego/utility/file_helper.h diff --git a/src/ailego/utility/time_helper.h b/src/include/zvec/ailego/utility/time_helper.h similarity index 99% rename from src/ailego/utility/time_helper.h rename to src/include/zvec/ailego/utility/time_helper.h index b2535380..40bc3814 100644 --- a/src/ailego/utility/time_helper.h +++ b/src/include/zvec/ailego/utility/time_helper.h @@ -15,7 +15,7 @@ #pragma once #include -#include +#include namespace zvec { namespace ailego { diff --git a/src/ailego/utility/type_helper.h b/src/include/zvec/ailego/utility/type_helper.h similarity index 100% rename from src/ailego/utility/type_helper.h rename to src/include/zvec/ailego/utility/type_helper.h diff --git a/src/core/framework/index_builder.h b/src/include/zvec/core/framework/index_builder.h similarity index 90% rename from src/core/framework/index_builder.h rename to src/include/zvec/core/framework/index_builder.h index 8863e318..d1ea7f71 100644 --- a/src/core/framework/index_builder.h +++ b/src/include/zvec/core/framework/index_builder.h @@ -13,10 +13,10 @@ // limitations under the License. #pragma once -#include "index_helper.h" -#include "index_holder.h" -#include "index_meta.h" -#include "index_runner.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_bundle.h b/src/include/zvec/core/framework/index_bundle.h similarity index 98% rename from src/core/framework/index_bundle.h rename to src/include/zvec/core/framework/index_bundle.h index 2f345662..ea08959a 100644 --- a/src/core/framework/index_bundle.h +++ b/src/include/zvec/core/framework/index_bundle.h @@ -11,14 +11,15 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once #include #include #include -#include -#include -#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_cluster.h b/src/include/zvec/core/framework/index_cluster.h similarity index 95% rename from src/core/framework/index_cluster.h rename to src/include/zvec/core/framework/index_cluster.h index acb26b4c..19a2fdbf 100644 --- a/src/core/framework/index_cluster.h +++ b/src/include/zvec/core/framework/index_cluster.h @@ -13,14 +13,14 @@ // limitations under the License. #pragma once -#include -#include -#include -#include "index_bundle.h" -#include "index_features.h" -#include "index_meta.h" -#include "index_module.h" -#include "index_threads.h" +#include +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_context.h b/src/include/zvec/core/framework/index_context.h similarity index 94% rename from src/core/framework/index_context.h rename to src/include/zvec/core/framework/index_context.h index 20f62ba0..c77fcf42 100644 --- a/src/core/framework/index_context.h +++ b/src/include/zvec/core/framework/index_context.h @@ -15,13 +15,13 @@ #pragma once #include -#include -#include "index_document.h" -#include "index_error.h" -#include "index_filter.h" -#include "index_groupby.h" -#include "index_metric.h" -#include "index_stats.h" +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_converter.h b/src/include/zvec/core/framework/index_converter.h similarity index 97% rename from src/core/framework/index_converter.h rename to src/include/zvec/core/framework/index_converter.h index db6f7e8a..272bc315 100644 --- a/src/core/framework/index_converter.h +++ b/src/include/zvec/core/framework/index_converter.h @@ -14,10 +14,10 @@ #pragma once #include -#include "index_dumper.h" -#include "index_holder.h" -#include "index_meta.h" -#include "index_stats.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_document.h b/src/include/zvec/core/framework/index_document.h similarity index 98% rename from src/core/framework/index_document.h rename to src/include/zvec/core/framework/index_document.h index 37ac4f89..aa74e606 100644 --- a/src/core/framework/index_document.h +++ b/src/include/zvec/core/framework/index_document.h @@ -15,8 +15,8 @@ #include #include -#include -#include "index_storage.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_dumper.h b/src/include/zvec/core/framework/index_dumper.h similarity index 96% rename from src/core/framework/index_dumper.h rename to src/include/zvec/core/framework/index_dumper.h index 40133ab7..a638adcf 100644 --- a/src/core/framework/index_dumper.h +++ b/src/include/zvec/core/framework/index_dumper.h @@ -13,9 +13,9 @@ // limitations under the License. #pragma once -#include -#include "index_module.h" -#include "index_packer.h" +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_error.h b/src/include/zvec/core/framework/index_error.h similarity index 100% rename from src/core/framework/index_error.h rename to src/include/zvec/core/framework/index_error.h diff --git a/src/core/framework/index_factory.h b/src/include/zvec/core/framework/index_factory.h similarity index 93% rename from src/core/framework/index_factory.h rename to src/include/zvec/core/framework/index_factory.h index 9b9332fa..d891eaa5 100644 --- a/src/core/framework/index_factory.h +++ b/src/include/zvec/core/framework/index_factory.h @@ -11,22 +11,23 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include -#include "index_builder.h" -#include "index_cluster.h" -#include "index_converter.h" -#include "index_dumper.h" -#include "index_logger.h" -#include "index_metric.h" -#include "index_reducer.h" -#include "index_refiner.h" -#include "index_reformer.h" -#include "index_searcher.h" -#include "index_storage.h" -#include "index_streamer.h" -#include "index_trainer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_features.h b/src/include/zvec/core/framework/index_features.h similarity index 99% rename from src/core/framework/index_features.h rename to src/include/zvec/core/framework/index_features.h index 7efce6ba..49d08bb4 100644 --- a/src/core/framework/index_features.h +++ b/src/include/zvec/core/framework/index_features.h @@ -18,7 +18,7 @@ #include #include #include -#include "index_meta.h" +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_filter.h b/src/include/zvec/core/framework/index_filter.h similarity index 100% rename from src/core/framework/index_filter.h rename to src/include/zvec/core/framework/index_filter.h diff --git a/src/core/framework/index_flow.h b/src/include/zvec/core/framework/index_flow.h similarity index 99% rename from src/core/framework/index_flow.h rename to src/include/zvec/core/framework/index_flow.h index 19d132b5..737323cc 100644 --- a/src/core/framework/index_flow.h +++ b/src/include/zvec/core/framework/index_flow.h @@ -13,8 +13,9 @@ // limitations under the License. #pragma once -#include "index_factory.h" - +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_format.h b/src/include/zvec/core/framework/index_format.h similarity index 98% rename from src/core/framework/index_format.h rename to src/include/zvec/core/framework/index_format.h index 0f5e9966..d3b7179c 100644 --- a/src/core/framework/index_format.h +++ b/src/include/zvec/core/framework/index_format.h @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include namespace zvec { namespace core { diff --git a/src/include/zvec/core/framework/index_framework.h b/src/include/zvec/core/framework/index_framework.h new file mode 100644 index 00000000..17de2220 --- /dev/null +++ b/src/include/zvec/core/framework/index_framework.h @@ -0,0 +1,32 @@ +// Copyright 2025-present the zvec project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/core/framework/index_groupby.h b/src/include/zvec/core/framework/index_groupby.h similarity index 100% rename from src/core/framework/index_groupby.h rename to src/include/zvec/core/framework/index_groupby.h diff --git a/src/core/framework/index_helper.h b/src/include/zvec/core/framework/index_helper.h similarity index 91% rename from src/core/framework/index_helper.h rename to src/include/zvec/core/framework/index_helper.h index 41ae1f03..a9622ae1 100644 --- a/src/core/framework/index_helper.h +++ b/src/include/zvec/core/framework/index_helper.h @@ -11,12 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include "index_dumper.h" -#include "index_holder.h" -#include "index_meta.h" -#include "index_storage.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_holder.h b/src/include/zvec/core/framework/index_holder.h similarity index 99% rename from src/core/framework/index_holder.h rename to src/include/zvec/core/framework/index_holder.h index 4dff9e31..7bb9ba9c 100644 --- a/src/core/framework/index_holder.h +++ b/src/include/zvec/core/framework/index_holder.h @@ -17,12 +17,11 @@ #include #include #include -#include -#include #include -#include "ailego/container/vector.h" -#include "index_features.h" -#include "index_meta.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_logger.h b/src/include/zvec/core/framework/index_logger.h similarity index 98% rename from src/core/framework/index_logger.h rename to src/include/zvec/core/framework/index_logger.h index 58d6db97..3263850f 100644 --- a/src/core/framework/index_logger.h +++ b/src/include/zvec/core/framework/index_logger.h @@ -11,13 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once #include -#include #include -#include "ailego/container/params.h" -#include "ailego/logger/logger.h" +#include +#include #include "index_module.h" #define ZVEC_LOG_IMPL(level, format, ...) \ diff --git a/src/core/framework/index_mapping.h b/src/include/zvec/core/framework/index_mapping.h similarity index 97% rename from src/core/framework/index_mapping.h rename to src/include/zvec/core/framework/index_mapping.h index 96bf347d..7074088c 100644 --- a/src/core/framework/index_mapping.h +++ b/src/include/zvec/core/framework/index_mapping.h @@ -14,9 +14,9 @@ #pragma once #include -#include -#include -#include "index_format.h" +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_memory.h b/src/include/zvec/core/framework/index_memory.h similarity index 100% rename from src/core/framework/index_memory.h rename to src/include/zvec/core/framework/index_memory.h diff --git a/src/core/framework/index_meta.h b/src/include/zvec/core/framework/index_meta.h similarity index 99% rename from src/core/framework/index_meta.h rename to src/include/zvec/core/framework/index_meta.h index bdbecc72..d4ef59e8 100644 --- a/src/core/framework/index_meta.h +++ b/src/include/zvec/core/framework/index_meta.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "ailego/container/params.h" +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_metric.h b/src/include/zvec/core/framework/index_metric.h similarity index 94% rename from src/core/framework/index_metric.h rename to src/include/zvec/core/framework/index_metric.h index ef1a9927..5d93ba12 100644 --- a/src/core/framework/index_metric.h +++ b/src/include/zvec/core/framework/index_metric.h @@ -14,11 +14,11 @@ #pragma once #include -#include -#include -#include "index_error.h" -#include "index_meta.h" -#include "index_module.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_module.h b/src/include/zvec/core/framework/index_module.h similarity index 100% rename from src/core/framework/index_module.h rename to src/include/zvec/core/framework/index_module.h diff --git a/src/core/framework/index_packer.h b/src/include/zvec/core/framework/index_packer.h similarity index 96% rename from src/core/framework/index_packer.h rename to src/include/zvec/core/framework/index_packer.h index 7181e0ed..3b89e129 100644 --- a/src/core/framework/index_packer.h +++ b/src/include/zvec/core/framework/index_packer.h @@ -11,12 +11,14 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include -#include "index_error.h" -#include "index_format.h" -#include "index_version.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_plugin.h b/src/include/zvec/core/framework/index_plugin.h similarity index 99% rename from src/core/framework/index_plugin.h rename to src/include/zvec/core/framework/index_plugin.h index 954ed980..9229363e 100644 --- a/src/core/framework/index_plugin.h +++ b/src/include/zvec/core/framework/index_plugin.h @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once #include diff --git a/src/core/framework/index_provider.h b/src/include/zvec/core/framework/index_provider.h similarity index 93% rename from src/core/framework/index_provider.h rename to src/include/zvec/core/framework/index_provider.h index 93d56711..b5ce143b 100644 --- a/src/core/framework/index_provider.h +++ b/src/include/zvec/core/framework/index_provider.h @@ -11,11 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include "index_error.h" -#include "index_holder.h" -#include "index_storage.h" +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_reducer.h b/src/include/zvec/core/framework/index_reducer.h similarity index 93% rename from src/core/framework/index_reducer.h rename to src/include/zvec/core/framework/index_reducer.h index 5c85bc5d..911a0e10 100644 --- a/src/core/framework/index_reducer.h +++ b/src/include/zvec/core/framework/index_reducer.h @@ -14,15 +14,15 @@ #pragma once -#include "ailego/parallel/thread_pool.h" -#include "index_builder.h" -#include "index_converter.h" -#include "index_dumper.h" -#include "index_error.h" -#include "index_filter.h" -#include "index_reformer.h" -#include "index_stats.h" -#include "index_streamer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_refiner.h b/src/include/zvec/core/framework/index_refiner.h similarity index 93% rename from src/core/framework/index_refiner.h rename to src/include/zvec/core/framework/index_refiner.h index 3b73e501..de850d12 100644 --- a/src/core/framework/index_refiner.h +++ b/src/include/zvec/core/framework/index_refiner.h @@ -15,11 +15,11 @@ #pragma once #include -#include -#include "index_context.h" -#include "index_helper.h" -#include "index_searcher.h" -#include "index_streamer.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_reformer.h b/src/include/zvec/core/framework/index_reformer.h similarity index 98% rename from src/core/framework/index_reformer.h rename to src/include/zvec/core/framework/index_reformer.h index 290dbb35..f2cfa0d5 100644 --- a/src/core/framework/index_reformer.h +++ b/src/include/zvec/core/framework/index_reformer.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "index_document.h" -#include "index_meta.h" +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_runner.h b/src/include/zvec/core/framework/index_runner.h similarity index 98% rename from src/core/framework/index_runner.h rename to src/include/zvec/core/framework/index_runner.h index 3b032ca5..72d39e97 100644 --- a/src/core/framework/index_runner.h +++ b/src/include/zvec/core/framework/index_runner.h @@ -15,15 +15,15 @@ #pragma once #include -#include "index_context.h" -#include "index_dumper.h" -#include "index_meta.h" -#include "index_metric.h" -#include "index_module.h" -#include "index_provider.h" -#include "index_stats.h" -#include "index_threads.h" -#include "index_trainer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_searcher.h b/src/include/zvec/core/framework/index_searcher.h similarity index 80% rename from src/core/framework/index_searcher.h rename to src/include/zvec/core/framework/index_searcher.h index 0349bd83..4308c8c0 100644 --- a/src/core/framework/index_searcher.h +++ b/src/include/zvec/core/framework/index_searcher.h @@ -11,16 +11,16 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include -#include "index_context.h" -#include "index_meta.h" -#include "index_metric.h" -#include "index_module.h" -#include "index_provider.h" -#include "index_runner.h" -#include "index_stats.h" +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_segment_storage.h b/src/include/zvec/core/framework/index_segment_storage.h similarity index 97% rename from src/core/framework/index_segment_storage.h rename to src/include/zvec/core/framework/index_segment_storage.h index 0a8e121a..82b316d1 100644 --- a/src/core/framework/index_segment_storage.h +++ b/src/include/zvec/core/framework/index_segment_storage.h @@ -13,10 +13,10 @@ // limitations under the License. #pragma once -#include "ailego/container/params.h" -#include "index_module.h" -#include "index_storage.h" -#include "index_unpacker.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_stats.h b/src/include/zvec/core/framework/index_stats.h similarity index 97% rename from src/core/framework/index_stats.h rename to src/include/zvec/core/framework/index_stats.h index 868ec513..71d4426d 100644 --- a/src/core/framework/index_stats.h +++ b/src/include/zvec/core/framework/index_stats.h @@ -11,9 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include "ailego/container/params.h" +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_storage.h b/src/include/zvec/core/framework/index_storage.h similarity index 97% rename from src/core/framework/index_storage.h rename to src/include/zvec/core/framework/index_storage.h index ca3e98e3..8673d63e 100644 --- a/src/core/framework/index_storage.h +++ b/src/include/zvec/core/framework/index_storage.h @@ -11,12 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include -#include -#include "index_error.h" -#include "index_module.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_streamer.h b/src/include/zvec/core/framework/index_streamer.h similarity index 85% rename from src/core/framework/index_streamer.h rename to src/include/zvec/core/framework/index_streamer.h index 73351546..09ea86f4 100644 --- a/src/core/framework/index_streamer.h +++ b/src/include/zvec/core/framework/index_streamer.h @@ -13,12 +13,11 @@ // limitations under the License. #pragma once -#include -#include "index_context.h" -#include "index_helper.h" -#include "index_provider.h" -#include "index_runner.h" -#include "index_stats.h" +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_threads.h b/src/include/zvec/core/framework/index_threads.h similarity index 96% rename from src/core/framework/index_threads.h rename to src/include/zvec/core/framework/index_threads.h index 5b9fa0dd..3e0ccc41 100644 --- a/src/core/framework/index_threads.h +++ b/src/include/zvec/core/framework/index_threads.h @@ -11,17 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include -#include -#include -#include #include #include -#include -#include -#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_trainer.h b/src/include/zvec/core/framework/index_trainer.h similarity index 87% rename from src/core/framework/index_trainer.h rename to src/include/zvec/core/framework/index_trainer.h index 6ad6fdcb..9582b054 100644 --- a/src/core/framework/index_trainer.h +++ b/src/include/zvec/core/framework/index_trainer.h @@ -11,16 +11,17 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include "index_bundle.h" -#include "index_dumper.h" -#include "index_error.h" -#include "index_holder.h" -#include "index_meta.h" -#include "index_stats.h" -#include "index_storage.h" -#include "index_threads.h" +#include +#include +#include +#include +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_unpacker.h b/src/include/zvec/core/framework/index_unpacker.h similarity index 98% rename from src/core/framework/index_unpacker.h rename to src/include/zvec/core/framework/index_unpacker.h index 8d607a40..425ad12d 100644 --- a/src/core/framework/index_unpacker.h +++ b/src/include/zvec/core/framework/index_unpacker.h @@ -11,13 +11,14 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once #include -#include -#include "index_error.h" -#include "index_format.h" -#include "index_logger.h" +#include +#include +#include +#include namespace zvec { namespace core { diff --git a/src/core/framework/index_version.h b/src/include/zvec/core/framework/index_version.h similarity index 99% rename from src/core/framework/index_version.h rename to src/include/zvec/core/framework/index_version.h index 0037667f..f5fa7e6a 100644 --- a/src/core/framework/index_version.h +++ b/src/include/zvec/core/framework/index_version.h @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once namespace zvec { diff --git a/src/include/zvec/core/interface/constants.h b/src/include/zvec/core/interface/constants.h index 4efcdfa1..79d563bf 100644 --- a/src/include/zvec/core/interface/constants.h +++ b/src/include/zvec/core/interface/constants.h @@ -1,3 +1,17 @@ +// Copyright 2025-present the zvec project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #pragma once #include diff --git a/src/core/interface/index.h b/src/include/zvec/core/interface/index.h similarity index 85% rename from src/core/interface/index.h rename to src/include/zvec/core/interface/index.h index 78d11437..71258cb0 100644 --- a/src/core/interface/index.h +++ b/src/include/zvec/core/interface/index.h @@ -11,30 +11,26 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once -#include + #include -#include -#include #include #include #include #include -#include -#include "core/framework/index_context.h" -#include "core/framework/index_converter.h" -#include "core/framework/index_factory.h" -#include "core/framework/index_filter.h" -#include "core/framework/index_holder.h" -#include "core/framework/index_meta.h" -#include "core/framework/index_metric.h" -#include "core/framework/index_reducer.h" -#include "core/framework/index_reformer.h" -#include "core/framework/index_searcher.h" -#include "core/framework/index_storage.h" -#include "core/mixed_reducer/mixed_reducer_params.h" -#include "index_param.h" -#include "index_param_builders.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace zvec::core_interface { @@ -102,11 +98,6 @@ struct SearchResult { std::vector reverted_sparse_values_list_{}; }; -// eliminate the pre-alloc of the context pool -thread_local static std::array() - 1) * 2> - _context_list; - class Index { public: typedef std::shared_ptr Pointer; @@ -200,24 +191,8 @@ class Index { virtual int CreateAndInitStreamer(const BaseIndexParam ¶m) = 0; protected: - bool init_context() { - context_index_ = (magic_enum::enum_integer(param_.index_type) - 1) * 2 + - static_cast(is_sparse_); - if (_context_list[context_index_] == nullptr) { - if ((_context_list[context_index_] = streamer_->create_context()) == - nullptr) { - LOG_ERROR("Failed to create context"); - return false; - } - } - return true; - } - - core::IndexContext::Pointer &acquire_context() { - init_context(); - return _context_list[context_index_]; - } - + bool init_context(); + core::IndexContext::Pointer &acquire_context(); void release_context() { // context_list_[get_context_index()]->reset(); } diff --git a/src/include/zvec/core/interface/index_factory.h b/src/include/zvec/core/interface/index_factory.h new file mode 100644 index 00000000..d0be6ee4 --- /dev/null +++ b/src/include/zvec/core/interface/index_factory.h @@ -0,0 +1,54 @@ +// Copyright 2025-present the zvec project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include + +namespace zvec::core_interface { + +// 索引的工厂类 +class IndexFactory { + public: + static Index::Pointer CreateAndInitIndex(const BaseIndexParam ¶m); + + static BaseIndexParam::Pointer DeserializeIndexParamFromJson( + const std::string &json_str); + + + static std::string QueryParamSerializeToJson( + const BaseIndexQueryParam ¶m); + + + template < + typename QueryParamType, + std::enable_if_t, + bool> = true> + static std::string QueryParamSerializeToJson(const QueryParamType ¶m, + bool omit_empty_value = false); + + template < + typename QueryParamType, + std::enable_if_t, + bool> = true> + static typename QueryParamType::Pointer QueryParamDeserializeFromJson( + const std::string &json_str); + + // register() -- Index class should have a `create` interface +}; + + +} // namespace zvec::core_interface \ No newline at end of file diff --git a/src/core/interface/index_param.h b/src/include/zvec/core/interface/index_param.h similarity index 89% rename from src/core/interface/index_param.h rename to src/include/zvec/core/interface/index_param.h index ff7cc980..98da5b12 100644 --- a/src/core/interface/index_param.h +++ b/src/include/zvec/core/interface/index_param.h @@ -11,28 +11,18 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// Created by wangjianning.wjn on 8/28/25. -// -#ifndef ZVEC_INDEX_PARAM_H -#define ZVEC_INDEX_PARAM_H #pragma once -#include #include -#include -#include #include #include #include -#include -#include -#include +#include +#include +#include +#include #include -#include "core/framework/index_filter.h" -#include "core/framework/index_meta.h" -#include "utils/utils.h" namespace zvec::core_interface { #define MAX_DIMENSION 65536 @@ -131,20 +121,10 @@ struct QuantizerParam : public SerializableBase { protected: friend class BaseIndexParam; virtual ailego::JsonObject SerializeToJsonObject( - bool omit_empty_value = false) const override { - ailego::JsonObject json_obj; - if (!omit_empty_value || type != QuantizerType::kNone) { - json_obj.set("type", - zvec::ailego::JsonValue(magic_enum::enum_name(type).data())); - } - return json_obj; - } + bool omit_empty_value = false) const override; virtual bool DeserializeFromJsonObject( - const ailego::JsonObject &json_obj) override { - DESERIALIZE_ENUM_FIELD(json_obj, type, QuantizerType); - return true; - } + const ailego::JsonObject &json_obj) override; }; // preprocessor @@ -314,8 +294,8 @@ struct IVFIndexParam : public BaseIndexParam { struct HNSWIndexParam : public BaseIndexParam { using Pointer = std::shared_ptr; - int m = kDefaultHnswNeighborCnt; // 图中每个点的邻居数 - int ef_construction = kDefaultHnswEfConstruction; // 构建时的邻居候选大小 + int m = kDefaultHnswNeighborCnt; + int ef_construction = kDefaultHnswEfConstruction; // Constructors with delegation HNSWIndexParam() : BaseIndexParam(IndexType::kHNSW) {} @@ -336,5 +316,4 @@ struct HNSWIndexParam : public BaseIndexParam { bool omit_empty_value = false) const override; }; -} // namespace zvec::core_interface -#endif // ZVEC_INDEX_PARAM_H +} // namespace zvec::core_interface \ No newline at end of file diff --git a/src/core/interface/index_param_builders.h b/src/include/zvec/core/interface/index_param_builders.h similarity index 94% rename from src/core/interface/index_param_builders.h rename to src/include/zvec/core/interface/index_param_builders.h index 2f8afb75..f319450d 100644 --- a/src/core/interface/index_param_builders.h +++ b/src/include/zvec/core/interface/index_param_builders.h @@ -1,13 +1,24 @@ -#ifndef ZVEC_INDEX_PARAM_BUILDERS_H -#define ZVEC_INDEX_PARAM_BUILDERS_H +// Copyright 2025-present the zvec project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #pragma once #include -#include "index_param.h" +#include namespace zvec::core_interface { - // struct ConditionalIndexParam { // // predicate / rule / threshold // // candidate @@ -336,6 +347,6 @@ class SCANNIndexParamBuilder { return param_ptr; } }; + } // namespace predefined -} // namespace zvec::core_interface -#endif // ZVEC_INDEX_PARAM_BUILDERS_H \ No newline at end of file +} // namespace zvec::core_interface \ No newline at end of file diff --git a/tests/ailego/algorithm/kmeans_test.cc b/tests/ailego/algorithm/kmeans_test.cc index 1eeef5a2..0dabbc0a 100644 --- a/tests/ailego/algorithm/kmeans_test.cc +++ b/tests/ailego/algorithm/kmeans_test.cc @@ -13,9 +13,9 @@ // limitations under the License. #include -#include -#include #include +#include +#include #define protected public #define private public diff --git a/tests/ailego/buffer/buffer_manager_test.cc b/tests/ailego/buffer/buffer_manager_test.cc index e11bbc91..637c3ee9 100644 --- a/tests/ailego/buffer/buffer_manager_test.cc +++ b/tests/ailego/buffer/buffer_manager_test.cc @@ -14,9 +14,9 @@ #include #include -#include #include -#include "ailego/logger/logger.h" +#include +#include #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push diff --git a/tests/ailego/container/bitmap_test.cc b/tests/ailego/container/bitmap_test.cc index 25ed3ed1..9d5c2151 100644 --- a/tests/ailego/container/bitmap_test.cc +++ b/tests/ailego/container/bitmap_test.cc @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #if defined(__AVX2__) #define INTRINSICS_SET "AVX2" diff --git a/tests/ailego/container/blob_test.cc b/tests/ailego/container/blob_test.cc index 52b880b5..8bb7ad4c 100644 --- a/tests/ailego/container/blob_test.cc +++ b/tests/ailego/container/blob_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include -#include #include +#include using namespace zvec; diff --git a/tests/ailego/container/cube_test.cc b/tests/ailego/container/cube_test.cc index 1f1ae5ac..ab6e4863 100644 --- a/tests/ailego/container/cube_test.cc +++ b/tests/ailego/container/cube_test.cc @@ -14,8 +14,8 @@ #include #include -#include #include +#include using namespace zvec::ailego; diff --git a/tests/ailego/container/heap_test.cc b/tests/ailego/container/heap_test.cc index cec59cc8..1eaa4fdb 100644 --- a/tests/ailego/container/heap_test.cc +++ b/tests/ailego/container/heap_test.cc @@ -13,9 +13,9 @@ // limitations under the License. #include -#include -#include #include +#include +#include using namespace zvec; diff --git a/tests/ailego/container/hypercube_test.cc b/tests/ailego/container/hypercube_test.cc index fbca9672..3fedad13 100644 --- a/tests/ailego/container/hypercube_test.cc +++ b/tests/ailego/container/hypercube_test.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include +#include using namespace zvec::ailego; diff --git a/tests/ailego/container/params_test.cc b/tests/ailego/container/params_test.cc index b4426a9f..67fd3746 100644 --- a/tests/ailego/container/params_test.cc +++ b/tests/ailego/container/params_test.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/container/vector_array_test.cc b/tests/ailego/container/vector_array_test.cc index 56ff3ba8..f7e2e13f 100644 --- a/tests/ailego/container/vector_array_test.cc +++ b/tests/ailego/container/vector_array_test.cc @@ -14,8 +14,8 @@ #include #include -#include #include +#include using namespace zvec; diff --git a/tests/ailego/container/vector_test.cc b/tests/ailego/container/vector_test.cc index b80d84b9..4fa6d75a 100644 --- a/tests/ailego/container/vector_test.cc +++ b/tests/ailego/container/vector_test.cc @@ -13,9 +13,9 @@ // limitations under the License. #include -#include -#include #include +#include +#include using namespace zvec; diff --git a/tests/ailego/encoding/json_parse_test.cc b/tests/ailego/encoding/json_parse_test.cc index 072ab821..f4261522 100644 --- a/tests/ailego/encoding/json_parse_test.cc +++ b/tests/ailego/encoding/json_parse_test.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include +#include using namespace zvec::ailego; diff --git a/tests/ailego/hash/crc32c_test.cc b/tests/ailego/hash/crc32c_test.cc index 2187834e..f7371cb1 100644 --- a/tests/ailego/hash/crc32c_test.cc +++ b/tests/ailego/hash/crc32c_test.cc @@ -14,9 +14,9 @@ #include #include -#include -#include #include +#include +#include using namespace zvec; diff --git a/tests/ailego/hash/jump_hash_test.cc b/tests/ailego/hash/jump_hash_test.cc index 38bd3ab1..35294a5d 100644 --- a/tests/ailego/hash/jump_hash_test.cc +++ b/tests/ailego/hash/jump_hash_test.cc @@ -16,10 +16,10 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/io/file_test.cc b/tests/ailego/io/file_test.cc index 01202332..b7187361 100644 --- a/tests/ailego/io/file_test.cc +++ b/tests/ailego/io/file_test.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include #include +#include using namespace zvec::ailego; diff --git a/tests/ailego/io/mmap_file_test.cc b/tests/ailego/io/mmap_file_test.cc index 96f5a2fb..13851b18 100644 --- a/tests/ailego/io/mmap_file_test.cc +++ b/tests/ailego/io/mmap_file_test.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/logger/logger_test.cc b/tests/ailego/logger/logger_test.cc index e9b6083b..ca05ba04 100644 --- a/tests/ailego/logger/logger_test.cc +++ b/tests/ailego/logger/logger_test.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/cosine_distance_matrix_fp16_test.cc b/tests/ailego/math/cosine_distance_matrix_fp16_test.cc index 396fb254..be575ce0 100644 --- a/tests/ailego/math/cosine_distance_matrix_fp16_test.cc +++ b/tests/ailego/math/cosine_distance_matrix_fp16_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/cosine_distance_matrix_fp32_test.cc b/tests/ailego/math/cosine_distance_matrix_fp32_test.cc index dd3ad07a..4e7c2ccf 100644 --- a/tests/ailego/math/cosine_distance_matrix_fp32_test.cc +++ b/tests/ailego/math/cosine_distance_matrix_fp32_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/cosine_distance_matrix_int8_test.cc b/tests/ailego/math/cosine_distance_matrix_int8_test.cc index 3de7f17d..0ef36a6e 100644 --- a/tests/ailego/math/cosine_distance_matrix_int8_test.cc +++ b/tests/ailego/math/cosine_distance_matrix_int8_test.cc @@ -14,12 +14,12 @@ #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/euclidean_distance_matrix_fp16_test.cc b/tests/ailego/math/euclidean_distance_matrix_fp16_test.cc index 39768096..6d647c3c 100644 --- a/tests/ailego/math/euclidean_distance_matrix_fp16_test.cc +++ b/tests/ailego/math/euclidean_distance_matrix_fp16_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/euclidean_distance_matrix_fp32_test.cc b/tests/ailego/math/euclidean_distance_matrix_fp32_test.cc index 4f0f71d7..10fe3da6 100644 --- a/tests/ailego/math/euclidean_distance_matrix_fp32_test.cc +++ b/tests/ailego/math/euclidean_distance_matrix_fp32_test.cc @@ -18,11 +18,11 @@ #include #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/euclidean_distance_matrix_int4_test.cc b/tests/ailego/math/euclidean_distance_matrix_int4_test.cc index 3a0aecb3..94c1bd0f 100644 --- a/tests/ailego/math/euclidean_distance_matrix_int4_test.cc +++ b/tests/ailego/math/euclidean_distance_matrix_int4_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/euclidean_distance_matrix_int8_test.cc b/tests/ailego/math/euclidean_distance_matrix_int8_test.cc index b1ddab0b..6fd003b2 100644 --- a/tests/ailego/math/euclidean_distance_matrix_int8_test.cc +++ b/tests/ailego/math/euclidean_distance_matrix_int8_test.cc @@ -18,11 +18,11 @@ #include #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/hamming_distance_matrix_test.cc b/tests/ailego/math/hamming_distance_matrix_test.cc index 62a7a62e..3c423815 100644 --- a/tests/ailego/math/hamming_distance_matrix_test.cc +++ b/tests/ailego/math/hamming_distance_matrix_test.cc @@ -19,11 +19,11 @@ #include #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/inner_product_matrix_fp16_test.cc b/tests/ailego/math/inner_product_matrix_fp16_test.cc index 95164942..2d3999c0 100644 --- a/tests/ailego/math/inner_product_matrix_fp16_test.cc +++ b/tests/ailego/math/inner_product_matrix_fp16_test.cc @@ -19,11 +19,11 @@ #include #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/inner_product_matrix_fp32_test.cc b/tests/ailego/math/inner_product_matrix_fp32_test.cc index 80616b72..1c3377fa 100644 --- a/tests/ailego/math/inner_product_matrix_fp32_test.cc +++ b/tests/ailego/math/inner_product_matrix_fp32_test.cc @@ -18,11 +18,11 @@ #include #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/inner_product_matrix_int4_test.cc b/tests/ailego/math/inner_product_matrix_int4_test.cc index bd7316ef..04a540bf 100644 --- a/tests/ailego/math/inner_product_matrix_int4_test.cc +++ b/tests/ailego/math/inner_product_matrix_int4_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/inner_product_matrix_int8_test.cc b/tests/ailego/math/inner_product_matrix_int8_test.cc index fafd01ca..b47f23eb 100644 --- a/tests/ailego/math/inner_product_matrix_int8_test.cc +++ b/tests/ailego/math/inner_product_matrix_int8_test.cc @@ -18,11 +18,11 @@ #include #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/mips_euclidean_distance_matrix_fp16_test.cc b/tests/ailego/math/mips_euclidean_distance_matrix_fp16_test.cc index 81ad6211..8175bcbd 100644 --- a/tests/ailego/math/mips_euclidean_distance_matrix_fp16_test.cc +++ b/tests/ailego/math/mips_euclidean_distance_matrix_fp16_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/mips_euclidean_distance_matrix_fp32_test.cc b/tests/ailego/math/mips_euclidean_distance_matrix_fp32_test.cc index 9ae40af9..cb2a58c7 100644 --- a/tests/ailego/math/mips_euclidean_distance_matrix_fp32_test.cc +++ b/tests/ailego/math/mips_euclidean_distance_matrix_fp32_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/mips_euclidean_distance_matrix_int4_test.cc b/tests/ailego/math/mips_euclidean_distance_matrix_int4_test.cc index c73c1280..d4144ee8 100644 --- a/tests/ailego/math/mips_euclidean_distance_matrix_int4_test.cc +++ b/tests/ailego/math/mips_euclidean_distance_matrix_int4_test.cc @@ -20,12 +20,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/mips_euclidean_distance_matrix_int8_test.cc b/tests/ailego/math/mips_euclidean_distance_matrix_int8_test.cc index ac1ab6f8..f371896f 100644 --- a/tests/ailego/math/mips_euclidean_distance_matrix_int8_test.cc +++ b/tests/ailego/math/mips_euclidean_distance_matrix_int8_test.cc @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/math/norm_matrix_fp16_test.cc b/tests/ailego/math/norm_matrix_fp16_test.cc index 3366f832..e68a3b07 100644 --- a/tests/ailego/math/norm_matrix_fp16_test.cc +++ b/tests/ailego/math/norm_matrix_fp16_test.cc @@ -14,11 +14,11 @@ #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/norm_matrix_fp32_test.cc b/tests/ailego/math/norm_matrix_fp32_test.cc index 1198ec84..494827b4 100644 --- a/tests/ailego/math/norm_matrix_fp32_test.cc +++ b/tests/ailego/math/norm_matrix_fp32_test.cc @@ -14,12 +14,12 @@ #include #include -#include #include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/norm_matrix_int4_test.cc b/tests/ailego/math/norm_matrix_int4_test.cc index c5a2ff53..7dc69cf7 100644 --- a/tests/ailego/math/norm_matrix_int4_test.cc +++ b/tests/ailego/math/norm_matrix_int4_test.cc @@ -14,11 +14,11 @@ #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/norm_matrix_int8_test.cc b/tests/ailego/math/norm_matrix_int8_test.cc index f6ef5b41..483800c7 100644 --- a/tests/ailego/math/norm_matrix_int8_test.cc +++ b/tests/ailego/math/norm_matrix_int8_test.cc @@ -14,11 +14,11 @@ #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/math/normalizer_test.cc b/tests/ailego/math/normalizer_test.cc index 83dae7b0..c576c054 100644 --- a/tests/ailego/math/normalizer_test.cc +++ b/tests/ailego/math/normalizer_test.cc @@ -14,11 +14,11 @@ #include #include -#include #include #include -#include #include +#include +#include using namespace zvec::ailego; diff --git a/tests/ailego/parallel/lock_test.cc b/tests/ailego/parallel/lock_test.cc index 6b37a781..2a98e8e9 100644 --- a/tests/ailego/parallel/lock_test.cc +++ b/tests/ailego/parallel/lock_test.cc @@ -14,8 +14,8 @@ #include #include -#include #include +#include using namespace zvec; diff --git a/tests/ailego/parallel/multi_thread_list_test.cc b/tests/ailego/parallel/multi_thread_list_test.cc index 0a3aa3b1..07fd8a92 100644 --- a/tests/ailego/parallel/multi_thread_list_test.cc +++ b/tests/ailego/parallel/multi_thread_list_test.cc @@ -14,7 +14,7 @@ #include #include -#include "ailego/parallel/thread_pool.h" +#include #define private public #include diff --git a/tests/ailego/parallel/semaphore_test.cc b/tests/ailego/parallel/semaphore_test.cc index 62c21893..b9e61a83 100644 --- a/tests/ailego/parallel/semaphore_test.cc +++ b/tests/ailego/parallel/semaphore_test.cc @@ -14,9 +14,9 @@ #include #include -#include -#include #include +#include +#include using namespace zvec; diff --git a/tests/ailego/parallel/thread_pool_test.cc b/tests/ailego/parallel/thread_pool_test.cc index 2ea66626..70459f53 100644 --- a/tests/ailego/parallel/thread_pool_test.cc +++ b/tests/ailego/parallel/thread_pool_test.cc @@ -15,8 +15,8 @@ #include #include #include -#include #include +#include using namespace zvec::ailego; diff --git a/tests/ailego/parallel/thread_queue_test.cc b/tests/ailego/parallel/thread_queue_test.cc index e0fc71e8..6a18b4ee 100644 --- a/tests/ailego/parallel/thread_queue_test.cc +++ b/tests/ailego/parallel/thread_queue_test.cc @@ -15,9 +15,9 @@ #include #include #include -#include -#include #include +#include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/pattern/closure_test.cc b/tests/ailego/pattern/closure_test.cc index f17c9d1b..9e457b13 100644 --- a/tests/ailego/pattern/closure_test.cc +++ b/tests/ailego/pattern/closure_test.cc @@ -14,9 +14,9 @@ #include #include -#include -#include #include +#include +#include using namespace zvec; diff --git a/tests/ailego/pattern/factory_test.cc b/tests/ailego/pattern/factory_test.cc index 5f29cee4..e80aa1ae 100644 --- a/tests/ailego/pattern/factory_test.cc +++ b/tests/ailego/pattern/factory_test.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include +#include using namespace zvec; using namespace zvec::ailego; diff --git a/tests/ailego/pattern/singleton_test.cc b/tests/ailego/pattern/singleton_test.cc index 951495db..adcf30d7 100644 --- a/tests/ailego/pattern/singleton_test.cc +++ b/tests/ailego/pattern/singleton_test.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include +#include #include using namespace zvec::ailego; diff --git a/tests/ailego/utility/bit_string_helper_test.cc b/tests/ailego/utility/bit_string_helper_test.cc index 198f5b4b..3fb2ad2e 100644 --- a/tests/ailego/utility/bit_string_helper_test.cc +++ b/tests/ailego/utility/bit_string_helper_test.cc @@ -15,8 +15,8 @@ #include #include #include -#include #include +#include using namespace zvec; diff --git a/tests/ailego/utility/bitset_helper_test.cc b/tests/ailego/utility/bitset_helper_test.cc index 7ac0c1b5..0b5b6df2 100644 --- a/tests/ailego/utility/bitset_helper_test.cc +++ b/tests/ailego/utility/bitset_helper_test.cc @@ -15,8 +15,8 @@ #include #include #include -#include #include +#include using namespace zvec; diff --git a/tests/ailego/utility/time_helper_test.cc b/tests/ailego/utility/time_helper_test.cc index e34fbd46..f0cef9b8 100644 --- a/tests/ailego/utility/time_helper_test.cc +++ b/tests/ailego/utility/time_helper_test.cc @@ -14,8 +14,8 @@ #include #include -#include #include +#include using namespace zvec; diff --git a/tests/ailego/utility/type_helper_test.cc b/tests/ailego/utility/type_helper_test.cc index 57e5a20b..b3180bf7 100644 --- a/tests/ailego/utility/type_helper_test.cc +++ b/tests/ailego/utility/type_helper_test.cc @@ -13,9 +13,9 @@ // limitations under the License. #include -#include #include #include +#include using namespace zvec; diff --git a/tests/core/algorithm/cluster/kmeans_cluster_test.cc b/tests/core/algorithm/cluster/kmeans_cluster_test.cc index fdfd511a..268b076f 100644 --- a/tests/core/algorithm/cluster/kmeans_cluster_test.cc +++ b/tests/core/algorithm/cluster/kmeans_cluster_test.cc @@ -14,10 +14,10 @@ #include #include -#include #include -#include "framework/index_framework.h" -#include "framework/index_meta.h" +#include +#include "zvec/core/framework/index_framework.h" +#include "zvec/core/framework/index_meta.h" using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/cluster/opt_kmeans_cluster_test.cc b/tests/core/algorithm/cluster/opt_kmeans_cluster_test.cc index c4f4493b..b195b48d 100644 --- a/tests/core/algorithm/cluster/opt_kmeans_cluster_test.cc +++ b/tests/core/algorithm/cluster/opt_kmeans_cluster_test.cc @@ -15,9 +15,9 @@ #include #include #include -#include #include -#include "framework/index_framework.h" +#include +#include "zvec/core/framework/index_framework.h" using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/flat/flat_searcher_test.cpp b/tests/core/algorithm/flat/flat_searcher_test.cpp index dc792111..573cb739 100644 --- a/tests/core/algorithm/flat/flat_searcher_test.cpp +++ b/tests/core/algorithm/flat/flat_searcher_test.cpp @@ -16,9 +16,9 @@ #include #include #include -#include #include #include +#include #include "flat/flat_builder.h" using namespace zvec::core; diff --git a/tests/core/algorithm/flat/flat_streamer_buffer_test.cpp b/tests/core/algorithm/flat/flat_streamer_buffer_test.cpp index a2906497..62b25e23 100644 --- a/tests/core/algorithm/flat/flat_streamer_buffer_test.cpp +++ b/tests/core/algorithm/flat/flat_streamer_buffer_test.cpp @@ -1,12 +1,12 @@ #include #include #include -#include #include #include -#include -#include #include +#include +#include +#include using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/flat/flat_streamer_buffer_time_test.cpp b/tests/core/algorithm/flat/flat_streamer_buffer_time_test.cpp index 099db0ef..c919e9fe 100644 --- a/tests/core/algorithm/flat/flat_streamer_buffer_time_test.cpp +++ b/tests/core/algorithm/flat/flat_streamer_buffer_time_test.cpp @@ -1,12 +1,12 @@ #include #include #include -#include #include #include -#include -#include #include +#include +#include +#include using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/flat/flat_streamer_test.cc b/tests/core/algorithm/flat/flat_streamer_test.cc index 68f3dbcc..022c1063 100644 --- a/tests/core/algorithm/flat/flat_streamer_test.cc +++ b/tests/core/algorithm/flat/flat_streamer_test.cc @@ -16,13 +16,13 @@ #include #include #include -#include #include #include -#include -#include #include -#include "ailego/encoding/json/mod_json.h" +#include +#include +#include +#include #include "algorithm/flat/flat_utility.h" #if defined(__GNUC__) || defined(__GNUG__) diff --git a/tests/core/algorithm/flat_sparse/flat_sparse_searcher_test.cc b/tests/core/algorithm/flat_sparse/flat_sparse_searcher_test.cc index f03cdf80..f0553dd8 100644 --- a/tests/core/algorithm/flat_sparse/flat_sparse_searcher_test.cc +++ b/tests/core/algorithm/flat_sparse/flat_sparse_searcher_test.cc @@ -16,12 +16,12 @@ #include #include #include -#include #include #include #include -#include "framework/index_factory.h" -#include "framework/index_meta.h" +#include +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_meta.h" using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/flat_sparse/flat_sparse_streamer_buffer_test.cc b/tests/core/algorithm/flat_sparse/flat_sparse_streamer_buffer_test.cc index a17fb842..11c84e8a 100644 --- a/tests/core/algorithm/flat_sparse/flat_sparse_streamer_buffer_test.cc +++ b/tests/core/algorithm/flat_sparse/flat_sparse_streamer_buffer_test.cc @@ -14,14 +14,14 @@ #include #include -#include #include #include #include #include -#include -#include #include +#include +#include +#include using namespace std; using namespace testing; diff --git a/tests/core/algorithm/flat_sparse/flat_sparse_streamer_test.cc b/tests/core/algorithm/flat_sparse/flat_sparse_streamer_test.cc index 9279e5ed..73d85eb3 100644 --- a/tests/core/algorithm/flat_sparse/flat_sparse_streamer_test.cc +++ b/tests/core/algorithm/flat_sparse/flat_sparse_streamer_test.cc @@ -15,14 +15,14 @@ #include #include #include -#include #include #include #include #include -#include -#include #include +#include +#include +#include using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/hnsw/hnsw_builder_test.cc b/tests/core/algorithm/hnsw/hnsw_builder_test.cc index c7433b00..402ae972 100644 --- a/tests/core/algorithm/hnsw/hnsw_builder_test.cc +++ b/tests/core/algorithm/hnsw/hnsw_builder_test.cc @@ -16,9 +16,9 @@ #include #include #include -#include #include -#include "framework/index_framework.h" +#include +#include "zvec/core/framework/index_framework.h" #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push diff --git a/tests/core/algorithm/hnsw/hnsw_searcher_test.cpp b/tests/core/algorithm/hnsw/hnsw_searcher_test.cpp index d065efb2..94b0b314 100644 --- a/tests/core/algorithm/hnsw/hnsw_searcher_test.cpp +++ b/tests/core/algorithm/hnsw/hnsw_searcher_test.cpp @@ -17,12 +17,12 @@ #include #include #include -#include #include #include -#include "framework/index_builder.h" -#include "framework/index_factory.h" -#include "framework/index_meta.h" +#include +#include "zvec/core/framework/index_builder.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_meta.h" #include "hnsw_params.h" using namespace std; diff --git a/tests/core/algorithm/hnsw/hnsw_streamer_buffer_test.cpp b/tests/core/algorithm/hnsw/hnsw_streamer_buffer_test.cpp index 6f110a95..a3dda598 100644 --- a/tests/core/algorithm/hnsw/hnsw_streamer_buffer_test.cpp +++ b/tests/core/algorithm/hnsw/hnsw_streamer_buffer_test.cpp @@ -1,13 +1,13 @@ #include #include #include -#include #include #include #include -#include -#include #include +#include +#include +#include using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/hnsw/hnsw_streamer_test.cc b/tests/core/algorithm/hnsw/hnsw_streamer_test.cc index 8bbafd65..5f21db45 100644 --- a/tests/core/algorithm/hnsw/hnsw_streamer_test.cc +++ b/tests/core/algorithm/hnsw/hnsw_streamer_test.cc @@ -18,8 +18,8 @@ #include #include #include -#include #include +#include #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push diff --git a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_builder_test.cc b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_builder_test.cc index 8ba7a71b..0f46dab9 100644 --- a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_builder_test.cc +++ b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_builder_test.cc @@ -16,9 +16,9 @@ #include #include #include -#include #include -#include "framework/index_framework.h" +#include +#include "zvec/core/framework/index_framework.h" #include "hnsw_sparse_params.h" #if defined(__GNUC__) || defined(__GNUG__) diff --git a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_test.cc b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_test.cc index 30c86b81..78d1547d 100644 --- a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_test.cc +++ b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_searcher_test.cc @@ -17,10 +17,10 @@ #include #include #include -#include #include #include -#include "framework/index_framework.h" +#include +#include "zvec/core/framework/index_framework.h" #include "hnsw_sparse_params.h" #if defined(__GNUC__) || defined(__GNUG__) diff --git a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_buffer_test.cpp b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_buffer_test.cpp index 5ddeb0bc..c80c9561 100644 --- a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_buffer_test.cpp +++ b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_buffer_test.cpp @@ -17,9 +17,9 @@ #include #include #include -#include #include #include +#include #include "hnsw_sparse_streamer.h" using namespace std; diff --git a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_test.cc b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_test.cc index b06e0ebd..2990cc91 100644 --- a/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_test.cc +++ b/tests/core/algorithm/hnsw_sparse/hnsw_sparse_streamer_test.cc @@ -18,9 +18,9 @@ #include #include #include -#include #include #include +#include #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push diff --git a/tests/core/algorithm/ivf/ivf_builder_test.cc b/tests/core/algorithm/ivf/ivf_builder_test.cc index 001f4ccd..7dc7da5b 100644 --- a/tests/core/algorithm/ivf/ivf_builder_test.cc +++ b/tests/core/algorithm/ivf/ivf_builder_test.cc @@ -15,8 +15,8 @@ #include #include #include -#include #include +#include using namespace zvec::core; using namespace zvec::ailego; diff --git a/tests/core/algorithm/ivf/ivf_searcher_test.cc b/tests/core/algorithm/ivf/ivf_searcher_test.cc index 7e2689f0..0ce94ced 100644 --- a/tests/core/algorithm/ivf/ivf_searcher_test.cc +++ b/tests/core/algorithm/ivf/ivf_searcher_test.cc @@ -16,7 +16,7 @@ #include #include #include -#include "framework/index_framework.h" +#include "zvec/core/framework/index_framework.h" #include "ivf_builder.h" #if defined(__GNUC__) || defined(__GNUG__) diff --git a/tests/core/interface/index_interface_test.cc b/tests/core/interface/index_interface_test.cc index 0873c68f..b38eea55 100644 --- a/tests/core/interface/index_interface_test.cc +++ b/tests/core/interface/index_interface_test.cc @@ -17,11 +17,11 @@ #include #include #include -#include "ailego/buffer/buffer_manager.h" -#include "interface/index.h" -#include "interface/index_factory.h" -#include "interface/index_param.h" -#include "interface/index_param_builders.h" +#include "zvec/ailego/buffer/buffer_manager.h" +#include "zvec/core/interface/index.h" +#include "zvec/core/interface/index_factory.h" +#include "zvec/core/interface/index_param.h" +#include "zvec/core/interface/index_param_builders.h" #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push diff --git a/tests/core/metric/cosine_metric_test.cc b/tests/core/metric/cosine_metric_test.cc index 7265f023..9ed3d5e1 100644 --- a/tests/core/metric/cosine_metric_test.cc +++ b/tests/core/metric/cosine_metric_test.cc @@ -15,7 +15,7 @@ #include #include #include -#include "framework/index_factory.h" +#include "zvec/core/framework/index_factory.h" using namespace zvec; diff --git a/tests/core/metric/euclidean_metric_test.cc b/tests/core/metric/euclidean_metric_test.cc index e0ffac9b..c0c3a361 100644 --- a/tests/core/metric/euclidean_metric_test.cc +++ b/tests/core/metric/euclidean_metric_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include #include -#include "framework/index_factory.h" +#include "zvec/core/framework/index_factory.h" using namespace zvec; using namespace zvec::core; diff --git a/tests/core/metric/hamming_metric_test.cc b/tests/core/metric/hamming_metric_test.cc index 1dc0b879..4c44beb0 100644 --- a/tests/core/metric/hamming_metric_test.cc +++ b/tests/core/metric/hamming_metric_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include #include -#include "framework/index_factory.h" +#include "zvec/core/framework/index_factory.h" using namespace zvec; using namespace zvec::core; diff --git a/tests/core/metric/inner_product_metric_test.cc b/tests/core/metric/inner_product_metric_test.cc index 02b81b55..8a0c521c 100644 --- a/tests/core/metric/inner_product_metric_test.cc +++ b/tests/core/metric/inner_product_metric_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include #include -#include "framework/index_factory.h" +#include "zvec/core/framework/index_factory.h" using namespace zvec; using namespace zvec::core; diff --git a/tests/core/metric/quantized_integer_metric_test.cc b/tests/core/metric/quantized_integer_metric_test.cc index 0d7309be..5cfec79f 100644 --- a/tests/core/metric/quantized_integer_metric_test.cc +++ b/tests/core/metric/quantized_integer_metric_test.cc @@ -14,16 +14,16 @@ #include #include #include -#include #include #include #include -#include -#include #include +#include #include +#include +#include #include "core/quantizer/quantizer_params.h" -#include "framework/index_factory.h" +#include "zvec/core/framework/index_factory.h" using namespace zvec; diff --git a/tests/core/quantizer/half_float_reformer_test.cc b/tests/core/quantizer/half_float_reformer_test.cc index b48b91ee..b9e382ff 100644 --- a/tests/core/quantizer/half_float_reformer_test.cc +++ b/tests/core/quantizer/half_float_reformer_test.cc @@ -15,12 +15,12 @@ #include #include -// #include -// #include +// #include +// #include #include -#include "framework/index_factory.h" -#include "framework/index_holder.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_holder.h" using namespace zvec::core; diff --git a/tests/core/quantizer/integer_quantizer_reformer_test.cc b/tests/core/quantizer/integer_quantizer_reformer_test.cc index 77d6b214..21967bb2 100644 --- a/tests/core/quantizer/integer_quantizer_reformer_test.cc +++ b/tests/core/quantizer/integer_quantizer_reformer_test.cc @@ -14,10 +14,10 @@ #include #include -#include #include -#include "framework/index_factory.h" -#include "framework/index_holder.h" +#include +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_holder.h" using namespace zvec::core; diff --git a/tests/core/utility/buffer_storage_test.cpp b/tests/core/utility/buffer_storage_test.cpp index 134e0622..9171ad30 100644 --- a/tests/core/utility/buffer_storage_test.cpp +++ b/tests/core/utility/buffer_storage_test.cpp @@ -13,10 +13,10 @@ // limitations under the License. #include -#include -#include -#include #include +#include +#include +#include using namespace zvec; using namespace zvec::core; diff --git a/tests/core/utility/file_dumper_test.cc b/tests/core/utility/file_dumper_test.cc index 2ed95ddc..2677d440 100644 --- a/tests/core/utility/file_dumper_test.cc +++ b/tests/core/utility/file_dumper_test.cc @@ -13,9 +13,9 @@ // limitations under the License. #include #include -#include "framework/index_factory.h" -#include "framework/index_helper.h" -#include "framework/index_segment_storage.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_helper.h" +#include "zvec/core/framework/index_segment_storage.h" using namespace zvec; using namespace zvec::core; diff --git a/tests/core/utility/memory_dumper_test.cc b/tests/core/utility/memory_dumper_test.cc index f828ba18..c6aeee23 100644 --- a/tests/core/utility/memory_dumper_test.cc +++ b/tests/core/utility/memory_dumper_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include #include -#include "framework/index_factory.h" -#include "framework/index_helper.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_helper.h" using namespace zvec; using namespace zvec::core; diff --git a/tests/core/utility/mmap_file_container_test.cc b/tests/core/utility/mmap_file_container_test.cc index 7dc686c2..67adab19 100644 --- a/tests/core/utility/mmap_file_container_test.cc +++ b/tests/core/utility/mmap_file_container_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include #include -#include "framework/index_factory.h" -#include "framework/index_helper.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_helper.h" using namespace zvec; using namespace zvec::core; diff --git a/tests/core/utility/mmap_file_storage_test.cpp b/tests/core/utility/mmap_file_storage_test.cpp index 5fa5ccaa..b0436d8b 100644 --- a/tests/core/utility/mmap_file_storage_test.cpp +++ b/tests/core/utility/mmap_file_storage_test.cpp @@ -14,10 +14,10 @@ #include #include -#include -#include -#include #include +#include +#include +#include using namespace zvec; using namespace zvec::core; diff --git a/tests/db/collection_test.cc b/tests/db/collection_test.cc index 47e533b5..fb87c59b 100644 --- a/tests/db/collection_test.cc +++ b/tests/db/collection_test.cc @@ -22,10 +22,10 @@ #include #include #include -#include -#include #include -#include "ailego/logger/logger.h" +#include +#include +#include #include "db/common/file_helper.h" #include "db/index/common/type_helper.h" #include "index/utils/utils.h" diff --git a/tests/db/index/segment/segment_test.cc b/tests/db/index/segment/segment_test.cc index 57c1f510..161dd53d 100644 --- a/tests/db/index/segment/segment_test.cc +++ b/tests/db/index/segment/segment_test.cc @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #include "db/common/file_helper.h" #include "db/index/common/delete_store.h" #include "db/index/common/id_map.h" diff --git a/tests/db/index/storage/wal_file_test.cc b/tests/db/index/storage/wal_file_test.cc index 79d4ba71..f430d0a4 100644 --- a/tests/db/index/storage/wal_file_test.cc +++ b/tests/db/index/storage/wal_file_test.cc @@ -22,10 +22,10 @@ #include #include #include -#include -#include #include +#include #include +#include #include "db/common/file_helper.h" #if defined(__GNUC__) || defined(__GNUG__) diff --git a/tests/db/index/utils/utils.cc b/tests/db/index/utils/utils.cc index 3a38dd18..e901ee97 100644 --- a/tests/db/index/utils/utils.cc +++ b/tests/db/index/utils/utils.cc @@ -16,7 +16,7 @@ #include #include #include -#include "ailego/logger/logger.h" +#include #include "zvec/db/collection.h" #include "zvec/db/doc.h" #include "zvec/db/index_params.h" diff --git a/tests/db/sqlengine/mock_segment.h b/tests/db/sqlengine/mock_segment.h index 73fcb8d7..0872dd3e 100644 --- a/tests/db/sqlengine/mock_segment.h +++ b/tests/db/sqlengine/mock_segment.h @@ -17,10 +17,10 @@ #include #include #include -#include #include #include #include +#include #include "db/index/column/common/index_results.h" #include "db/index/column/vector_column/vector_column_indexer.h" #include "db/index/segment/segment.h" diff --git a/tools/core/bench_original.cc b/tools/core/bench_original.cc index d074d1c1..65a36d7b 100644 --- a/tools/core/bench_original.cc +++ b/tools/core/bench_original.cc @@ -15,11 +15,11 @@ #include #include #include -#include -#include "framework/index_plugin.h" -#include "interface/index_factory.h" -#include "interface/index_param.h" +#include #include "zvec/ailego/utility/string_helper.h" +#include "zvec/core/framework/index_plugin.h" +#include "zvec/core/interface/index_factory.h" +#include "zvec/core/interface/index_param.h" #include "bench_result.h" #include "filter_result_cache.h" #include "flow.h" diff --git a/tools/core/flow.h b/tools/core/flow.h index 85a09ab5..43b59eb6 100644 --- a/tools/core/flow.h +++ b/tools/core/flow.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "framework/index_flow.h" +#include "zvec/core/framework/index_flow.h" #include "meta_segment_common.h" using namespace std; diff --git a/tools/core/helper.h b/tools/core/helper.h index 7c59f98a..c24c89ff 100644 --- a/tools/core/helper.h +++ b/tools/core/helper.h @@ -18,20 +18,20 @@ #include #include #include -#include -#include -#include #include -#include -#include +#include +#include +#include +#include #include -#include "framework/index_error.h" -#include "framework/index_factory.h" -#include "framework/index_plugin.h" -#include "framework/index_storage.h" -#include "interface/index.h" -#include "interface/index_factory.h" -#include "interface/index_param.h" +#include +#include "zvec/core/framework/index_error.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_plugin.h" +#include "zvec/core/framework/index_storage.h" +#include "zvec/core/interface/index.h" +#include "zvec/core/interface/index_factory.h" +#include "zvec/core/interface/index_param.h" #include "filter_result_cache.h" #include "meta_segment_common.h" #include "txt_input_reader.h" diff --git a/tools/core/index_meta_helper.h b/tools/core/index_meta_helper.h index f412383f..95044635 100644 --- a/tools/core/index_meta_helper.h +++ b/tools/core/index_meta_helper.h @@ -16,7 +16,7 @@ #include #include -#include "framework/index_meta.h" +#include "zvec/core/framework/index_meta.h" namespace zvec { namespace core { diff --git a/tools/core/local_builder.cc b/tools/core/local_builder.cc index 778314bb..46f6c6da 100644 --- a/tools/core/local_builder.cc +++ b/tools/core/local_builder.cc @@ -15,17 +15,15 @@ #include #include #include -#include #include -#include -#include "algorithm/flat/flat_utility.h" -#include "algorithm/hnsw/hnsw_params.h" -#include "framework/index_dumper.h" -#include "framework/index_factory.h" -#include "framework/index_logger.h" -#include "framework/index_plugin.h" -#include "framework/index_reformer.h" -#include "framework/index_streamer.h" +#include +#include +#include "zvec/core/framework/index_dumper.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_logger.h" +#include "zvec/core/framework/index_plugin.h" +#include "zvec/core/framework/index_reformer.h" +#include "zvec/core/framework/index_streamer.h" #include "index_meta_helper.h" #include "meta_segment_common.h" #include "vecs_index_holder.h" diff --git a/tools/core/local_builder_original.cc b/tools/core/local_builder_original.cc index e97e96e4..f6a44014 100644 --- a/tools/core/local_builder_original.cc +++ b/tools/core/local_builder_original.cc @@ -15,15 +15,15 @@ #include #include #include -#include #include -#include -#include "framework/index_dumper.h" -#include "framework/index_factory.h" -#include "framework/index_logger.h" -#include "framework/index_plugin.h" -#include "framework/index_reformer.h" -#include "framework/index_streamer.h" +#include +#include +#include "zvec/core/framework/index_dumper.h" +#include "zvec/core/framework/index_factory.h" +#include "zvec/core/framework/index_logger.h" +#include "zvec/core/framework/index_plugin.h" +#include "zvec/core/framework/index_reformer.h" +#include "zvec/core/framework/index_streamer.h" #include "index_meta_helper.h" #include "meta_segment_common.h" #include "vecs_index_holder.h" diff --git a/tools/core/meta_segment_common.h b/tools/core/meta_segment_common.h index e43b6917..2d1fa488 100644 --- a/tools/core/meta_segment_common.h +++ b/tools/core/meta_segment_common.h @@ -14,7 +14,7 @@ #pragma once -#include +#include namespace zvec { namespace core { diff --git a/tools/core/recall_original.cc b/tools/core/recall_original.cc index 9d334a40..c8b2068e 100644 --- a/tools/core/recall_original.cc +++ b/tools/core/recall_original.cc @@ -17,15 +17,15 @@ #include #include #include -#include -#include #include -#include -#include +#include +#include +#include #include -#include "framework/index_plugin.h" -#include "interface/index_factory.h" -#include "interface/index_param.h" +#include +#include "zvec/core/framework/index_plugin.h" +#include "zvec/core/interface/index_factory.h" +#include "zvec/core/interface/index_param.h" #include "filter_result_cache.h" #include "flow.h" #include "txt_input_reader.h" diff --git a/tools/core/txt2vecs.cc b/tools/core/txt2vecs.cc index a951c45f..6b8d0cf4 100644 --- a/tools/core/txt2vecs.cc +++ b/tools/core/txt2vecs.cc @@ -14,8 +14,8 @@ #include #include -#include "framework/index_meta.h" #include "gflags/gflags.h" +#include "zvec/core/framework/index_meta.h" #include "index_meta_helper.h" #include "txt_input_reader.h" #include "vecs_common.h" diff --git a/tools/core/vecs_index_holder.h b/tools/core/vecs_index_holder.h index 654d0257..4d5c8e16 100644 --- a/tools/core/vecs_index_holder.h +++ b/tools/core/vecs_index_holder.h @@ -15,8 +15,8 @@ #pragma once #include -#include -#include "framework/index_holder.h" +#include +#include "zvec/core/framework/index_holder.h" #include "vecs_reader.h" namespace zvec { diff --git a/tools/core/vecs_reader.h b/tools/core/vecs_reader.h index ec7239b6..110e5209 100644 --- a/tools/core/vecs_reader.h +++ b/tools/core/vecs_reader.h @@ -15,8 +15,8 @@ #pragma once #include -#include -#include "framework/index_meta.h" +#include +#include "zvec/core/framework/index_meta.h" #include "vecs_common.h" namespace zvec {