Less code, more comments

This commit is contained in:
alesapin 2019-09-09 17:20:07 +03:00
parent 9f88baebb9
commit 1bc0aaeb35
2 changed files with 5 additions and 18 deletions

View File

@ -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<Volume>(

View File

@ -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<const StoragePolicy>;
/// Parse .xml configuration and store information about policies
/// Mostly used for introspection
/// Mostly used for introspection.
class StoragePolicySelector
{
public: