ClickHouse/src/Storages/HDFS/StorageHDFS.h

55 lines
1.4 KiB
C++
Raw Normal View History

2018-11-19 08:17:09 +00:00
#pragma once
#include <Common/config.h>
#if USE_HDFS
2018-11-19 08:17:09 +00:00
#include <Storages/IStorage.h>
#include <Poco/URI.h>
#include <common/logger_useful.h>
#include <ext/shared_ptr_helper.h>
namespace DB
{
/**
* This class represents table engine for external hdfs files.
* Read method is supported for now.
*/
class StorageHDFS final : public ext::shared_ptr_helper<StorageHDFS>, public IStorage
2018-11-19 08:17:09 +00:00
{
2019-08-26 19:07:29 +00:00
friend struct ext::shared_ptr_helper<StorageHDFS>;
2018-11-19 08:17:09 +00:00
public:
String getName() const override { return "HDFS"; }
2018-11-19 08:17:09 +00:00
2020-08-03 13:54:14 +00:00
Pipe read(
const Names & column_names,
const StorageMetadataPtr & /*metadata_snapshot*/,
SelectQueryInfo & query_info,
2018-11-19 08:17:09 +00:00
const Context & context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
2018-11-19 08:17:09 +00:00
unsigned num_streams) override;
BlockOutputStreamPtr write(const ASTPtr & query, const StorageMetadataPtr & /*metadata_snapshot*/, const Context & context) override;
2018-11-19 08:17:09 +00:00
NamesAndTypesList getVirtuals() const override;
2020-04-27 13:55:30 +00:00
2018-11-19 08:17:09 +00:00
protected:
StorageHDFS(const String & uri_,
2019-12-04 16:06:55 +00:00
const StorageID & table_id_,
2018-11-19 08:17:09 +00:00
const String & format_name_,
const ColumnsDescription & columns_,
2019-08-24 21:20:20 +00:00
const ConstraintsDescription & constraints_,
Context & context_,
const String & compression_method_);
2018-11-19 08:17:09 +00:00
private:
String uri;
String format_name;
Context & context;
String compression_method;
2018-11-19 08:17:09 +00:00
2020-05-30 21:57:37 +00:00
Poco::Logger * log = &Poco::Logger::get("StorageHDFS");
2018-11-19 08:17:09 +00:00
};
}
#endif