mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 23:45:28 +08:00
refactor(db): typedef engine ptr
Former-commit-id: 4629cac435fd484ab949ab112b639a4849e37fca
This commit is contained in:
parent
85707aa3e9
commit
f5b0ec50cf
@ -75,7 +75,7 @@ Status FaissExecutionEngine::Merge(const std::string& location) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
std::shared_ptr<FaissExecutionEngine> FaissExecutionEngine::BuildIndex(const std::string& location) {
|
||||
FaissExecutionEngine::Ptr FaissExecutionEngine::BuildIndex(const std::string& location) {
|
||||
auto opd = std::make_shared<Operand>();
|
||||
opd->d = pIndex_->d;
|
||||
opd->index_type = BuildIndexType;
|
||||
@ -87,7 +87,7 @@ std::shared_ptr<FaissExecutionEngine> FaissExecutionEngine::BuildIndex(const std
|
||||
dynamic_cast<faiss::IndexFlat*>(from_index->index)->xb.data(),
|
||||
from_index->id_map.data());
|
||||
|
||||
std::shared_ptr<FaissExecutionEngine> new_ee(new FaissExecutionEngine(index->data(), location));
|
||||
Ptr new_ee(new FaissExecutionEngine(index->data(), location));
|
||||
new_ee->Serialize();
|
||||
return new_ee;
|
||||
}
|
||||
|
||||
@ -13,9 +13,12 @@ namespace zilliz {
|
||||
namespace vecwise {
|
||||
namespace engine {
|
||||
|
||||
class FaissExecutionEngine;
|
||||
|
||||
class FaissExecutionEngine : public ExecutionEngine<FaissExecutionEngine> {
|
||||
public:
|
||||
typedef std::shared_ptr<FaissExecutionEngine> Ptr;
|
||||
|
||||
FaissExecutionEngine(uint16_t dimension, const std::string& location);
|
||||
FaissExecutionEngine(std::shared_ptr<faiss::Index> index, const std::string& location);
|
||||
|
||||
@ -42,7 +45,7 @@ public:
|
||||
float *distances,
|
||||
long *labels) const;
|
||||
|
||||
std::shared_ptr<FaissExecutionEngine> BuildIndex(const std::string&);
|
||||
FaissExecutionEngine::Ptr BuildIndex(const std::string&);
|
||||
|
||||
Status Cache();
|
||||
protected:
|
||||
|
||||
@ -22,6 +22,8 @@ namespace meta {
|
||||
template <typename EngineT>
|
||||
class MemVectors {
|
||||
public:
|
||||
typedef typename EngineT::Ptr EnginePtr;
|
||||
|
||||
explicit MemVectors(const std::shared_ptr<meta::Meta>&,
|
||||
const meta::GroupFileSchema&, const Options&);
|
||||
|
||||
@ -46,7 +48,7 @@ private:
|
||||
Options options_;
|
||||
meta::GroupFileSchema schema_;
|
||||
IDGenerator* _pIdGenerator;
|
||||
std::shared_ptr<EngineT> pEE_;
|
||||
EnginePtr pEE_;
|
||||
|
||||
}; // MemVectors
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user