blank for system.graphite

This commit is contained in:
artpaul 2017-02-14 19:24:30 +05:00 committed by alexey-milovidov
parent 8fde017951
commit 1e13e68028
2 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,38 @@
#pragma once
#include <DB/Storages/IStorage.h>
#include <ext/shared_ptr_helper.hpp>
namespace DB
{
class StorageSystemGraphite
: private ext::shared_ptr_helper<StorageSystemGraphite>
, public IStorage
{
friend class ext::shared_ptr_helper<StorageSystemGraphite>;
public:
static StoragePtr create(const std::string & name_);
std::string getName() const override { return "SystemGraphite"; }
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:
const std::string name;
NamesAndTypesList columns;
StorageSystemGraphite(const std::string & name_);
};
}

View File

@ -0,0 +1,35 @@
#include <DB/Storages/System/StorageSystemGraphite.h>
#include <DB/Columns/ColumnString.h>
#include <DB/DataTypes/DataTypeString.h>
#include <DB/DataTypes/DataTypesNumberFixed.h>
namespace DB
{
StorageSystemGraphite::StorageSystemGraphite(const std::string & name_)
: name(name_)
, columns {
{"metric", std::make_shared<DataTypeString>()},
{"value", std::make_shared<DataTypeInt64>()}}
{
}
StoragePtr StorageSystemGraphite::create(const std::string & name_)
{
return nullptr;
}
BlockInputStreams StorageSystemGraphite::read(
const Names & column_names,
ASTPtr query,
const Context & context,
const Settings & settings,
QueryProcessingStage::Enum & processed_stage,
size_t max_block_size,
unsigned threads)
{
return BlockInputStreams();
}
}