Registering the Blob Storage Disk

This commit is contained in:
Jakub Kuklis 2021-09-29 07:42:00 +00:00 committed by Jakub Kuklis
parent 20dda7f666
commit 88b5feb59d
3 changed files with 43 additions and 4 deletions

View File

@ -47,6 +47,16 @@ class DiskBlobStorage final : public IDiskRemote
{
public:
DiskBlobStorage(
const String & name_,
const String & remote_fs_root_path_,
const String & metadata_path_,
const String & log_name_,
size_t thread_pool_size) :
IDiskRemote(name_, remote_fs_root_path_, metadata_path_, log_name_, thread_pool_size) {}
DiskBlobStorage() : IDiskRemote("a", "b", "c", "d", 1) {}
std::unique_ptr<ReadBufferFromFileBase> readFile(
const String &,
size_t,

View File

@ -4,17 +4,40 @@
#include <Disks/DiskFactory.h>
#if USE_AZURE_BLOB_STORAGE
#include <Disks/BlobStorage/DiskBlobStorage.h>
#include <Disks/DiskRestartProxy.h>
namespace DB
{
#if USE_AZURE_BLOB_STORAGE
void registerDiskBlobStorage(DiskFactory & factory)
{
auto creator = [](
const String &,
const Poco::Util::AbstractConfiguration &,
const String &,
ContextPtr,
const DisksMap &)
{
std::shared_ptr<IDisk> diskBlobStorage = std::make_shared<DiskBlobStorage>();
void registerDiskBlobStorage(DiskFactory &) {};
return std::make_shared<DiskRestartProxy>(diskBlobStorage);
};
factory.registerDiskType("blob_storage", creator);
}
}
#else
void registerDiskBlobStorage(DiskFactory &) {};
namespace DB
{
#endif
void registerDiskBlobStorage(DiskFactory &) {}
}
#endif

View File

@ -1,6 +1,7 @@
#include "WriteIndirectBufferFromRemoteFS.h"
#include <IO/WriteBufferFromS3.h>
#include <IO/WriteBufferFromBlobStorage.h>
#include <Storages/HDFS/WriteBufferFromHDFS.h>
#include <IO/WriteBufferFromHTTP.h>
@ -57,6 +58,11 @@ template
class WriteIndirectBufferFromRemoteFS<WriteBufferFromS3>;
#endif
#if USE_AZURE_BLOB_STORAGE
template
class WriteIndirectBufferFromRemoteFS<WriteBufferFromBlobStorage>;
#endif
#if USE_HDFS
template
class WriteIndirectBufferFromRemoteFS<WriteBufferFromHDFS>;