2020-03-17 09:24:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-03-17 11:36:41 +00:00
|
|
|
#include <vector>
|
2021-10-02 07:13:14 +00:00
|
|
|
#include <base/EnumReflection.h>
|
|
|
|
#include <base/types.h>
|
2020-03-17 11:36:41 +00:00
|
|
|
|
2020-03-17 09:24:24 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2021-09-06 14:24:03 +00:00
|
|
|
enum class ExternalLoaderStatus : Int8
|
2020-03-17 09:24:24 +00:00
|
|
|
{
|
|
|
|
NOT_LOADED, /// Object hasn't been tried to load. This is an initial state.
|
|
|
|
LOADED, /// Object has been loaded successfully.
|
|
|
|
FAILED, /// Object has been failed to load.
|
|
|
|
LOADING, /// Object is being loaded right now for the first time.
|
|
|
|
FAILED_AND_RELOADING, /// Object was failed to load before and it's being reloaded right now.
|
|
|
|
LOADED_AND_RELOADING, /// Object was loaded successfully before and it's being reloaded right now.
|
|
|
|
NOT_EXIST, /// Object with this name wasn't found in the configuration.
|
|
|
|
};
|
|
|
|
|
2021-09-06 15:59:46 +00:00
|
|
|
inline std::vector<std::pair<String, Int8>> getStatusEnumAllPossibleValues()
|
2021-09-06 14:24:03 +00:00
|
|
|
{
|
|
|
|
std::vector<std::pair<String, Int8>> out;
|
|
|
|
out.reserve(magic_enum::enum_count<ExternalLoaderStatus>());
|
|
|
|
|
|
|
|
for (const auto & [value, str] : magic_enum::enum_entries<ExternalLoaderStatus>())
|
2021-09-06 15:59:46 +00:00
|
|
|
out.emplace_back(std::string{str}, static_cast<Int8>(value));
|
2021-09-06 14:24:03 +00:00
|
|
|
|
|
|
|
return out;
|
|
|
|
}
|
2020-03-17 09:24:24 +00:00
|
|
|
}
|