diff --git a/dbms/src/Common/DiskSpaceMonitor.cpp b/dbms/src/Common/DiskSpaceMonitor.cpp index bfcb396c52f..a7b6ccbcf28 100644 --- a/dbms/src/Common/DiskSpaceMonitor.cpp +++ b/dbms/src/Common/DiskSpaceMonitor.cpp @@ -231,19 +231,6 @@ const DiskPtr & DiskSelector::operator[](const String & name) const } -bool DiskSelector::hasDisk(const String & name) const -{ - auto it = disks.find(name); - return it != disks.end(); -} - - -void DiskSelector::add(const DiskPtr & disk) -{ - disks.emplace(disk->getName(), disk); -} - - Volume::Volume( String name_, const Poco::Util::AbstractConfiguration & config, @@ -523,6 +510,7 @@ StoragePolicySelector::StoragePolicySelector( constexpr auto default_volume_name = "default"; constexpr auto default_disk_name = "default"; + /// Add default if it's not specified explicetly if (policies.find(default_storage_policy_name) == policies.end()) { auto default_volume = std::make_shared( diff --git a/dbms/src/Common/DiskSpaceMonitor.h b/dbms/src/Common/DiskSpaceMonitor.h index e62ebe69d6a..0cd17f7e078 100644 --- a/dbms/src/Common/DiskSpaceMonitor.h +++ b/dbms/src/Common/DiskSpaceMonitor.h @@ -193,10 +193,6 @@ public: const DiskPtr & operator[](const String & name) const; - bool hasDisk(const String & name) const; - - void add(const DiskPtr & disk); - const auto & getDisksMap() const { return disks; } private: @@ -262,6 +258,9 @@ public: /// Returns disks ordered by volumes priority Disks getDisks() const; + /// Returns any disk + /// Used when it's not important, for example for + /// mutations files DiskPtr getAnyDisk() const; DiskPtr getDiskByName(const String & disk_name) const; @@ -311,7 +310,7 @@ private: using StoragePolicyPtr = std::shared_ptr; /// Parse .xml configuration and store information about policies -/// Mostly used for introspection +/// Mostly used for introspection. class StoragePolicySelector { public: