mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
70d1adfe4b
* save format string for NetException * format exceptions * format exceptions 2 * format exceptions 3 * format exceptions 4 * format exceptions 5 * format exceptions 6 * fix * format exceptions 7 * format exceptions 8 * Update MergeTreeIndexGin.cpp * Update AggregateFunctionMap.cpp * Update AggregateFunctionMap.cpp * fix
55 lines
1.0 KiB
C++
55 lines
1.0 KiB
C++
#include <Core/BaseSettings.h>
|
|
#include <IO/ReadHelpers.h>
|
|
#include <IO/WriteHelpers.h>
|
|
#include <Common/logger_useful.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int UNKNOWN_SETTING;
|
|
}
|
|
|
|
void BaseSettingsHelpers::writeString(std::string_view str, WriteBuffer & out)
|
|
{
|
|
writeStringBinary(str, out);
|
|
}
|
|
|
|
|
|
String BaseSettingsHelpers::readString(ReadBuffer & in)
|
|
{
|
|
String str;
|
|
readStringBinary(str, in);
|
|
return str;
|
|
}
|
|
|
|
|
|
void BaseSettingsHelpers::writeFlags(Flags flags, WriteBuffer & out)
|
|
{
|
|
writeVarUInt(flags, out);
|
|
}
|
|
|
|
|
|
BaseSettingsHelpers::Flags BaseSettingsHelpers::readFlags(ReadBuffer & in)
|
|
{
|
|
UInt64 res;
|
|
readVarUInt(res, in);
|
|
return static_cast<Flags>(res);
|
|
}
|
|
|
|
|
|
void BaseSettingsHelpers::throwSettingNotFound(std::string_view name)
|
|
{
|
|
throw Exception(ErrorCodes::UNKNOWN_SETTING, "Unknown setting {}", String{name});
|
|
}
|
|
|
|
|
|
void BaseSettingsHelpers::warningSettingNotFound(std::string_view name)
|
|
{
|
|
static auto * log = &Poco::Logger::get("Settings");
|
|
LOG_WARNING(log, "Unknown setting {}, skipping", name);
|
|
}
|
|
|
|
}
|