diff --git a/internal/core/src/segcore/CMakeLists.txt b/internal/core/src/segcore/CMakeLists.txt index bb84e6c05d..643e704d95 100644 --- a/internal/core/src/segcore/CMakeLists.txt +++ b/internal/core/src/segcore/CMakeLists.txt @@ -14,7 +14,6 @@ set(SEGCORE_FILES Collection.cpp collection_c.cpp segment_c.cpp - SegmentGrowing.cpp SegmentGrowingImpl.cpp SegmentSealedImpl.cpp FieldIndexing.cpp diff --git a/internal/core/src/segcore/SegmentGrowing.cpp b/internal/core/src/segcore/SegmentGrowing.cpp deleted file mode 100644 index bdc1fc6421..0000000000 --- a/internal/core/src/segcore/SegmentGrowing.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// 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 "segcore/SegmentGrowing.h" -#include "segcore/SegmentGrowingImpl.h" - -namespace milvus::segcore { - -int -TestABI() { - return 42; -} - -std::unique_ptr -CreateGrowingSegment(SchemaPtr schema, const SegcoreConfig& segcore_config) { - auto segment = std::make_unique(schema, segcore_config); - return segment; -} - -} // namespace milvus::segcore diff --git a/internal/core/src/segcore/SegmentGrowing.h b/internal/core/src/segcore/SegmentGrowing.h index 10b340d0b6..f90bf8624d 100644 --- a/internal/core/src/segcore/SegmentGrowing.h +++ b/internal/core/src/segcore/SegmentGrowing.h @@ -35,9 +35,6 @@ struct ColumnBasedRawData { int64_t count; }; -int -TestABI(); - class SegmentGrowing : public SegmentInternalInterface { public: virtual void @@ -73,13 +70,4 @@ class SegmentGrowing : public SegmentInternalInterface { using SegmentGrowingPtr = std::unique_ptr; -SegmentGrowingPtr -CreateGrowingSegment(SchemaPtr schema, const SegcoreConfig& segcore_config); - -inline SegmentGrowingPtr -CreateGrowingSegment(SchemaPtr schema) { - auto seg_conf = SegcoreConfig::default_config(); - return CreateGrowingSegment(schema, seg_conf); -} - } // namespace milvus::segcore diff --git a/internal/core/src/segcore/SegmentGrowingImpl.h b/internal/core/src/segcore/SegmentGrowingImpl.h index 90d8d03fdc..71af58e6ab 100644 --- a/internal/core/src/segcore/SegmentGrowingImpl.h +++ b/internal/core/src/segcore/SegmentGrowingImpl.h @@ -229,4 +229,9 @@ class SegmentGrowingImpl : public SegmentGrowing { bool enable_small_index_ = true; }; +inline SegmentGrowingPtr +CreateGrowingSegment(SchemaPtr schema, const SegcoreConfig& conf = SegcoreConfig::default_config()) { + return std::make_unique(schema, conf); +} + } // namespace milvus::segcore diff --git a/internal/core/src/segcore/SegmentSealed.h b/internal/core/src/segcore/SegmentSealed.h index 12a3b23a52..1ea9cc28a9 100644 --- a/internal/core/src/segcore/SegmentSealed.h +++ b/internal/core/src/segcore/SegmentSealed.h @@ -40,7 +40,4 @@ class SegmentSealed : public SegmentInternalInterface { using SegmentSealedPtr = std::unique_ptr; -SegmentSealedPtr -CreateSealedSegment(SchemaPtr schema); - } // namespace milvus::segcore diff --git a/internal/core/src/segcore/SegmentSealedImpl.cpp b/internal/core/src/segcore/SegmentSealedImpl.cpp index c29a2fcde6..e622d7ed0a 100644 --- a/internal/core/src/segcore/SegmentSealedImpl.cpp +++ b/internal/core/src/segcore/SegmentSealedImpl.cpp @@ -639,9 +639,4 @@ SegmentSealedImpl::mask_with_timestamps(boost::dynamic_bitset<>& bitset_chunk, T bitset_chunk &= mask; } -SegmentSealedPtr -CreateSealedSegment(SchemaPtr schema) { - return std::make_unique(schema); -} - } // namespace milvus::segcore diff --git a/internal/core/src/segcore/SegmentSealedImpl.h b/internal/core/src/segcore/SegmentSealedImpl.h index f5c01d03c8..137e30dbba 100644 --- a/internal/core/src/segcore/SegmentSealedImpl.h +++ b/internal/core/src/segcore/SegmentSealedImpl.h @@ -187,4 +187,10 @@ class SegmentSealedImpl : public SegmentSealed { TimestampIndex timestamp_index_; SchemaPtr schema_; }; + +inline SegmentSealedPtr +CreateSealedSegment(SchemaPtr schema) { + return std::make_unique(schema); +} + } // namespace milvus::segcore diff --git a/internal/core/src/segcore/segment_c.cpp b/internal/core/src/segcore/segment_c.cpp index 8bdea6d23a..b75a951554 100644 --- a/internal/core/src/segcore/segment_c.cpp +++ b/internal/core/src/segcore/segment_c.cpp @@ -16,8 +16,8 @@ #include "knowhere/index/vector_index/adapter/VectorAdapter.h" #include "log/Log.h" #include "segcore/Collection.h" -#include "segcore/SegmentGrowing.h" -#include "segcore/SegmentSealed.h" +#include "segcore/SegmentGrowingImpl.h" +#include "segcore/SegmentSealedImpl.h" #include "segcore/segment_c.h" #include "segcore/SimilarityCorelation.h" diff --git a/internal/core/unittest/test_concurrent_vector.cpp b/internal/core/unittest/test_concurrent_vector.cpp index db4464a6d7..8ecc7b3826 100644 --- a/internal/core/unittest/test_concurrent_vector.cpp +++ b/internal/core/unittest/test_concurrent_vector.cpp @@ -23,11 +23,6 @@ using namespace milvus::engine; using namespace milvus::segcore; using std::vector; -TEST(ConcurrentVector, TestABI) { - ASSERT_EQ(TestABI(), 42); - assert(true); -} - TEST(ConcurrentVector, TestSingle) { auto dim = 8; ConcurrentVectorImpl c_vec(dim, 32); diff --git a/internal/core/unittest/test_segcore.cpp b/internal/core/unittest/test_segcore.cpp index 8adc9b9e67..64f2b053b7 100644 --- a/internal/core/unittest/test_segcore.cpp +++ b/internal/core/unittest/test_segcore.cpp @@ -13,7 +13,7 @@ #include #include -#include "segcore/SegmentGrowing.h" +#include "segcore/SegmentGrowingImpl.h" using namespace milvus; @@ -43,13 +43,6 @@ generate_data(int N) { } } // namespace -TEST(SegmentCoreTest, TestABI) { - using namespace milvus::engine; - using namespace milvus::segcore; - ASSERT_EQ(TestABI(), 42); - assert(true); -} - TEST(SegmentCoreTest, NormalDistributionTest) { using namespace milvus::segcore; using namespace milvus::engine; diff --git a/internal/core/unittest/test_utils/DataGen.h b/internal/core/unittest/test_utils/DataGen.h index 1b001965c2..a4c9720767 100644 --- a/internal/core/unittest/test_utils/DataGen.h +++ b/internal/core/unittest/test_utils/DataGen.h @@ -10,21 +10,22 @@ // or implied. See the License for the specific language governing permissions and limitations under the License #pragma once -#include "common/Schema.h" -#include -#include -#include -#include "segcore/SegmentGrowing.h" -#include "segcore/SegmentSealed.h" -#include "Constants.h" -#include -#include "segcore/SegmentSealed.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include + +#include "Constants.h" +#include "common/Schema.h" +#include "knowhere/index/vector_index/VecIndex.h" +#include "knowhere/index/vector_index/adapter/VectorAdapter.h" +#include "knowhere/index/vector_index/VecIndexFactory.h" +#include "knowhere/index/vector_index/IndexIVF.h" +#include "query/SearchOnIndex.h" +#include "segcore/SegmentGrowingImpl.h" +#include "segcore/SegmentSealedImpl.h" + using boost::algorithm::starts_with; namespace milvus::segcore {