@@ -64,15 +64,15 @@ size_t MemIndex::GetRowCount() {
6464}
6565
6666bool MemIndex::IsNull () const {
67- std::unique_lock<std::mutex> lock (mtx_);
68- return memory_hnsw_index_ == nullptr && memory_ivf_index_ == nullptr && memory_indexer_ == nullptr && memory_secondary_index_ == nullptr &&
67+ std::unique_lock lock (mtx_);
68+ return /* memory_hnsw_index_ == nullptr && */ memory_ivf_index_ == nullptr && memory_indexer_ == nullptr && memory_secondary_index_ == nullptr &&
6969 memory_emvb_index_ == nullptr && memory_bmp_index_ == nullptr && memory_dummy_index_ == nullptr ;
7070}
7171
7272void MemIndex::ClearMemIndex () {
73- std::unique_lock<std::mutex> lock (mtx_);
73+ std::unique_lock lock (mtx_);
7474
75- memory_hnsw_index_.reset ();
75+ // memory_hnsw_index_.reset();
7676 memory_ivf_index_.reset ();
7777 memory_indexer_.reset ();
7878 memory_secondary_index_.reset ();
@@ -83,11 +83,12 @@ void MemIndex::ClearMemIndex() {
8383}
8484
8585const BaseMemIndex *MemIndex::GetBaseMemIndex () const {
86- std::unique_lock<std::mutex> lock (mtx_);
87- BaseMemIndex *res = nullptr ;
88- if (memory_hnsw_index_.get () != nullptr ) {
89- res = static_cast <BaseMemIndex *>(memory_hnsw_index_.get ());
90- } else if (memory_ivf_index_.get () != nullptr ) {
86+ std::unique_lock lock (mtx_);
87+ BaseMemIndex *res{};
88+ // if (memory_hnsw_index_.get() != nullptr) {
89+ // res = static_cast<BaseMemIndex *>(memory_hnsw_index_.get());
90+ // } else
91+ if (memory_ivf_index_.get () != nullptr ) {
9192 res = static_cast <BaseMemIndex *>(memory_ivf_index_.get ());
9293 } else if (memory_indexer_.get () != nullptr ) {
9394 res = static_cast <BaseMemIndex *>(memory_indexer_.get ());
@@ -104,15 +105,15 @@ const BaseMemIndex *MemIndex::GetBaseMemIndex() const {
104105 return res;
105106}
106107
107- std::shared_ptr<HnswIndexInMem> MemIndex::GetHnswIndex () {
108- std::unique_lock<std::mutex> lock (mtx_);
109- return memory_hnsw_index_;
110- }
108+ // std::shared_ptr<HnswIndexInMem> MemIndex::GetHnswIndex() {
109+ // std::unique_lock<std::mutex> lock(mtx_);
110+ // return memory_hnsw_index_;
111+ // }
111112
112- void MemIndex::SetHnswIndex (std::shared_ptr<HnswIndexInMem> hnsw_index) {
113- std::unique_lock<std::mutex> lock (mtx_);
114- memory_hnsw_index_ = hnsw_index;
115- }
113+ // void MemIndex::SetHnswIndex(std::shared_ptr<HnswIndexInMem> hnsw_index) {
114+ // std::unique_lock<std::mutex> lock(mtx_);
115+ // memory_hnsw_index_ = hnsw_index;
116+ // }
116117
117118std::shared_ptr<IVFIndexInMem> MemIndex::GetIVFIndex () {
118119 std::unique_lock<std::mutex> lock (mtx_);
0 commit comments