ClickHouse/src/Storages/HDFS/ReadBufferFromHDFS.h

35 lines
748 B
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 <IO/ReadBuffer.h>
#include <IO/BufferWithOwnMemory.h>
2018-12-27 15:23:37 +00:00
#include <string>
2019-01-17 11:26:29 +00:00
#include <memory>
2018-11-19 08:17:09 +00:00
#include <hdfs/hdfs.h>
#include <common/types.h>
#include <Interpreters/Context.h>
2018-11-19 08:17:09 +00:00
namespace DB
{
2019-01-18 10:57:00 +00:00
/** Accepts HDFS path to file and opens it.
2019-01-17 11:26:29 +00:00
* Closes file by himself (thus "owns" a file descriptor).
*/
class ReadBufferFromHDFS : public BufferWithOwnMemory<ReadBuffer>
{
struct ReadBufferFromHDFSImpl;
std::unique_ptr<ReadBufferFromHDFSImpl> impl;
public:
ReadBufferFromHDFS(const std::string & hdfs_name_, const Poco::Util::AbstractConfiguration &, size_t buf_size_ = DBMS_DEFAULT_BUFFER_SIZE);
2020-03-09 01:03:43 +00:00
~ReadBufferFromHDFS() override;
2018-11-19 08:17:09 +00:00
2019-01-17 11:26:29 +00:00
bool nextImpl() override;
};
2018-11-19 08:17:09 +00:00
}
#endif