2017-06-18 05:43:29 +00:00
|
|
|
#include <Databases/IDatabase.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/System/attachSystemTables.h>
|
2017-03-14 18:39:06 +00:00
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/System/StorageSystemAsynchronousMetrics.h>
|
|
|
|
#include <Storages/System/StorageSystemBuildOptions.h>
|
|
|
|
#include <Storages/System/StorageSystemClusters.h>
|
|
|
|
#include <Storages/System/StorageSystemColumns.h>
|
|
|
|
#include <Storages/System/StorageSystemDatabases.h>
|
|
|
|
#include <Storages/System/StorageSystemDictionaries.h>
|
|
|
|
#include <Storages/System/StorageSystemEvents.h>
|
|
|
|
#include <Storages/System/StorageSystemFunctions.h>
|
|
|
|
#include <Storages/System/StorageSystemGraphite.h>
|
2018-03-12 18:38:00 +00:00
|
|
|
#include <Storages/System/StorageSystemMacros.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/System/StorageSystemMerges.h>
|
|
|
|
#include <Storages/System/StorageSystemMetrics.h>
|
2017-12-04 12:15:21 +00:00
|
|
|
#include <Storages/System/StorageSystemModels.h>
|
2018-06-07 13:28:39 +00:00
|
|
|
#include <Storages/System/StorageSystemMutations.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/System/StorageSystemNumbers.h>
|
|
|
|
#include <Storages/System/StorageSystemOne.h>
|
|
|
|
#include <Storages/System/StorageSystemParts.h>
|
2017-12-04 15:44:31 +00:00
|
|
|
#include <Storages/System/StorageSystemPartsColumns.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/System/StorageSystemProcesses.h>
|
|
|
|
#include <Storages/System/StorageSystemReplicas.h>
|
|
|
|
#include <Storages/System/StorageSystemReplicationQueue.h>
|
|
|
|
#include <Storages/System/StorageSystemSettings.h>
|
|
|
|
#include <Storages/System/StorageSystemTables.h>
|
|
|
|
#include <Storages/System/StorageSystemZooKeeper.h>
|
2017-03-14 18:39:06 +00:00
|
|
|
|
2017-06-18 05:43:29 +00:00
|
|
|
|
2017-03-14 18:39:06 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2017-06-18 05:43:29 +00:00
|
|
|
|
|
|
|
void attachSystemTablesLocal(IDatabase & system_database)
|
2017-03-14 18:39:06 +00:00
|
|
|
{
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("one", StorageSystemOne::create("one"));
|
|
|
|
system_database.attachTable("numbers", StorageSystemNumbers::create("numbers", false));
|
|
|
|
system_database.attachTable("numbers_mt", StorageSystemNumbers::create("numbers_mt", true));
|
|
|
|
system_database.attachTable("databases", StorageSystemDatabases::create("databases"));
|
|
|
|
system_database.attachTable("tables", StorageSystemTables::create("tables"));
|
|
|
|
system_database.attachTable("columns", StorageSystemColumns::create("columns"));
|
|
|
|
system_database.attachTable("functions", StorageSystemFunctions::create("functions"));
|
|
|
|
system_database.attachTable("events", StorageSystemEvents::create("events"));
|
|
|
|
system_database.attachTable("settings", StorageSystemSettings::create("settings"));
|
|
|
|
system_database.attachTable("build_options", StorageSystemBuildOptions::create("build_options"));
|
2017-03-14 18:39:06 +00:00
|
|
|
}
|
|
|
|
|
2017-06-18 05:43:29 +00:00
|
|
|
void attachSystemTablesServer(IDatabase & system_database, bool has_zookeeper)
|
2017-03-14 18:39:06 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
attachSystemTablesLocal(system_database);
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("parts", StorageSystemParts::create("parts"));
|
2017-12-04 15:44:31 +00:00
|
|
|
system_database.attachTable("parts_columns", StorageSystemPartsColumns::create("parts_columns"));
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("processes", StorageSystemProcesses::create("processes"));
|
|
|
|
system_database.attachTable("metrics", StorageSystemMetrics::create("metrics"));
|
|
|
|
system_database.attachTable("merges", StorageSystemMerges::create("merges"));
|
2018-06-07 13:28:39 +00:00
|
|
|
system_database.attachTable("mutations", StorageSystemMutations::create("mutations"));
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("replicas", StorageSystemReplicas::create("replicas"));
|
|
|
|
system_database.attachTable("replication_queue", StorageSystemReplicationQueue::create("replication_queue"));
|
|
|
|
system_database.attachTable("dictionaries", StorageSystemDictionaries::create("dictionaries"));
|
2017-12-04 12:15:21 +00:00
|
|
|
system_database.attachTable("models", StorageSystemModels::create("models"));
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("clusters", StorageSystemClusters::create("clusters"));
|
|
|
|
system_database.attachTable("graphite_retentions", StorageSystemGraphite::create("graphite_retentions"));
|
2018-03-12 18:38:00 +00:00
|
|
|
system_database.attachTable("macros", StorageSystemMacros::create("macros"));
|
2017-03-14 18:39:06 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (has_zookeeper)
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("zookeeper", StorageSystemZooKeeper::create("zookeeper"));
|
2017-03-14 18:39:06 +00:00
|
|
|
}
|
|
|
|
|
2017-06-18 05:43:29 +00:00
|
|
|
void attachSystemTablesAsync(IDatabase & system_database, AsynchronousMetrics & async_metrics)
|
2017-03-14 18:39:06 +00:00
|
|
|
{
|
2017-06-18 05:43:29 +00:00
|
|
|
system_database.attachTable("asynchronous_metrics", StorageSystemAsynchronousMetrics::create("asynchronous_metrics", async_metrics));
|
2017-03-14 18:39:06 +00:00
|
|
|
}
|
2017-06-18 05:43:29 +00:00
|
|
|
|
2017-03-14 18:39:06 +00:00
|
|
|
}
|