diff --git a/internal/core/src/common/LoadIndex.h b/internal/core/src/common/LoadInfo.h similarity index 85% rename from internal/core/src/common/LoadIndex.h rename to internal/core/src/common/LoadInfo.h index 377b5330827709efe7f41dee943a035f0c0ef58f..654691f8d096bac6eb5ef5d9fba06508a43a0540 100644 --- a/internal/core/src/common/LoadIndex.h +++ b/internal/core/src/common/LoadInfo.h @@ -13,7 +13,7 @@ #include #include -#include "../index/knowhere/knowhere/index/vector_index/VecIndex.h" +#include "knowhere/index/vector_index/VecIndex.h" struct LoadIndexInfo { std::string field_name; @@ -21,3 +21,9 @@ struct LoadIndexInfo { std::map index_params; milvus::knowhere::VecIndexPtr index; }; + +struct LoadFieldDataInfo { + int64_t field_id; + void* blob; + int64_t row_count; +}; diff --git a/internal/core/src/segcore/SegmentGrowing.h b/internal/core/src/segcore/SegmentGrowing.h index ffd794ca521ee8f2d27fb56f143a74a70443e76d..9066f0be91529f7bcb6f32b6abca665c49f9f5a0 100644 --- a/internal/core/src/segcore/SegmentGrowing.h +++ b/internal/core/src/segcore/SegmentGrowing.h @@ -18,7 +18,7 @@ #include "query/deprecated/GeneralQuery.h" #include "query/Plan.h" -#include "common/LoadIndex.h" +#include "common/LoadInfo.h" #include "segcore/SegmentInterface.h" namespace milvus { diff --git a/internal/core/src/segcore/SegmentSealed.h b/internal/core/src/segcore/SegmentSealed.h index a784f3f2468b15d3cbfc0d27621b52fb60d7efe2..fd83f2fa031d9e79e1efd485d6dc155592ea2bc9 100644 --- a/internal/core/src/segcore/SegmentSealed.h +++ b/internal/core/src/segcore/SegmentSealed.h @@ -10,17 +10,20 @@ // or implied. See the License for the specific language governing permissions and limitations under the License #include "SegmentInterface.h" +#include "common/LoadInfo.h" -// class SegmentSealed : public SegmentInternalInterface { -// public: -// const Schema& get_schema() = 0; -// int64_t get_num_chunk() = 0; -// -// explicit SegmentSealed(SchemaPtr schema); -// void set_size(); -// void load_data(FieldId field_id, void* blob, int64_t blob_size); -// -// -// private: -// SchemaPtr schema_; -// } +namespace milvus::segcore { + +class SegmentSealed { + public: + virtual const Schema& + get_schema() = 0; + virtual int64_t + get_row_count() = 0; + virtual void + LoadIndex(const LoadIndexInfo& info) = 0; + virtual void + LoadFieldData(const LoadFieldDataInfo& info) = 0; +}; + +} // namespace milvus::segcore diff --git a/internal/core/src/segcore/load_index_c.cpp b/internal/core/src/segcore/load_index_c.cpp index 9afd0b6262e35e4aae490cbb5f1ca17754a2d5d8..21d5637f1be67e917121de565b6517d03e2eb16e 100644 --- a/internal/core/src/segcore/load_index_c.cpp +++ b/internal/core/src/segcore/load_index_c.cpp @@ -12,7 +12,7 @@ #include "index/knowhere/knowhere/common/BinarySet.h" #include "index/knowhere/knowhere/index/vector_index/VecIndexFactory.h" #include "segcore/load_index_c.h" -#include "common/LoadIndex.h" +#include "common/LoadInfo.h" #include "utils/EasyAssert.h" CStatus diff --git a/internal/core/src/segcore/segment_c.cpp b/internal/core/src/segcore/segment_c.cpp index 523af1842797851fcb7a141a7e7b8decb4f226cd..61b6cf85eb1aa2d654ea3109052cdf2df410828f 100644 --- a/internal/core/src/segcore/segment_c.cpp +++ b/internal/core/src/segcore/segment_c.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "common/LoadIndex.h" +#include "common/LoadInfo.h" CSegmentBase NewSegment(CCollection collection, uint64_t segment_id) { diff --git a/internal/core/unittest/CMakeLists.txt b/internal/core/unittest/CMakeLists.txt index 2427de4e033dd5aeb447f5d3bdf3e220813aedc4..443b3e32f25cf8fcd049d7d6ac38ca87b69751c0 100644 --- a/internal/core/unittest/CMakeLists.txt +++ b/internal/core/unittest/CMakeLists.txt @@ -18,6 +18,7 @@ set(MILVUS_TEST_FILES test_reduce.cpp test_interface.cpp test_span.cpp + test_load.cpp ) add_executable(all_tests ${MILVUS_TEST_FILES} diff --git a/internal/core/unittest/test_c_api.cpp b/internal/core/unittest/test_c_api.cpp index 7aba224f169eb8fe62b8062c4e277e66bf40b30c..d486812a2930d5685c70b5c709122faa0887eb43 100644 --- a/internal/core/unittest/test_c_api.cpp +++ b/internal/core/unittest/test_c_api.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include "test_utils/DataGen.h" diff --git a/internal/core/unittest/test_load.cpp b/internal/core/unittest/test_load.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9d6f2b1fd9adac9f20aff4147076630764ad775d --- /dev/null +++ b/internal/core/unittest/test_load.cpp @@ -0,0 +1,6 @@ +#include +#include "segcore/SegmentSealed.h" + +TEST(Load, Naive) { + +} \ No newline at end of file