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