diff --git a/cpp/src/db/Factories.cpp b/cpp/src/db/Factories.cpp new file mode 100644 index 0000000000..bd4ebbcadb --- /dev/null +++ b/cpp/src/db/Factories.cpp @@ -0,0 +1,39 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +// Unauthorized copying of this file, via any medium is strictly prohibited. +// Proprietary and confidential. +//////////////////////////////////////////////////////////////////////////////// +#include +#include +#include + +#include "Factories.h" + + +namespace zilliz { +namespace vecwise { +namespace engine { + +DBMetaOptions DBMetaOptionsFactory::Build(const std::string& path) { + auto p = path; + if(p == "") { + srand(time(nullptr)); + std::stringstream ss; + ss << "/tmp/" << rand(); + p = ss.str(); + } + DBMetaOptions meta; + meta.path = p; + return meta; +} + +Options OptionsFactory::Build() { + auto meta = DBMetaOptionsFactory::Build(); + Options options; + options.meta = meta; + return options; +} + +} // namespace engine +} // namespace vecwise +} // namespace zilliz diff --git a/cpp/src/db/Factories.h b/cpp/src/db/Factories.h new file mode 100644 index 0000000000..4a6d154ab1 --- /dev/null +++ b/cpp/src/db/Factories.h @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +// Unauthorized copying of this file, via any medium is strictly prohibited. +// Proprietary and confidential. +//////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include "db/DB.h" + +namespace zilliz { +namespace vecwise { +namespace engine { + +struct DBMetaOptionsFactory { + static DBMetaOptions Build(const std::string& path = ""); +}; + +struct OptionsFactory { + static Options Build(); +}; + + +} // namespace engine +} // namespace vecwise +} // namespace zilliz