|
vkdb
A time series database engine in C++.
|
Friendly query builder for querying a Table. More...
#include <friendly_builder.h>
Public Types | |
| using | size_type = typename QueryBuilder<TValue>::size_type |
| using | value_type = DataPoint<TValue> |
| using | result_type = std::vector<value_type> |
Public Member Functions | |
| FriendlyQueryBuilder ()=delete | |
| Deleted default constructor. | |
| FriendlyQueryBuilder (LSMTree< TValue > &lsm_tree, const TagColumns &tag_columns) noexcept | |
| Construct a new FriendlyQueryBuilder object. | |
| FriendlyQueryBuilder (QueryBuilder< TValue > &&query_builder) | |
| Construct a new FriendlyQueryBuilder object. | |
| FriendlyQueryBuilder (FriendlyQueryBuilder &&) noexcept=default | |
| Move-construct a FriendlyQueryBuilder object. | |
| FriendlyQueryBuilder & | operator= (FriendlyQueryBuilder &&) noexcept=default |
| Move-assign a FriendlyQueryBuilder object. | |
| FriendlyQueryBuilder (const FriendlyQueryBuilder &) noexcept=default | |
| Copy-construct a FriendlyQueryBuilder object. | |
| FriendlyQueryBuilder & | operator= (const FriendlyQueryBuilder &) noexcept=default |
| Copy-assign a FriendlyQueryBuilder object. | |
| ~FriendlyQueryBuilder () noexcept=default | |
| Destroy the FriendlyQueryBuilder object. | |
| FriendlyQueryBuilder & | get (Timestamp timestamp, Metric metric, const TagTable &tag_table) |
| Configure builder for get query. | |
| FriendlyQueryBuilder & | whereMetricIs (const Metric &metric) |
| Configure builder for where metric is clause. | |
| template<typename... Metrics> requires (AllConvertibleToNoCVRefQuals<Metric, Metrics> && ...) | |
| FriendlyQueryBuilder & | whereMetricIsAnyOf (const Metrics &... metrics) |
| Configure builder for where metric is any of clause. | |
| FriendlyQueryBuilder & | whereTimestampIs (const Timestamp ×tamp) |
| Configure builder for where timestamp is clause. | |
| FriendlyQueryBuilder & | whereTimestampBetween (const Timestamp &start, const Timestamp &end) |
| Configure builder for where timestamp is between clause. | |
| template<typename... Timestamps> requires (AllConvertibleToNoCVRefQuals<Timestamp, Timestamps> && ...) | |
| FriendlyQueryBuilder & | whereTimestampIsAnyOf (const Timestamps &... timestamps) |
| Configure builder for where timestamp is any of clause. | |
| FriendlyQueryBuilder & | whereTagsContain (const Tag &tag) |
| Configure builder for where tags contain clause. | |
| template<typename... Tags> requires (AllConvertibleToNoCVRefQuals<Tag, Tags> && ...) | |
| FriendlyQueryBuilder & | whereTagsContainAnyOf (const Tags &... tags) |
| Configure builder for where tags contain any of clause. | |
| template<typename... Tags> requires (AllConvertibleToNoCVRefQuals<Tag, Tags> && ...) | |
| FriendlyQueryBuilder & | whereTagsContainAllOf (const Tags &... tags) |
| Configure builder for where tags contain all of clause. | |
| FriendlyQueryBuilder & | put (Timestamp timestamp, Metric metric, const TagTable &tag_table, TValue value) |
| Configure builder for put query. | |
| FriendlyQueryBuilder & | remove (Timestamp timestamp, Metric metric, const TagTable &tag_table) |
| Configure builder for remove query. | |
| size_type | count () |
| Count the number of entries in the range. | |
| TValue | sum () |
| Sum the values in the range. | |
| double | avg () |
| Calculate the average of the values in the range. | |
| TValue | min () |
| Calculate the minimum value in the range. | |
| TValue | max () |
| Calculate the maximum value in the range. | |
| result_type | execute () |
| Execute the query. | |
Friendly query builder for querying a Table.
| TValue | Type of the value of the TimeSeriesKey. |
Definition at line 13 of file friendly_builder.h.
| using vkdb::FriendlyQueryBuilder< TValue >::result_type = std::vector<value_type> |
Definition at line 17 of file friendly_builder.h.
| using vkdb::FriendlyQueryBuilder< TValue >::size_type = typename QueryBuilder<TValue>::size_type |
Definition at line 15 of file friendly_builder.h.
| using vkdb::FriendlyQueryBuilder< TValue >::value_type = DataPoint<TValue> |
Definition at line 16 of file friendly_builder.h.
|
inlineexplicitnoexcept |
Construct a new FriendlyQueryBuilder object.
Initialises the query builder with a QueryBuilder.
| lsm_tree | Reference to the LSMTree to query. |
| tag_columns | Reference to the tag columns of the Table. |
Definition at line 32 of file friendly_builder.h.
|
inlineexplicit |
Construct a new FriendlyQueryBuilder object.
| query_builder | QueryBuilder to use. |
Definition at line 43 of file friendly_builder.h.
|
inlinenodiscard |
Calculate the average of the values in the range.
Sets up the QueryBuilder for aggregation and returns the average of the values in the range.
| std::runtime_error | If the average query fails. |
Definition at line 329 of file friendly_builder.h.
|
inlinenodiscard |
Count the number of entries in the range.
Sets up the QueryBuilder for aggregation and returns the number of entries in the range.
| std::runtime_error | If the count query fails. |
Definition at line 303 of file friendly_builder.h.
|
inline |
Execute the query.
Executes the query and returns the result.
| std::runtime_error | If executing the query fails. |
Definition at line 367 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for get query.
Adds a point query to the query builder.
| timestamp | Timestamp of the TimeSeriesKey. |
| metric | Metric of the TimeSeriesKey. |
| tag_table | TagTable of the TimeSeriesKey. |
| std::runtime_error | If the point query fails. |
Definition at line 92 of file friendly_builder.h.
|
inlinenodiscard |
Calculate the maximum value in the range.
Sets up the QueryBuilder for aggregation and returns the maximum value in the range.
| std::runtime_error | If the maximum query fails. |
Definition at line 355 of file friendly_builder.h.
|
inlinenodiscard |
Calculate the minimum value in the range.
Sets up the QueryBuilder for aggregation and returns the minimum value in the range.
| std::runtime_error | If the minimum query fails. |
Definition at line 342 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for put query.
Adds a put query to the query builder.
| timestamp | Timestamp of the TimeSeriesKey. |
| metric | Metric of the TimeSeriesKey. |
| tag_table | TagTable of the TimeSeriesKey. |
| value | Value of the TimeSeriesKey. |
| std::runtime_error | If the metric is invalid or the put query fails. |
Definition at line 254 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for remove query.
Adds a remove query to the query builder.
| timestamp | Timestamp of the TimeSeriesKey. |
| metric | Metric of the TimeSeriesKey. |
| tag_table | TagTable of the TimeSeriesKey. |
| std::runtime_error | If the remove query fails. |
Definition at line 284 of file friendly_builder.h.
|
inlinenodiscard |
Sum the values in the range.
Sets up the QueryBuilder for aggregation and returns the sum of the values in the range.
| std::runtime_error | If the sum query fails. |
Definition at line 316 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where metric is clause.
| metric | Metric to filter by. |
| std::runtime_error | If adding the filter fails. |
Definition at line 110 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where metric is any of clause.
| Metrics | Variadic template parameter for metrics to filter by. |
| metrics | Metrics to filter by. |
| std::runtime_error | If adding any of the filters fails. |
Definition at line 127 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where tags contain clause.
| tag | Tag to filter by. |
| std::runtime_error | If adding the filter fails. |
Definition at line 198 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where tags contain all of clause.
| Tags | Variadic template parameter for tags to filter by. |
| tags | Tags to filter by. |
| std::runtime_error | If adding all of the filters fails. |
Definition at line 234 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where tags contain any of clause.
| Tags | Variadic template parameter for tags to filter by. |
| tags | Tags to filter by. |
| std::runtime_error | If adding any of the filters fails. |
Definition at line 215 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where timestamp is between clause.
| start | Start timestamp. |
| end | End timestamp. |
| std::runtime_error | If the range query fails. |
Definition at line 160 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where timestamp is clause.
| timestamp | Timestamp to filter by. |
| std::runtime_error | If adding the filter fails. |
Definition at line 143 of file friendly_builder.h.
|
inlinenodiscard |
Configure builder for where timestamp is any of clause.
| Timestamps | Variadic template parameter for timestamps to filter by. |
| timestamps | Timestamps to filter by. |
| std::runtime_error | If adding the filter fails. |
Definition at line 182 of file friendly_builder.h.