2017-04-01 09:19:00 +00:00
|
|
|
#include <Interpreters/Quota.h>
|
|
|
|
#include <Interpreters/ProcessList.h>
|
|
|
|
#include <DataStreams/IProfilingBlockInputStream.h>
|
2018-02-19 03:56:08 +00:00
|
|
|
|
2011-08-27 22:43:31 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-01-11 21:46:36 +00:00
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
2018-03-09 23:23:15 +00:00
|
|
|
extern const int TOO_MANY_ROWS;
|
|
|
|
extern const int TOO_MANY_BYTES;
|
2018-03-11 00:15:26 +00:00
|
|
|
extern const int TOO_MANY_ROWS_OR_BYTES;
|
2017-04-01 07:20:54 +00:00
|
|
|
extern const int TIMEOUT_EXCEEDED;
|
|
|
|
extern const int TOO_SLOW;
|
2017-07-27 21:27:10 +00:00
|
|
|
extern const int LOGICAL_ERROR;
|
2018-02-19 03:56:08 +00:00
|
|
|
extern const int BLOCKS_HAVE_DIFFERENT_STRUCTURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-06-26 12:30:35 +00:00
|
|
|
IProfilingBlockInputStream::IProfilingBlockInputStream()
|
|
|
|
{
|
|
|
|
info.parent = this;
|
|
|
|
}
|
|
|
|
|
2011-09-04 21:23:19 +00:00
|
|
|
Block IProfilingBlockInputStream::read()
|
2011-08-27 22:43:31 +00:00
|
|
|
{
|
2018-02-23 10:02:29 +00:00
|
|
|
if (total_rows_approx)
|
|
|
|
{
|
|
|
|
progressImpl(Progress(0, 0, total_rows_approx));
|
|
|
|
total_rows_approx = 0;
|
|
|
|
}
|
2015-02-15 06:08:31 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (!info.started)
|
|
|
|
{
|
|
|
|
info.total_stopwatch.start();
|
|
|
|
info.started = true;
|
|
|
|
}
|
2012-05-09 08:16:09 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
Block res;
|
2013-11-17 19:14:17 +00:00
|
|
|
|
2018-03-05 21:09:39 +00:00
|
|
|
if (isCancelledOrThrowIfKilled())
|
2017-04-01 07:20:54 +00:00
|
|
|
return res;
|
2012-05-31 00:47:05 +00:00
|
|
|
|
2018-04-02 17:57:38 +00:00
|
|
|
if (!checkTimeLimit())
|
2017-12-23 00:30:26 +00:00
|
|
|
limit_exceeded_need_break = true;
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (!limit_exceeded_need_break)
|
|
|
|
res = readImpl();
|
2011-08-27 22:43:31 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (res)
|
|
|
|
{
|
|
|
|
info.update(res);
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (enabled_extremes)
|
|
|
|
updateExtremes(res);
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2018-03-11 00:15:26 +00:00
|
|
|
if (limits.mode == LIMITS_CURRENT && !limits.size_limits.check(info.rows, info.bytes, "result", ErrorCodes::TOO_MANY_ROWS_OR_BYTES))
|
2018-01-12 13:30:57 +00:00
|
|
|
limit_exceeded_need_break = true;
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (quota != nullptr)
|
|
|
|
checkQuota(res);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/** If the thread is over, then we will ask all children to abort the execution.
|
|
|
|
* This makes sense when running a query with LIMIT
|
|
|
|
* - there is a situation when all the necessary data has already been read,
|
2018-02-23 10:02:29 +00:00
|
|
|
* but children sources are still working,
|
2017-04-01 07:20:54 +00:00
|
|
|
* herewith they can work in separate threads or even remotely.
|
|
|
|
*/
|
2018-03-05 21:09:39 +00:00
|
|
|
cancel(false);
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
2011-09-25 03:37:09 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
progress(Progress(res.rows(), res.bytes()));
|
2012-12-25 17:25:44 +00:00
|
|
|
|
2018-02-19 03:56:08 +00:00
|
|
|
#ifndef NDEBUG
|
|
|
|
if (res)
|
|
|
|
{
|
|
|
|
Block header = getHeader();
|
|
|
|
if (header)
|
2018-02-20 01:25:56 +00:00
|
|
|
assertBlocksHaveEqualStructure(res, header, getName());
|
2018-02-19 03:56:08 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
return res;
|
2013-09-07 02:03:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-05-20 20:01:34 +00:00
|
|
|
void IProfilingBlockInputStream::readPrefix()
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
readPrefixImpl();
|
2016-05-31 01:04:34 +00:00
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
forEachChild([&] (IBlockInputStream & child)
|
|
|
|
{
|
|
|
|
child.readPrefix();
|
|
|
|
return false;
|
|
|
|
});
|
2016-05-20 20:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-13 20:33:09 +00:00
|
|
|
void IProfilingBlockInputStream::readSuffix()
|
|
|
|
{
|
2018-02-23 10:43:24 +00:00
|
|
|
forEachChild([&] (IBlockInputStream & child)
|
|
|
|
{
|
|
|
|
child.readSuffix();
|
|
|
|
return false;
|
|
|
|
});
|
2013-09-13 20:33:09 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
readSuffixImpl();
|
2013-09-13 20:33:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-07 02:03:13 +00:00
|
|
|
void IProfilingBlockInputStream::updateExtremes(Block & block)
|
|
|
|
{
|
2017-12-15 00:01:59 +00:00
|
|
|
size_t num_columns = block.columns();
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (!extremes)
|
|
|
|
{
|
2017-12-15 00:01:59 +00:00
|
|
|
MutableColumns extremes_columns(num_columns);
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-12-15 00:01:59 +00:00
|
|
|
for (size_t i = 0; i < num_columns; ++i)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2017-12-14 21:20:14 +00:00
|
|
|
const ColumnPtr & src = block.safeGetByPosition(i).column;
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-12-14 21:20:14 +00:00
|
|
|
if (src->isColumnConst())
|
|
|
|
{
|
|
|
|
/// Equal min and max.
|
|
|
|
extremes_columns[i] = src->cloneResized(2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Field min_value;
|
|
|
|
Field max_value;
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-12-14 21:20:14 +00:00
|
|
|
src->getExtremes(min_value, max_value);
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-12-14 21:20:14 +00:00
|
|
|
extremes_columns[i] = src->cloneEmpty();
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-12-14 21:20:14 +00:00
|
|
|
extremes_columns[i]->insert(min_value);
|
|
|
|
extremes_columns[i]->insert(max_value);
|
|
|
|
}
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
2017-12-14 21:20:14 +00:00
|
|
|
|
2017-12-15 00:01:59 +00:00
|
|
|
extremes = block.cloneWithColumns(std::move(extremes_columns));
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-12-15 00:01:59 +00:00
|
|
|
for (size_t i = 0; i < num_columns; ++i)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2017-12-14 21:20:14 +00:00
|
|
|
ColumnPtr & old_extremes = extremes.safeGetByPosition(i).column;
|
|
|
|
|
|
|
|
if (old_extremes->isColumnConst())
|
|
|
|
continue;
|
2014-08-22 02:31:54 +00:00
|
|
|
|
2017-12-14 21:20:14 +00:00
|
|
|
Field min_value = (*old_extremes)[0];
|
|
|
|
Field max_value = (*old_extremes)[1];
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
Field cur_min_value;
|
|
|
|
Field cur_max_value;
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
block.safeGetByPosition(i).column->getExtremes(cur_min_value, cur_max_value);
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (cur_min_value < min_value)
|
|
|
|
min_value = cur_min_value;
|
|
|
|
if (cur_max_value > max_value)
|
|
|
|
max_value = cur_max_value;
|
2013-09-07 02:03:13 +00:00
|
|
|
|
2017-12-15 00:01:59 +00:00
|
|
|
MutableColumnPtr new_extremes = old_extremes->cloneEmpty();
|
2017-12-14 21:20:14 +00:00
|
|
|
|
|
|
|
new_extremes->insert(min_value);
|
|
|
|
new_extremes->insert(max_value);
|
|
|
|
|
|
|
|
old_extremes = std::move(new_extremes);
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
|
|
|
}
|
2013-09-07 02:03:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-01-12 13:30:57 +00:00
|
|
|
static bool handleOverflowMode(OverflowMode mode, const String & message, int code)
|
2013-09-07 02:03:13 +00:00
|
|
|
{
|
2018-01-12 13:30:57 +00:00
|
|
|
switch (mode)
|
2017-09-08 03:47:27 +00:00
|
|
|
{
|
2018-01-12 13:30:57 +00:00
|
|
|
case OverflowMode::THROW:
|
|
|
|
throw Exception(message, code);
|
|
|
|
case OverflowMode::BREAK:
|
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
throw Exception("Logical error: unknown overflow mode", ErrorCodes::LOGICAL_ERROR);
|
|
|
|
}
|
|
|
|
};
|
2017-09-08 03:47:27 +00:00
|
|
|
|
2018-01-12 13:30:57 +00:00
|
|
|
|
2018-04-02 17:57:38 +00:00
|
|
|
bool IProfilingBlockInputStream::checkTimeLimit()
|
2018-01-12 13:30:57 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
if (limits.max_execution_time != 0
|
|
|
|
&& info.total_stopwatch.elapsed() > static_cast<UInt64>(limits.max_execution_time.totalMicroseconds()) * 1000)
|
2018-01-12 13:30:57 +00:00
|
|
|
return handleOverflowMode(limits.timeout_overflow_mode,
|
2017-09-08 03:47:27 +00:00
|
|
|
"Timeout exceeded: elapsed " + toString(info.total_stopwatch.elapsedSeconds())
|
2017-04-01 07:20:54 +00:00
|
|
|
+ " seconds, maximum: " + toString(limits.max_execution_time.totalMicroseconds() / 1000000.0),
|
|
|
|
ErrorCodes::TIMEOUT_EXCEEDED);
|
|
|
|
|
|
|
|
return true;
|
2013-09-07 02:03:13 +00:00
|
|
|
}
|
2013-09-01 04:55:41 +00:00
|
|
|
|
|
|
|
|
2013-09-07 02:03:13 +00:00
|
|
|
void IProfilingBlockInputStream::checkQuota(Block & block)
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
switch (limits.mode)
|
|
|
|
{
|
|
|
|
case LIMITS_TOTAL:
|
|
|
|
/// Checked in `progress` method.
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LIMITS_CURRENT:
|
|
|
|
{
|
2017-08-04 14:00:26 +00:00
|
|
|
time_t current_time = time(nullptr);
|
2017-04-01 07:20:54 +00:00
|
|
|
double total_elapsed = info.total_stopwatch.elapsedSeconds();
|
|
|
|
|
|
|
|
quota->checkAndAddResultRowsBytes(current_time, block.rows(), block.bytes());
|
|
|
|
quota->checkAndAddExecutionTime(current_time, Poco::Timespan((total_elapsed - prev_elapsed) * 1000000.0));
|
|
|
|
|
|
|
|
prev_elapsed = total_elapsed;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
throw Exception("Logical error: unknown limits mode.", ErrorCodes::LOGICAL_ERROR);
|
|
|
|
}
|
2011-08-27 22:43:31 +00:00
|
|
|
}
|
2012-05-17 19:15:53 +00:00
|
|
|
|
|
|
|
|
2014-10-25 18:33:52 +00:00
|
|
|
void IProfilingBlockInputStream::progressImpl(const Progress & value)
|
2012-05-17 19:15:53 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
if (progress_callback)
|
|
|
|
progress_callback(value);
|
|
|
|
|
|
|
|
if (process_list_elem)
|
|
|
|
{
|
|
|
|
if (!process_list_elem->updateProgressIn(value))
|
2018-03-05 21:09:39 +00:00
|
|
|
cancel(false);
|
2017-04-01 07:20:54 +00:00
|
|
|
|
|
|
|
/// The total amount of data processed or intended for processing in all leaf sources, possibly on remote servers.
|
|
|
|
|
2018-03-09 23:04:26 +00:00
|
|
|
ProgressValues progress = process_list_elem->getProgressIn();
|
|
|
|
size_t total_rows_estimate = std::max(progress.rows, progress.total_rows);
|
2017-04-01 07:20:54 +00:00
|
|
|
|
|
|
|
/** Check the restrictions on the amount of data to read, the speed of the query, the quota on the amount of data to read.
|
|
|
|
* NOTE: Maybe it makes sense to have them checked directly in ProcessList?
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (limits.mode == LIMITS_TOTAL
|
2018-03-11 00:15:26 +00:00
|
|
|
&& ((limits.size_limits.max_rows && total_rows_estimate > limits.size_limits.max_rows)
|
|
|
|
|| (limits.size_limits.max_bytes && progress.bytes > limits.size_limits.max_bytes)))
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2018-03-11 00:15:26 +00:00
|
|
|
switch (limits.size_limits.overflow_mode)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2017-09-08 03:47:27 +00:00
|
|
|
case OverflowMode::THROW:
|
|
|
|
{
|
2018-03-11 00:15:26 +00:00
|
|
|
if (limits.size_limits.max_rows && total_rows_estimate > limits.size_limits.max_rows)
|
2017-09-08 03:47:27 +00:00
|
|
|
throw Exception("Limit for rows to read exceeded: " + toString(total_rows_estimate)
|
2018-03-11 00:15:26 +00:00
|
|
|
+ " rows read (or to read), maximum: " + toString(limits.size_limits.max_rows),
|
2018-03-09 23:23:15 +00:00
|
|
|
ErrorCodes::TOO_MANY_ROWS);
|
2017-09-08 03:47:27 +00:00
|
|
|
else
|
2018-03-09 23:04:26 +00:00
|
|
|
throw Exception("Limit for (uncompressed) bytes to read exceeded: " + toString(progress.bytes)
|
2018-03-11 00:15:26 +00:00
|
|
|
+ " bytes read, maximum: " + toString(limits.size_limits.max_bytes),
|
2018-03-09 23:23:15 +00:00
|
|
|
ErrorCodes::TOO_MANY_BYTES);
|
2017-09-08 03:47:27 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case OverflowMode::BREAK:
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2018-03-11 00:15:26 +00:00
|
|
|
/// For `break`, we will stop only if so many rows were actually read, and not just supposed to be read.
|
|
|
|
if ((limits.size_limits.max_rows && progress.rows > limits.size_limits.max_rows)
|
|
|
|
|| (limits.size_limits.max_bytes && progress.bytes > limits.size_limits.max_bytes))
|
2017-09-08 03:47:27 +00:00
|
|
|
{
|
2018-03-05 21:09:39 +00:00
|
|
|
cancel(false);
|
2017-09-08 03:47:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
2017-09-08 03:47:27 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
throw Exception("Logical error: unknown overflow mode", ErrorCodes::LOGICAL_ERROR);
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-09 23:04:26 +00:00
|
|
|
size_t total_rows = progress.total_rows;
|
2017-04-01 07:20:54 +00:00
|
|
|
|
|
|
|
if (limits.min_execution_speed || (total_rows && limits.timeout_before_checking_execution_speed != 0))
|
|
|
|
{
|
|
|
|
double total_elapsed = info.total_stopwatch.elapsedSeconds();
|
|
|
|
|
|
|
|
if (total_elapsed > limits.timeout_before_checking_execution_speed.totalMicroseconds() / 1000000.0)
|
|
|
|
{
|
2018-03-09 23:04:26 +00:00
|
|
|
if (limits.min_execution_speed && progress.rows / total_elapsed < limits.min_execution_speed)
|
|
|
|
throw Exception("Query is executing too slow: " + toString(progress.rows / total_elapsed)
|
2017-04-01 07:20:54 +00:00
|
|
|
+ " rows/sec., minimum: " + toString(limits.min_execution_speed),
|
|
|
|
ErrorCodes::TOO_SLOW);
|
|
|
|
|
2018-03-09 23:04:26 +00:00
|
|
|
size_t total_rows = progress.total_rows;
|
2017-04-01 07:20:54 +00:00
|
|
|
|
|
|
|
/// If the predicted execution time is longer than `max_execution_time`.
|
|
|
|
if (limits.max_execution_time != 0 && total_rows)
|
|
|
|
{
|
2018-03-09 23:04:26 +00:00
|
|
|
double estimated_execution_time_seconds = total_elapsed * (static_cast<double>(total_rows) / progress.rows);
|
2017-04-01 07:20:54 +00:00
|
|
|
|
|
|
|
if (estimated_execution_time_seconds > limits.max_execution_time.totalSeconds())
|
|
|
|
throw Exception("Estimated query execution time (" + toString(estimated_execution_time_seconds) + " seconds)"
|
|
|
|
+ " is too long. Maximum: " + toString(limits.max_execution_time.totalSeconds())
|
|
|
|
+ ". Estimated rows to process: " + toString(total_rows),
|
|
|
|
ErrorCodes::TOO_SLOW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (quota != nullptr && limits.mode == LIMITS_TOTAL)
|
|
|
|
{
|
2017-12-18 04:07:26 +00:00
|
|
|
quota->checkAndAddReadRowsBytes(time(nullptr), value.rows, value.bytes);
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-17 19:15:53 +00:00
|
|
|
}
|
2014-08-22 02:31:54 +00:00
|
|
|
|
2011-08-27 22:43:31 +00:00
|
|
|
|
2018-03-05 21:09:39 +00:00
|
|
|
void IProfilingBlockInputStream::cancel(bool kill)
|
2012-10-17 19:55:56 +00:00
|
|
|
{
|
2018-03-05 21:09:39 +00:00
|
|
|
if (kill)
|
|
|
|
is_killed = true;
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
bool old_val = false;
|
|
|
|
if (!is_cancelled.compare_exchange_strong(old_val, true, std::memory_order_seq_cst, std::memory_order_relaxed))
|
|
|
|
return;
|
2012-10-17 19:55:56 +00:00
|
|
|
|
2018-03-05 21:09:39 +00:00
|
|
|
forEachProfilingChild([&] (IProfilingBlockInputStream & child)
|
2018-02-23 10:43:24 +00:00
|
|
|
{
|
2018-03-05 21:09:39 +00:00
|
|
|
child.cancel(kill);
|
2018-02-23 10:43:24 +00:00
|
|
|
return false;
|
|
|
|
});
|
2012-10-17 19:55:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-04-05 04:42:20 +00:00
|
|
|
bool IProfilingBlockInputStream::isCancelled() const
|
|
|
|
{
|
|
|
|
return is_cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IProfilingBlockInputStream::isCancelledOrThrowIfKilled() const
|
|
|
|
{
|
|
|
|
if (!is_cancelled)
|
|
|
|
return false;
|
|
|
|
if (is_killed)
|
|
|
|
throw Exception("Query was cancelled", ErrorCodes::QUERY_WAS_CANCELLED);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-09-08 03:47:27 +00:00
|
|
|
void IProfilingBlockInputStream::setProgressCallback(const ProgressCallback & callback)
|
2012-05-09 15:15:45 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
progress_callback = callback;
|
2014-08-22 02:31:54 +00:00
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
forEachProfilingChild([&] (IProfilingBlockInputStream & child)
|
|
|
|
{
|
|
|
|
child.setProgressCallback(callback);
|
|
|
|
return false;
|
|
|
|
});
|
2012-05-09 08:16:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-21 06:06:04 +00:00
|
|
|
void IProfilingBlockInputStream::setProcessListElement(ProcessListElement * elem)
|
2013-11-03 05:32:42 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
process_list_elem = elem;
|
2013-11-03 05:32:42 +00:00
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
forEachProfilingChild([&] (IProfilingBlockInputStream & child)
|
|
|
|
{
|
|
|
|
child.setProcessListElement(elem);
|
|
|
|
return false;
|
|
|
|
});
|
2013-11-03 05:32:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
Block IProfilingBlockInputStream::getTotals()
|
2013-09-01 04:55:41 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
if (totals)
|
|
|
|
return totals;
|
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
Block res;
|
|
|
|
forEachProfilingChild([&] (IProfilingBlockInputStream & child)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2018-02-23 10:43:24 +00:00
|
|
|
res = child.getTotals();
|
|
|
|
if (res)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
return res;
|
2013-09-01 04:55:41 +00:00
|
|
|
}
|
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
Block IProfilingBlockInputStream::getExtremes()
|
2013-09-07 02:03:13 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
if (extremes)
|
|
|
|
return extremes;
|
|
|
|
|
2018-02-23 10:43:24 +00:00
|
|
|
Block res;
|
|
|
|
forEachProfilingChild([&] (IProfilingBlockInputStream & child)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2018-02-23 10:43:24 +00:00
|
|
|
res = child.getExtremes();
|
|
|
|
if (res)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
return res;
|
2013-09-07 02:03:13 +00:00
|
|
|
}
|
|
|
|
|
2011-08-27 22:43:31 +00:00
|
|
|
}
|