Use method which was added for s3 instead

This commit is contained in:
kssenii 2021-08-02 08:15:21 +00:00
parent 5f5bbc1fca
commit b25dfdd6af
4 changed files with 6 additions and 13 deletions

View File

@ -367,15 +367,17 @@ SyncGuardPtr DiskLocal::getDirectorySyncGuard(const String & path) const
return std::make_unique<LocalDirectorySyncGuard>(fs::path(disk_path) / path);
}
void DiskLocal::updateFromConfigIfChanged(const Poco::Util::AbstractConfiguration & config,
const String & config_prefix, ContextPtr context)
void DiskLocal::applyNewSettings(const Poco::Util::AbstractConfiguration & config, ContextPtr context, const String & config_prefix, const DisksMap &)
{
String new_disk_path;
UInt64 new_keep_free_space_bytes;
loadDiskLocalConfig(name, config, config_prefix, context, new_disk_path, new_keep_free_space_bytes);
if (disk_path != new_disk_path)
throw Exception("Disk path can't update from config " + name, ErrorCodes::UNKNOWN_ELEMENT_IN_CONFIG);
throw Exception("Disk path can't be updated from config " + name, ErrorCodes::UNKNOWN_ELEMENT_IN_CONFIG);
if (keep_free_space_bytes != new_keep_free_space_bytes)
keep_free_space_bytes = new_keep_free_space_bytes;
}

View File

@ -105,9 +105,7 @@ public:
SyncGuardPtr getDirectorySyncGuard(const String & path) const override;
void updateFromConfigIfChanged(const Poco::Util::AbstractConfiguration & config,
const String & config_prefix,
ContextPtr context) override;
void applyNewSettings(const Poco::Util::AbstractConfiguration & config, ContextPtr context, const String & config_prefix, const DisksMap &) override;
private:
bool tryReserve(UInt64 bytes);

View File

@ -74,8 +74,6 @@ DiskSelectorPtr DiskSelector::updateFromConfig(
disk->applyNewSettings(config, context, disk_config_prefix, result->getDisksMap());
old_disks_minus_new_disks.erase(disk_name);
result->getDisksMap().find(disk_name)->second->updateFromConfigIfChanged(config, disk_config_prefix, context);
}
}

View File

@ -231,11 +231,6 @@ public:
/// Required for remote disk to ensure that replica has access to data written by other node
virtual bool checkUniqueId(const String & id) const { return exists(id); }
/// Reload config if it was changed
virtual void updateFromConfigIfChanged(const Poco::Util::AbstractConfiguration & /* config */,
const String & /* config_prefix */,
ContextPtr /* context */) { }
/// Invoked on partitions freeze query.
virtual void onFreeze(const String &) { }