mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Updates to YAMLParser and FileChecker
This commit is contained in:
parent
08bce94c39
commit
087d0683c9
@ -156,7 +156,7 @@ Poco::AutoPtr<Poco::XML::Document> YAMLParser::parse(const String& path)
|
||||
throw Exception(ErrorCodes::CANNOT_OPEN_FILE, "Unable to open YAML configuration file {}", path);
|
||||
}
|
||||
Poco::AutoPtr<Poco::XML::Document> xml = new Document;
|
||||
Poco::AutoPtr<Poco::XML::Element> root_node = xml->createElement("yandex");
|
||||
Poco::AutoPtr<Poco::XML::Element> root_node = xml->createElement("clickhouse");
|
||||
xml->appendChild(root_node);
|
||||
try
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ void FileChecker::save() const
|
||||
std::unique_ptr<WriteBuffer> out = disk->writeFile(tmp_files_info_path);
|
||||
|
||||
/// So complex JSON structure - for compatibility with the old format.
|
||||
writeCString("{\"yandex\":{", *out);
|
||||
writeCString("{\"clickhouse\":{", *out);
|
||||
|
||||
auto settings = FormatSettings();
|
||||
for (auto it = map.begin(); it != map.end(); ++it)
|
||||
@ -153,7 +153,7 @@ void FileChecker::load()
|
||||
}
|
||||
JSON json(out.str());
|
||||
|
||||
JSON files = json["yandex"];
|
||||
JSON files = json.has("clickhouse") ? json["clickhouse"] : json["yandex"];
|
||||
for (const JSON file : files) // NOLINT
|
||||
map[unescapeForFileName(file.getName())] = file.getValue()["size"].toUInt();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user