mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 15:35:33 +08:00
40 lines
1001 B
C++
40 lines
1001 B
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
|
// Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
// Proprietary and confidential.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <sstream>
|
|
|
|
#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
|