diff --git a/dbms/include/DB/Common/FileChecker.h b/dbms/include/DB/Common/FileChecker.h index 194ac1effad..cb4f5493948 100644 --- a/dbms/include/DB/Common/FileChecker.h +++ b/dbms/include/DB/Common/FileChecker.h @@ -9,7 +9,7 @@ #include #include -#include +#include namespace DB { @@ -23,7 +23,7 @@ public: files_info_path(file_info_path_), files_info(), storage(storage_), log(&Logger::get("FileChecker")) { if (Poco::File(files_info_path).exists()) - boost::property_tree::read_xml(files_info_path, files_info); + boost::property_tree::read_json(files_info_path, files_info); } void setPath(const std::string & file_info_path_) @@ -46,7 +46,7 @@ public: saveTree(); } - /// Проверяем файлы, параметры которых указаны в sizes.txt + /// Проверяем файлы, параметры которых указаны в sizes.json bool check() const { bool correct = true; @@ -82,8 +82,7 @@ private: void saveTree() { - boost::property_tree::write_xml(files_info_path, files_info, std::locale(), - boost::property_tree::xml_parser::xml_writer_settings('\t', 1)); + boost::property_tree::write_json(files_info_path, files_info, std::locale()); } std::string files_info_path; diff --git a/dbms/src/Storages/StorageLog.cpp b/dbms/src/Storages/StorageLog.cpp index e0045e3b72a..6a7cccc7de7 100644 --- a/dbms/src/Storages/StorageLog.cpp +++ b/dbms/src/Storages/StorageLog.cpp @@ -411,7 +411,7 @@ void LogBlockOutputStream::writeMarks(MarksForColumns marks) StorageLog::StorageLog(const std::string & path_, const std::string & name_, NamesAndTypesListPtr columns_, size_t max_compress_block_size_) : path(path_), name(name_), columns(columns_), loaded_marks(false), max_compress_block_size(max_compress_block_size_), - file_checker(path + escapeForFileName(name) + '/' + "sizes.txt", *this) + file_checker(path + escapeForFileName(name) + '/' + "sizes.json", *this) { if (columns->empty()) throw Exception("Empty list of columns passed to StorageLog constructor", ErrorCodes::EMPTY_LIST_OF_COLUMNS_PASSED); @@ -540,7 +540,7 @@ void StorageLog::rename(const String & new_path_to_db, const String & new_databa path = new_path_to_db; name = new_table_name; - file_checker.setPath(path + escapeForFileName(name) + '/' + "sizes.txt"); + file_checker.setPath(path + escapeForFileName(name) + '/' + "sizes.json"); for (Files_t::iterator it = files.begin(); it != files.end(); ++it) { diff --git a/dbms/src/Storages/StorageTinyLog.cpp b/dbms/src/Storages/StorageTinyLog.cpp index 0ca5c4fbf3a..d48cbea70e3 100644 --- a/dbms/src/Storages/StorageTinyLog.cpp +++ b/dbms/src/Storages/StorageTinyLog.cpp @@ -294,7 +294,7 @@ void TinyLogBlockOutputStream::write(const Block & block) StorageTinyLog::StorageTinyLog(const std::string & path_, const std::string & name_, NamesAndTypesListPtr columns_, bool attach, size_t max_compress_block_size_) : path(path_), name(name_), columns(columns_), max_compress_block_size(max_compress_block_size_), - file_checker(path + escapeForFileName(name) + '/' + "sizes.txt", *this), + file_checker(path + escapeForFileName(name) + '/' + "sizes.json", *this), log(&Logger::get("StorageTinyLog")) { if (columns->empty()) @@ -369,7 +369,7 @@ void StorageTinyLog::rename(const String & new_path_to_db, const String & new_da path = new_path_to_db; name = new_table_name; - file_checker.setPath(path + escapeForFileName(name) + "/" + "sizes.txt"); + file_checker.setPath(path + escapeForFileName(name) + "/" + "sizes.json"); for (Files_t::iterator it = files.begin(); it != files.end(); ++it) it->second.data_file = Poco::File(path + escapeForFileName(name) + '/' + Poco::Path(it->second.data_file.path()).getFileName());