mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Don't update "arrow" on client-side for nothing
This commit is contained in:
parent
8c640f54f8
commit
92769a2460
2
.gitignore
vendored
2
.gitignore
vendored
@ -243,3 +243,5 @@ website/package-lock.json
|
|||||||
|
|
||||||
# ccls cache
|
# ccls cache
|
||||||
/.ccls-cache
|
/.ccls-cache
|
||||||
|
|
||||||
|
/compile_commands.json
|
||||||
|
@ -1031,7 +1031,8 @@ private:
|
|||||||
|
|
||||||
// TODO: get the poll_interval from commandline.
|
// TODO: get the poll_interval from commandline.
|
||||||
const auto receive_timeout = connection->getTimeouts().receive_timeout;
|
const auto receive_timeout = connection->getTimeouts().receive_timeout;
|
||||||
constexpr size_t default_poll_interval = 1000000, min_poll_interval = 5000; /// in microseconds
|
constexpr size_t default_poll_interval = 1000000; /// in microseconds
|
||||||
|
constexpr size_t min_poll_interval = 5000; /// in microseconds
|
||||||
const size_t poll_interval
|
const size_t poll_interval
|
||||||
= std::max(min_poll_interval, std::min<size_t>(receive_timeout.totalMicroseconds(), default_poll_interval));
|
= std::max(min_poll_interval, std::min<size_t>(receive_timeout.totalMicroseconds(), default_poll_interval));
|
||||||
|
|
||||||
@ -1333,7 +1334,11 @@ private:
|
|||||||
|
|
||||||
void onProgress(const Progress & value)
|
void onProgress(const Progress & value)
|
||||||
{
|
{
|
||||||
progress.incrementPiecewiseAtomically(value);
|
if (!progress.incrementPiecewiseAtomically(value))
|
||||||
|
{
|
||||||
|
// Just a keep-alive update.
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (block_out_stream)
|
if (block_out_stream)
|
||||||
block_out_stream->onProgress(value);
|
block_out_stream->onProgress(value);
|
||||||
writeProgress();
|
writeProgress();
|
||||||
|
@ -53,11 +53,16 @@ struct Progress
|
|||||||
void writeJSON(WriteBuffer & out) const;
|
void writeJSON(WriteBuffer & out) const;
|
||||||
|
|
||||||
/// Each value separately is changed atomically (but not whole object).
|
/// Each value separately is changed atomically (but not whole object).
|
||||||
void incrementPiecewiseAtomically(const Progress & rhs)
|
bool incrementPiecewiseAtomically(const Progress & rhs)
|
||||||
{
|
{
|
||||||
|
if (!rhs.rows)
|
||||||
|
return false;
|
||||||
|
|
||||||
rows += rhs.rows;
|
rows += rhs.rows;
|
||||||
bytes += rhs.bytes;
|
bytes += rhs.bytes;
|
||||||
total_rows += rhs.total_rows;
|
total_rows += rhs.total_rows;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset()
|
void reset()
|
||||||
|
Loading…
Reference in New Issue
Block a user