aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Dictionaries/Embedded/RegionsHierarchies.cpp
blob: be828b8b2817e68f1e306ca445d0b5f9fb0f643f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "RegionsHierarchies.h"

#include <Poco/DirectoryIterator.h>
#include <Common/logger_useful.h>


RegionsHierarchies::RegionsHierarchies(IRegionsHierarchiesDataProviderPtr data_provider)
{
    Poco::Logger * log = &Poco::Logger::get("RegionsHierarchies");

    LOG_DEBUG(log, "Adding default regions hierarchy");
    data.emplace("", data_provider->getDefaultHierarchySource());

    for (const auto & name : data_provider->listCustomHierarchies())
    {
        LOG_DEBUG(log, "Adding regions hierarchy for {}", name);
        data.emplace(name, data_provider->getHierarchySource(name));
    }

    reload();
}