mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
DiskRestartProxy refactoring.
This commit is contained in:
parent
98f8cbbdb2
commit
016a9c674b
@ -384,13 +384,13 @@ private:
|
||||
};
|
||||
|
||||
/// Stores data in S3 and adds the object key (S3 path) and object size to metadata file on local FS.
|
||||
class WriteIndirectBufferFromS3 final : public WriteBufferFromFileDecorator<WriteBufferFromS3>
|
||||
class WriteIndirectBufferFromS3 final : public WriteBufferFromFileDecorator
|
||||
{
|
||||
public:
|
||||
WriteIndirectBufferFromS3(
|
||||
std::unique_ptr<WriteBufferFromS3> impl_,
|
||||
DiskS3::Metadata metadata_,
|
||||
const String & s3_path_)
|
||||
String & s3_path_)
|
||||
: WriteBufferFromFileDecorator(std::move(impl_))
|
||||
, metadata(std::move(metadata_))
|
||||
, s3_path(s3_path_)
|
||||
@ -695,7 +695,7 @@ std::unique_ptr<WriteBufferFromFileBase> DiskS3::writeFile(const String & path,
|
||||
std::move(object_metadata),
|
||||
buf_size);
|
||||
|
||||
return std::make_unique<WriteIndirectBufferFromS3>(std::move(s3_buffer), std::move(metadata), std::move(s3_path));
|
||||
return std::make_unique<WriteIndirectBufferFromS3>(std::move(s3_buffer), std::move(metadata), s3_path);
|
||||
}
|
||||
|
||||
void DiskS3::removeMeta(const String & path, AwsS3KeyKeeper & keys)
|
||||
|
@ -5,13 +5,13 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
WriteBufferFromFileDecorator<WriteBuffer>::WriteBufferFromFileDecorator(std::unique_ptr<WriteBuffer> impl_)
|
||||
WriteBufferFromFileDecorator::WriteBufferFromFileDecorator(std::unique_ptr<WriteBuffer> impl_)
|
||||
: WriteBufferFromFileBase(0, nullptr, 0), impl(std::move(impl_))
|
||||
{
|
||||
swap(*impl);
|
||||
}
|
||||
|
||||
WriteBufferFromFileDecorator<WriteBuffer>::finalize()
|
||||
void WriteBufferFromFileDecorator::finalize()
|
||||
{
|
||||
if (finalized)
|
||||
return;
|
||||
@ -24,7 +24,7 @@ WriteBufferFromFileDecorator<WriteBuffer>::finalize()
|
||||
finalized = true;
|
||||
}
|
||||
|
||||
WriteBufferFromFileDecorator<WriteBuffer>::~WriteBufferFromFileDecorator()
|
||||
WriteBufferFromFileDecorator::~WriteBufferFromFileDecorator()
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -36,19 +36,19 @@ WriteBufferFromFileDecorator<WriteBuffer>::~WriteBufferFromFileDecorator()
|
||||
}
|
||||
}
|
||||
|
||||
void WriteBufferFromFileDecorator<WriteBuffer>::sync()
|
||||
void WriteBufferFromFileDecorator::sync()
|
||||
{
|
||||
impl->sync();
|
||||
}
|
||||
|
||||
std::string WriteBufferFromFileDecorator<WriteBuffer>::getFileName() const
|
||||
std::string WriteBufferFromFileDecorator::getFileName() const
|
||||
{
|
||||
if (auto & buffer = dynamic_cast<WriteBufferFromFileBase&>(*impl))
|
||||
return buffer.getFileName();
|
||||
if (WriteBufferFromFileBase * buffer = dynamic_cast<WriteBufferFromFileBase*>(impl.get()))
|
||||
return buffer->getFileName();
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void WriteBufferFromFileDecorator<WriteBuffer>::nextImpl()
|
||||
void WriteBufferFromFileDecorator::nextImpl()
|
||||
{
|
||||
swap(*impl);
|
||||
impl->next();
|
||||
|
Loading…
Reference in New Issue
Block a user