1#pragma once
2
3#include <Core/Types.h>
4#include <Poco/Util/XMLConfiguration.h>
5
6namespace DB
7{
8
9using ConfigurationPtr = Poco::AutoPtr<Poco::Util::AbstractConfiguration>;
10
11/// A set of supported stop conditions.
12struct StopConditionsSet
13{
14 void loadFromConfig(const ConfigurationPtr & stop_conditions_view);
15 void reset();
16
17 /// Note: only conditions with UInt64 minimal thresholds are supported.
18 /// I.e. condition is fulfilled when value is exceeded.
19 struct StopCondition
20 {
21 UInt64 value = 0;
22 bool fulfilled = false;
23 };
24
25 void report(UInt64 value, StopCondition & condition);
26
27 StopCondition total_time_ms;
28 StopCondition rows_read;
29 StopCondition bytes_read_uncompressed;
30 StopCondition iterations;
31 StopCondition min_time_not_changing_for_ms;
32 StopCondition max_speed_not_changing_for_ms;
33 StopCondition average_speed_not_changing_for_ms;
34
35 size_t initialized_count = 0;
36 size_t fulfilled_count = 0;
37};
38
39}
40