| 1744 | }; |
| 1745 | |
| 1746 | void ServerSettingsImpl::loadSettingsFromConfig(const Poco::Util::AbstractConfiguration & config) |
| 1747 | { |
| 1748 | // settings which can be loaded from the the default profile, see also MAKE_DEPRECATED_BY_SERVER_CONFIG in src/Core/Settings.h |
| 1749 | std::unordered_set<std::string> settings_from_profile_allowlist = { |
| 1750 | "background_pool_size", |
| 1751 | "background_merges_mutations_concurrency_ratio", |
| 1752 | "background_merges_mutations_scheduling_policy", |
| 1753 | "background_move_pool_size", |
| 1754 | "background_fetches_pool_size", |
| 1755 | "background_common_pool_size", |
| 1756 | "background_buffer_flush_schedule_pool_size", |
| 1757 | "background_schedule_pool_size", |
| 1758 | "background_message_broker_schedule_pool_size", |
| 1759 | "background_distributed_schedule_pool_size", |
| 1760 | |
| 1761 | "max_remote_read_network_bandwidth_for_server", |
| 1762 | "max_remote_write_network_bandwidth_for_server", |
| 1763 | "max_local_read_bandwidth_for_server", |
| 1764 | "max_local_write_bandwidth_for_server", |
| 1765 | }; |
| 1766 | |
| 1767 | for (const auto & setting : all()) |
| 1768 | { |
| 1769 | const auto & name = setting.getName(); |
| 1770 | String path {setting.getPath()}; |
| 1771 | const String * path_or_name = path.empty() ? &name : &path; |
| 1772 | try |
| 1773 | { |
| 1774 | if (config.has(*path_or_name)) |
| 1775 | set(name, config.getString(*path_or_name)); |
| 1776 | else if (settings_from_profile_allowlist.contains(name) && config.has("profiles.default." + *path_or_name)) |
| 1777 | set(name, config.getString("profiles.default." + *path_or_name)); |
| 1778 | } |
| 1779 | catch (Exception & e) |
| 1780 | { |
| 1781 | e.addMessage("while parsing setting '{}' value", name); |
| 1782 | throw; |
| 1783 | } |
| 1784 | } |
| 1785 | } |
| 1786 | |
| 1787 | IMPLEMENT_SETTINGS_TRAITS_WITH_PATH_CUSTOM_IMPL(ServerSettingsTraits, LIST_OF_SERVER_SETTINGS_WITHOUT_PATH, LIST_OF_SERVER_SETTINGS_WITH_PATH, ServerSettings, ServerSetting) |
| 1788 |
no test coverage detected