mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
CalcCloud: fix error in calculating hash [#METR-10969]
This commit is contained in:
parent
1024697bf7
commit
23d48eae6b
@ -42,10 +42,6 @@ private:
|
||||
|
||||
/// Отправили все данные и переименовали файл
|
||||
bool finalized;
|
||||
|
||||
/// считать ли чексумму для отправляемого файла
|
||||
bool calc_checksum;
|
||||
Poco::SharedPtr<WriteBuffer> temp_write_buffer;
|
||||
public:
|
||||
/** Если tmp_path не пустой, то записывает сначала временный файл, а затем переименовывает,
|
||||
* удаляя существующие файлы, если есть.
|
||||
@ -54,10 +50,10 @@ public:
|
||||
RemoteWriteBuffer(const std::string & host_, int port_, const std::string & path_,
|
||||
const std::string & tmp_path_ = "", const std::string & if_exists_ = "remove",
|
||||
bool decompress_ = false, size_t timeout_ = 0, unsigned connection_retries_ = 3,
|
||||
size_t buffer_size_ = DBMS_DEFAULT_BUFFER_SIZE, bool calc_checksum_ = false)
|
||||
size_t buffer_size_ = DBMS_DEFAULT_BUFFER_SIZE)
|
||||
: WriteBuffer(nullptr, 0), host(host_), port(port_), path(path_),
|
||||
tmp_path(tmp_path_), if_exists(if_exists_),
|
||||
decompress(decompress_), connection_retries(connection_retries_), finalized(false), calc_checksum(calc_checksum_)
|
||||
decompress(decompress_), connection_retries(connection_retries_), finalized(false)
|
||||
{
|
||||
Poco::URI::encode(path, "&#", encoded_path);
|
||||
Poco::URI::encode(tmp_path, "&#", encoded_tmp_path);
|
||||
@ -112,13 +108,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if (calc_checksum)
|
||||
{
|
||||
temp_write_buffer = new WriteBufferFromOStream(*ostr, buffer_size_);
|
||||
impl = new HashingWriteBuffer(*temp_write_buffer);
|
||||
}
|
||||
else
|
||||
impl = new WriteBufferFromOStream(*ostr, buffer_size_);
|
||||
impl = new WriteBufferFromOStream(*ostr, buffer_size_);
|
||||
|
||||
set(impl->buffer().begin(), impl->buffer().size());
|
||||
}
|
||||
@ -165,11 +155,6 @@ public:
|
||||
finalized = true;
|
||||
}
|
||||
|
||||
uint128 getHash()
|
||||
{
|
||||
return dynamic_cast<HashingWriteBuffer &>(*impl).getHash();
|
||||
}
|
||||
|
||||
~RemoteWriteBuffer()
|
||||
{
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user