ClickHouse/dbms/include/DB/Storages/System/StorageSystemClusters.h

47 lines
1.2 KiB
C++
Raw Normal View History

2015-04-30 12:43:16 +00:00
#pragma once
#include <ext/share_ptr_helper.hpp>
2015-04-30 12:43:16 +00:00
#include <DB/Storages/IStorage.h>
namespace DB
{
class Context;
/** Implements system table 'clusters'
* that allows to obtain information about available clusters
* (which may be specified in Distributed tables).
2015-04-30 12:43:16 +00:00
*/
class StorageSystemClusters : private ext::share_ptr_helper<StorageSystemClusters>, public IStorage
2015-04-30 12:43:16 +00:00
{
friend class ext::share_ptr_helper<StorageSystemClusters>;
2015-04-30 12:43:16 +00:00
public:
StorageSystemClusters(const std::string & name_, Context & context_);
static StoragePtr create(const std::string & name_, Context & context_);
2016-05-12 20:43:51 +00:00
std::string getName() const override { return "SystemClusters"; }
2015-04-30 12:43:16 +00:00
std::string getTableName() const override { return name; }
const NamesAndTypesList & getColumnsListImpl() const override { return columns; }
BlockInputStreams read(
const Names & column_names,
ASTPtr query,
const Context & context,
const Settings & settings,
QueryProcessingStage::Enum & processed_stage,
size_t max_block_size = DEFAULT_BLOCK_SIZE,
unsigned threads = 1) override;
private:
StorageSystemClusters(const std::string & name_);
private:
const std::string name;
NamesAndTypesList columns;
Context & context;
};
}