ClickHouse/src/IO/WriteBufferFromAzureBlobStorage.h

48 lines
1.1 KiB
C++
Raw Normal View History

2021-09-28 14:37:38 +00:00
#pragma once
#include <Common/config.h>
#if USE_AZURE_BLOB_STORAGE
#include <memory>
2021-09-28 14:37:38 +00:00
#include <IO/BufferWithOwnMemory.h>
#include <IO/WriteBuffer.h>
2022-07-11 17:19:57 +00:00
#include <IO/WriteSettings.h>
#include <azure/storage/blobs.hpp>
#include <azure/core/io/body_stream.hpp>
2021-09-28 14:37:38 +00:00
namespace DB
{
2021-12-16 22:57:08 +00:00
class WriteBufferFromAzureBlobStorage : public BufferWithOwnMemory<WriteBuffer>
2021-09-28 14:37:38 +00:00
{
public:
2022-05-19 17:25:45 +00:00
WriteBufferFromAzureBlobStorage(
std::shared_ptr<const Azure::Storage::Blobs::BlobContainerClient> blob_container_client_,
const String & blob_path_,
2021-11-16 13:35:21 +00:00
size_t max_single_part_upload_size_,
2022-05-19 17:25:45 +00:00
size_t buf_size_,
2022-07-11 17:19:57 +00:00
const WriteSettings & write_settings_,
2022-05-19 17:25:45 +00:00
std::optional<std::map<std::string, std::string>> attributes_ = {});
2021-09-28 14:37:38 +00:00
2021-12-16 22:57:08 +00:00
~WriteBufferFromAzureBlobStorage() override;
2021-11-30 15:44:28 +00:00
void nextImpl() override;
private:
2021-12-24 12:40:54 +00:00
void finalizeImpl() override;
2022-05-19 17:25:45 +00:00
std::shared_ptr<const Azure::Storage::Blobs::BlobContainerClient> blob_container_client;
2021-11-16 12:57:21 +00:00
size_t max_single_part_upload_size;
const String blob_path;
2022-07-11 17:19:57 +00:00
WriteSettings write_settings;
2022-05-19 17:25:45 +00:00
std::optional<std::map<std::string, std::string>> attributes;
2021-09-28 14:37:38 +00:00
};
}
#endif