mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Possibly better fix.
This commit is contained in:
parent
b460024356
commit
0497ce4f9c
@ -56,7 +56,6 @@ WriteBufferFromS3::WriteBufferFromS3(
|
||||
initiate();
|
||||
}
|
||||
|
||||
|
||||
void WriteBufferFromS3::nextImpl()
|
||||
{
|
||||
if (!offset())
|
||||
@ -79,23 +78,31 @@ void WriteBufferFromS3::nextImpl()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WriteBufferFromS3::finalize()
|
||||
{
|
||||
next();
|
||||
|
||||
if (is_multipart)
|
||||
writePart(temporary_buffer->str());
|
||||
|
||||
complete();
|
||||
finalizeImpl();
|
||||
}
|
||||
|
||||
void WriteBufferFromS3::finalizeImpl()
|
||||
{
|
||||
if (!finalized)
|
||||
{
|
||||
next();
|
||||
|
||||
if (is_multipart)
|
||||
writePart(temporary_buffer->str());
|
||||
|
||||
complete();
|
||||
|
||||
finalized = true;
|
||||
}
|
||||
}
|
||||
|
||||
WriteBufferFromS3::~WriteBufferFromS3()
|
||||
{
|
||||
try
|
||||
{
|
||||
next();
|
||||
finalizeImpl();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@ -103,7 +110,6 @@ WriteBufferFromS3::~WriteBufferFromS3()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WriteBufferFromS3::initiate()
|
||||
{
|
||||
Aws::S3::Model::CreateMultipartUploadRequest req;
|
||||
|
@ -57,9 +57,13 @@ public:
|
||||
~WriteBufferFromS3() override;
|
||||
|
||||
private:
|
||||
bool finalized = false;
|
||||
|
||||
void initiate();
|
||||
void writePart(const String & data);
|
||||
void complete();
|
||||
|
||||
void finalizeImpl();
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -116,7 +116,6 @@ void ZlibDeflatingWriteBuffer::finish()
|
||||
|
||||
if (rc == Z_STREAM_END)
|
||||
{
|
||||
out->finalize();
|
||||
finished = true;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user