milvus/cpp/src/scheduler/ResourceFactory.cpp
wxyu a0c52e3730 MS-348 Add ResourceFactory Test
Former-commit-id: 2b8519881eb88c532b0a02f7f515f345545cd55c
2019-08-13 20:18:21 +08:00

30 lines
847 B
C++

/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#include "ResourceFactory.h"
namespace zilliz {
namespace milvus {
namespace engine {
std::shared_ptr<Resource>
ResourceFactory::Create(const std::string &name, const std::string &alias) {
if (name == "disk") {
return std::make_shared<DiskResource>(alias);
} else if (name == "cpu") {
return std::make_shared<CpuResource>(alias);
} else if (name == "gpu") {
return std::make_shared<GpuResource>(alias);
} else {
return nullptr;
}
}
}
}
}