mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
32 lines
711 B
C++
32 lines
711 B
C++
#pragma once
|
|
|
|
#include <Common/config.h>
|
|
|
|
#if USE_HDFS
|
|
#include <IO/WriteBuffer.h>
|
|
#include <IO/BufferWithOwnMemory.h>
|
|
#include <string>
|
|
#include <memory>
|
|
|
|
namespace DB
|
|
{
|
|
/** Accepts HDFS path to file and opens it.
|
|
* Closes file by himself (thus "owns" a file descriptor).
|
|
*/
|
|
class WriteBufferFromHDFS : public BufferWithOwnMemory<WriteBuffer>
|
|
{
|
|
struct WriteBufferFromHDFSImpl;
|
|
std::unique_ptr<WriteBufferFromHDFSImpl> impl;
|
|
public:
|
|
WriteBufferFromHDFS(const std::string & hdfs_name_, size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE);
|
|
WriteBufferFromHDFS(WriteBufferFromHDFS &&) = default;
|
|
|
|
void nextImpl() override;
|
|
|
|
~WriteBufferFromHDFS() override;
|
|
|
|
void sync() override;
|
|
};
|
|
}
|
|
#endif
|