#pragma once #include "Meta.h" #include "MemTable.h" #include "Status.h" #include "MemManagerAbstract.h" #include #include #include #include #include namespace zilliz { namespace milvus { namespace engine { class NewMemManager : public MemManagerAbstract { public: using MetaPtr = meta::Meta::Ptr; using Ptr = std::shared_ptr; using MemTablePtr = typename MemTable::Ptr; NewMemManager(const std::shared_ptr& meta, const Options& options) : meta_(meta), options_(options) {} Status InsertVectors(const std::string& table_id, size_t n, const float* vectors, IDNumbers& vector_ids) override; Status Serialize(std::set& table_ids) override; Status EraseMemVector(const std::string& table_id) override; private: MemTablePtr GetMemByTable(const std::string& table_id); Status InsertVectorsNoLock(const std::string& table_id, size_t n, const float* vectors, IDNumbers& vector_ids); Status ToImmutable(); using MemIdMap = std::map; using MemList = std::vector; MemIdMap mem_id_map_; MemList immu_mem_list_; MetaPtr meta_; Options options_; std::mutex mutex_; std::mutex serialization_mtx_; }; // NewMemManager } // namespace engine } // namespace milvus } // namespace zilliz