quasardb 3.14.2.dev0__cp311-cp311-macosx_11_0_arm64.whl → 3.14.2.dev2__cp311-cp311-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of quasardb might be problematic. Click here for more details.
- quasardb/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
- quasardb/CMakeLists.txt +30 -13
- quasardb/Makefile +10 -10
- quasardb/__init__.py +33 -4
- quasardb/cluster.cpp +7 -1
- quasardb/cluster.hpp +111 -72
- quasardb/concepts.hpp +56 -12
- quasardb/continuous.cpp +84 -34
- quasardb/continuous.hpp +10 -7
- quasardb/convert/array.hpp +23 -6
- quasardb/convert/value.hpp +78 -7
- quasardb/date/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
- quasardb/date/CMakeFiles/Export/a52b05f964b070ee926bcad51d3288af/dateTargets.cmake +12 -12
- quasardb/date/Makefile +10 -10
- quasardb/date/dateConfigVersion.cmake +9 -2
- quasardb/date/dateTargets.cmake +3 -7
- quasardb/detail/invoke.hpp +0 -0
- quasardb/detail/retry.cpp +30 -0
- quasardb/detail/retry.hpp +147 -0
- quasardb/detail/sleep.hpp +53 -0
- quasardb/{writer.cpp → detail/writer.cpp} +68 -162
- quasardb/detail/writer.hpp +550 -0
- quasardb/error.hpp +76 -1
- quasardb/libqdb_api.dylib +0 -0
- quasardb/masked_array.hpp +9 -2
- quasardb/module.cpp +20 -4
- quasardb/numpy/__init__.py +58 -10
- quasardb/object_tracker.hpp +2 -3
- quasardb/options.hpp +32 -3
- quasardb/pandas/__init__.py +59 -102
- quasardb/properties.cpp +41 -0
- quasardb/properties.hpp +85 -0
- quasardb/pybind11/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
- quasardb/pybind11/Makefile +10 -10
- quasardb/quasardb.cpython-311-darwin.so +0 -0
- quasardb/range-v3/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
- quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +12 -12
- quasardb/range-v3/CMakeFiles/range.v3.headers.dir/DependInfo.cmake +6 -2
- quasardb/range-v3/CMakeFiles/range.v3.headers.dir/build.make +2 -2
- quasardb/range-v3/Makefile +10 -10
- quasardb/range-v3/cmake_install.cmake +12 -0
- quasardb/range-v3/range-v3-config-version.cmake +9 -2
- quasardb/range-v3/range-v3-config.cmake +3 -7
- quasardb/reader.cpp +282 -0
- quasardb/reader.hpp +256 -0
- quasardb/table.cpp +4 -36
- quasardb/table.hpp +69 -28
- quasardb/traits.hpp +23 -0
- quasardb/writer.hpp +245 -287
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev2.dist-info}/METADATA +7 -7
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev2.dist-info}/RECORD +54 -48
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev2.dist-info}/WHEEL +1 -1
- quasardb/reader/ts_row.hpp +0 -281
- quasardb/reader/ts_value.hpp +0 -245
- quasardb/table_reader.hpp +0 -220
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev2.dist-info}/LICENSE.md +0 -0
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev2.dist-info}/top_level.txt +0 -0
quasardb/continuous.cpp
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
#include "continuous.hpp"
|
|
2
|
+
#include <iostream>
|
|
2
3
|
|
|
3
4
|
namespace qdb
|
|
4
5
|
{
|
|
5
6
|
|
|
6
|
-
query_continuous::query_continuous(qdb::handle_ptr h,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const std::string & query_string,
|
|
10
|
-
const py::object & bools)
|
|
11
|
-
: _handle{h}
|
|
7
|
+
query_continuous::query_continuous(qdb::handle_ptr h, const py::object & bools)
|
|
8
|
+
: _logger("quasardb.query_continuous")
|
|
9
|
+
, _handle{h}
|
|
12
10
|
, _callback{&query_continuous::continuous_callback}
|
|
13
11
|
, _cont_handle{nullptr}
|
|
14
12
|
, _parse_bools{bools}
|
|
15
13
|
, _previous_watermark{0}
|
|
16
14
|
, _watermark{0}
|
|
17
15
|
, _last_error{qdb_e_uninitialized}
|
|
18
|
-
{
|
|
19
|
-
qdb::qdb_throw_if_error(
|
|
20
|
-
*_handle, qdb_query_continuous(*_handle, query_string.c_str(), mode,
|
|
21
|
-
static_cast<unsigned>(pace.count()), _callback, this, &_cont_handle));
|
|
22
|
-
}
|
|
16
|
+
{}
|
|
23
17
|
|
|
24
18
|
query_continuous::~query_continuous()
|
|
25
19
|
{
|
|
@@ -27,6 +21,15 @@ query_continuous::~query_continuous()
|
|
|
27
21
|
release_results();
|
|
28
22
|
}
|
|
29
23
|
|
|
24
|
+
void query_continuous::run(qdb_query_continuous_mode_type_t mode,
|
|
25
|
+
std::chrono::milliseconds pace,
|
|
26
|
+
const std::string & query_string)
|
|
27
|
+
{
|
|
28
|
+
qdb::qdb_throw_if_error(
|
|
29
|
+
*_handle, qdb_query_continuous(*_handle, query_string.c_str(), mode,
|
|
30
|
+
static_cast<unsigned>(pace.count()), _callback, this, &_cont_handle));
|
|
31
|
+
}
|
|
32
|
+
|
|
30
33
|
void query_continuous::release_results()
|
|
31
34
|
{
|
|
32
35
|
if (_results)
|
|
@@ -48,6 +51,7 @@ int query_continuous::continuous_callback(void * p, qdb_error_t err, const qdb_q
|
|
|
48
51
|
{
|
|
49
52
|
auto pthis = static_cast<query_continuous *>(p);
|
|
50
53
|
|
|
54
|
+
try
|
|
51
55
|
{
|
|
52
56
|
std::unique_lock<std::mutex> lock{pthis->_results_mutex};
|
|
53
57
|
|
|
@@ -56,8 +60,8 @@ int query_continuous::continuous_callback(void * p, qdb_error_t err, const qdb_q
|
|
|
56
60
|
pthis->_last_error = err;
|
|
57
61
|
if (QDB_FAILURE(pthis->_last_error))
|
|
58
62
|
{
|
|
59
|
-
// signal the error, if processing end, we will get a qdb_e_interrupted which is handled
|
|
60
|
-
// the results function
|
|
63
|
+
// signal the error, if processing end, we will get a qdb_e_interrupted which is handled
|
|
64
|
+
// in the results function
|
|
61
65
|
lock.unlock();
|
|
62
66
|
pthis->_results_cond.notify_all();
|
|
63
67
|
return 0;
|
|
@@ -75,6 +79,19 @@ int query_continuous::continuous_callback(void * p, qdb_error_t err, const qdb_q
|
|
|
75
79
|
pthis->release_results();
|
|
76
80
|
}
|
|
77
81
|
}
|
|
82
|
+
catch (std::system_error const & e)
|
|
83
|
+
{
|
|
84
|
+
// Nothing we can do really, this is most likely a "deadlock avoided" issue.
|
|
85
|
+
std::cerr << "Internal error: unexpected exception caught in continuous query callback: "
|
|
86
|
+
"system_error: "
|
|
87
|
+
<< e.what() << std::endl;
|
|
88
|
+
}
|
|
89
|
+
catch (std::exception const & e)
|
|
90
|
+
{
|
|
91
|
+
// Nothing we can do really, this is most likely a "deadlock avoided" issue.
|
|
92
|
+
std::cerr << "Internal error: unexpected exception caught in continuous query callback: "
|
|
93
|
+
<< e.what() << std::endl;
|
|
94
|
+
}
|
|
78
95
|
|
|
79
96
|
pthis->_results_cond.notify_all();
|
|
80
97
|
|
|
@@ -101,40 +118,73 @@ dict_query_result_t query_continuous::unsafe_results()
|
|
|
101
118
|
|
|
102
119
|
dict_query_result_t query_continuous::results()
|
|
103
120
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// you need an additional mechanism to check if you need to do something with the results
|
|
107
|
-
// because condition variables can have spurious calls
|
|
108
|
-
while (_watermark == _previous_watermark)
|
|
121
|
+
try
|
|
109
122
|
{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
//
|
|
113
|
-
|
|
123
|
+
std::unique_lock<std::mutex> lock{_results_mutex};
|
|
124
|
+
|
|
125
|
+
// you need an additional mechanism to check if you need to do something with the results
|
|
126
|
+
// because condition variables can have spurious calls
|
|
127
|
+
while (_watermark == _previous_watermark)
|
|
114
128
|
{
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
if
|
|
129
|
+
// entering the condition variables releases the mutex
|
|
130
|
+
// the callback can update the values when needed
|
|
131
|
+
// every second we are going to check if the user didn't do CTRL-C
|
|
132
|
+
if (_results_cond.wait_for(lock, std::chrono::seconds{1}) == std::cv_status::timeout)
|
|
133
|
+
{
|
|
134
|
+
// if we don't do this, it will be impossible to interrupt the Python program while
|
|
135
|
+
// we wait for results
|
|
136
|
+
if (PyErr_CheckSignals() != 0)
|
|
137
|
+
{
|
|
138
|
+
throw py::error_already_set();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
118
141
|
}
|
|
119
|
-
}
|
|
120
142
|
|
|
121
|
-
|
|
143
|
+
return unsafe_results();
|
|
144
|
+
}
|
|
145
|
+
catch (std::system_error const & e)
|
|
146
|
+
{
|
|
147
|
+
_logger.warn("continuous query caught system error, e.what(): %s", e.what());
|
|
148
|
+
_logger.warn("continuous query caught system error, e.code(): %d", e.code());
|
|
149
|
+
return dict_query_result_t{};
|
|
150
|
+
}
|
|
151
|
+
catch (std::exception const & e)
|
|
152
|
+
{
|
|
153
|
+
_logger.warn(
|
|
154
|
+
"Internal error: unexpected exception caught while gathering results: %s", e.what());
|
|
155
|
+
return dict_query_result_t{};
|
|
156
|
+
}
|
|
122
157
|
}
|
|
123
158
|
|
|
124
159
|
// the difference with the call above is that we're returning immediately if there's no change
|
|
125
160
|
dict_query_result_t query_continuous::probe_results()
|
|
126
161
|
{
|
|
127
|
-
|
|
162
|
+
try
|
|
163
|
+
{
|
|
164
|
+
std::unique_lock<std::mutex> lock{_results_mutex};
|
|
128
165
|
|
|
129
|
-
|
|
130
|
-
|
|
166
|
+
// check if there's a new value
|
|
167
|
+
if (_watermark == _previous_watermark)
|
|
168
|
+
{
|
|
169
|
+
// nope return empty, don't wait, don't acquire the condition variable
|
|
170
|
+
return dict_query_result_t{};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// yes, return the value
|
|
174
|
+
return unsafe_results();
|
|
175
|
+
}
|
|
176
|
+
catch (std::system_error const & e)
|
|
131
177
|
{
|
|
132
|
-
|
|
178
|
+
_logger.warn("continuous query caught system error, e.what(): %s", e.what());
|
|
179
|
+
_logger.warn("continuous query caught system error, e.code(): %d", e.code());
|
|
180
|
+
return dict_query_result_t{};
|
|
181
|
+
}
|
|
182
|
+
catch (std::exception const & e)
|
|
183
|
+
{
|
|
184
|
+
_logger.warn(
|
|
185
|
+
"Internal error: unexpected exception caught while gathering results: %s", e.what());
|
|
133
186
|
return dict_query_result_t{};
|
|
134
187
|
}
|
|
135
|
-
|
|
136
|
-
// yes, return the value
|
|
137
|
-
return unsafe_results();
|
|
138
188
|
}
|
|
139
189
|
|
|
140
190
|
void query_continuous::stop()
|
quasardb/continuous.hpp
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
#pragma once
|
|
32
32
|
|
|
33
|
+
#include "logger.hpp"
|
|
33
34
|
#include "query.hpp"
|
|
34
35
|
#include <atomic>
|
|
35
36
|
#include <condition_variable>
|
|
@@ -43,14 +44,14 @@ namespace qdb
|
|
|
43
44
|
class query_continuous : public std::enable_shared_from_this<query_continuous>
|
|
44
45
|
{
|
|
45
46
|
public:
|
|
46
|
-
query_continuous(qdb::handle_ptr h,
|
|
47
|
-
qdb_query_continuous_mode_type_t mode,
|
|
48
|
-
std::chrono::milliseconds pace,
|
|
49
|
-
const std::string & query_string,
|
|
50
|
-
const py::object & bools);
|
|
47
|
+
query_continuous(qdb::handle_ptr h, const py::object & bools);
|
|
51
48
|
query_continuous(const qdb::query_continuous & /*other*/) = delete;
|
|
52
49
|
~query_continuous();
|
|
53
50
|
|
|
51
|
+
void run(qdb_query_continuous_mode_type_t mode,
|
|
52
|
+
std::chrono::milliseconds pace,
|
|
53
|
+
const std::string & query_string);
|
|
54
|
+
|
|
54
55
|
private:
|
|
55
56
|
void release_results();
|
|
56
57
|
qdb_error_t copy_results(const qdb_query_result_t * res);
|
|
@@ -70,6 +71,8 @@ public:
|
|
|
70
71
|
void stop();
|
|
71
72
|
|
|
72
73
|
private:
|
|
74
|
+
qdb::logger _logger;
|
|
75
|
+
|
|
73
76
|
qdb::handle_ptr _handle;
|
|
74
77
|
qdb_query_cont_callback_t _callback;
|
|
75
78
|
qdb_query_cont_handle_t _cont_handle;
|
|
@@ -91,9 +94,9 @@ static inline void register_continuous(Module & m)
|
|
|
91
94
|
namespace py = pybind11;
|
|
92
95
|
|
|
93
96
|
py::class_<qdb::query_continuous, std::shared_ptr<qdb::query_continuous>>{m, "QueryContinuous"} //
|
|
94
|
-
.def(py::init<qdb::handle_ptr,
|
|
95
|
-
const std::string &,
|
|
97
|
+
.def(py::init<qdb::handle_ptr,
|
|
96
98
|
const py::object &>()) //
|
|
99
|
+
.def("run", &qdb::query_continuous::run) //
|
|
97
100
|
.def("results", &qdb::query_continuous::results) //
|
|
98
101
|
.def("probe_results", &qdb::query_continuous::probe_results) //
|
|
99
102
|
.def("stop", &qdb::query_continuous::stop) //
|
quasardb/convert/array.hpp
CHANGED
|
@@ -79,8 +79,8 @@ struct convert_array;
|
|
|
79
79
|
//
|
|
80
80
|
/////
|
|
81
81
|
template <typename From, typename To>
|
|
82
|
-
requires(concepts::dtype<From> && !concepts::delegate_dtype<From> && concepts::qdb_primitive<To>)
|
|
83
|
-
|
|
82
|
+
requires(concepts::dtype<From> && !concepts::delegate_dtype<From> && concepts::qdb_primitive<To>)
|
|
83
|
+
struct convert_array<From, To>
|
|
84
84
|
{
|
|
85
85
|
using value_type = typename From::value_type;
|
|
86
86
|
static constexpr value_converter<From, To> const xform_{};
|
|
@@ -105,7 +105,8 @@ requires(concepts::dtype<From> && !concepts::delegate_dtype<From> && concepts::q
|
|
|
105
105
|
//
|
|
106
106
|
/////
|
|
107
107
|
template <typename From, typename To>
|
|
108
|
-
requires(concepts::delegate_dtype<From> && concepts::qdb_primitive<To>)
|
|
108
|
+
requires(concepts::delegate_dtype<From> && concepts::qdb_primitive<To>)
|
|
109
|
+
struct convert_array<From, To>
|
|
109
110
|
{
|
|
110
111
|
// Source value_type, e.g. std::int32_t
|
|
111
112
|
using value_type = typename From::value_type;
|
|
@@ -144,7 +145,8 @@ requires(concepts::delegate_dtype<From> && concepts::qdb_primitive<To>) struct c
|
|
|
144
145
|
//
|
|
145
146
|
/////
|
|
146
147
|
template <typename From, typename To>
|
|
147
|
-
requires(concepts::qdb_primitive<From> && !concepts::delegate_dtype<To>)
|
|
148
|
+
requires(concepts::qdb_primitive<From> && !concepts::delegate_dtype<To>)
|
|
149
|
+
struct convert_array<From, To>
|
|
148
150
|
{
|
|
149
151
|
static constexpr value_converter<From, To> const xform_{};
|
|
150
152
|
|
|
@@ -168,7 +170,8 @@ requires(concepts::qdb_primitive<From> && !concepts::delegate_dtype<To>) struct
|
|
|
168
170
|
//
|
|
169
171
|
/////
|
|
170
172
|
template <typename From, typename To>
|
|
171
|
-
requires(concepts::qdb_primitive<From> && concepts::delegate_dtype<To>)
|
|
173
|
+
requires(concepts::qdb_primitive<From> && concepts::delegate_dtype<To>)
|
|
174
|
+
struct convert_array<From, To>
|
|
172
175
|
{
|
|
173
176
|
// Destination value_type, e.g. std::int32_t
|
|
174
177
|
using value_type = typename To::value_type;
|
|
@@ -252,6 +255,19 @@ static inline constexpr std::vector<To> array(py::array const & xs)
|
|
|
252
255
|
return ranges::to<std::vector>(detail::to_range<From>(xs) | detail::convert_array<From, To>{}());
|
|
253
256
|
}
|
|
254
257
|
|
|
258
|
+
// qdb -> numpy
|
|
259
|
+
template <concepts::qdb_primitive From, concepts::dtype To, ranges::input_range R>
|
|
260
|
+
requires(concepts::input_range_t<R, From>)
|
|
261
|
+
static inline py::array array(R && xs)
|
|
262
|
+
{
|
|
263
|
+
if (ranges::empty(xs)) [[unlikely]]
|
|
264
|
+
{
|
|
265
|
+
return {};
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
return detail::to_array<To>(xs | detail::convert_array<From, To>{}());
|
|
269
|
+
}
|
|
270
|
+
|
|
255
271
|
// numpy -> qdb
|
|
256
272
|
template <concepts::dtype From, concepts::qdb_primitive To>
|
|
257
273
|
static inline constexpr void masked_array(qdb::masked_array const & xs, std::vector<To> & dst)
|
|
@@ -268,7 +284,8 @@ static inline constexpr std::vector<To> masked_array(qdb::masked_array const & x
|
|
|
268
284
|
|
|
269
285
|
// qdb -> numpy
|
|
270
286
|
template <concepts::qdb_primitive From, concepts::dtype To, ranges::input_range R>
|
|
271
|
-
requires(concepts::input_range_t<R, From>)
|
|
287
|
+
requires(concepts::input_range_t<R, From>)
|
|
288
|
+
static inline qdb::masked_array masked_array(R && xs)
|
|
272
289
|
{
|
|
273
290
|
if (ranges::empty(xs)) [[unlikely]]
|
|
274
291
|
{
|
quasardb/convert/value.hpp
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include "../concepts.hpp"
|
|
34
34
|
#include "../error.hpp"
|
|
35
|
+
#include "../numpy.hpp"
|
|
35
36
|
#include "../object_tracker.hpp"
|
|
36
37
|
#include "../pytypes.hpp"
|
|
37
38
|
#include "../traits.hpp"
|
|
@@ -334,8 +335,9 @@ struct value_converter<clock_t::time_point, qdb::pydatetime>
|
|
|
334
335
|
auto micros = std::chrono::duration_cast<microseconds_t>(since_epoch);
|
|
335
336
|
|
|
336
337
|
return qdb::pydatetime::from_date_and_time(static_cast<int>(ymd.year()),
|
|
337
|
-
static_cast<unsigned>(ymd.month()), static_cast<unsigned>(ymd.day()),
|
|
338
|
-
static_cast<int>(hms.
|
|
338
|
+
static_cast<unsigned>(ymd.month()), static_cast<unsigned>(ymd.day()),
|
|
339
|
+
static_cast<int>(hms.hours().count()), static_cast<int>(hms.minutes().count()),
|
|
340
|
+
static_cast<int>(hms.seconds().count()), static_cast<int>(micros.count()));
|
|
339
341
|
}
|
|
340
342
|
};
|
|
341
343
|
|
|
@@ -378,6 +380,23 @@ struct value_converter<qdb::pydatetime, qdb_timespec_t>
|
|
|
378
380
|
}
|
|
379
381
|
};
|
|
380
382
|
|
|
383
|
+
/**
|
|
384
|
+
* Creates a numpy datetime64[ns] out of a nanosecond-precision int64
|
|
385
|
+
*/
|
|
386
|
+
template <>
|
|
387
|
+
struct value_converter<std::int64_t, qdb::numpy::datetime64>
|
|
388
|
+
{
|
|
389
|
+
inline qdb::numpy::datetime64 operator()(std::int64_t const & x) const
|
|
390
|
+
{
|
|
391
|
+
return qdb::numpy::datetime64{x};
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Creates a nanosecond precision int64 out of a qdb_timespec_t. The resulting
|
|
397
|
+
* integer represents the amount of nanoseconds since epoch, which is the
|
|
398
|
+
* same representation numpy uses internally.
|
|
399
|
+
*/
|
|
381
400
|
template <>
|
|
382
401
|
struct value_converter<qdb_timespec_t, std::int64_t>
|
|
383
402
|
{
|
|
@@ -388,6 +407,21 @@ struct value_converter<qdb_timespec_t, std::int64_t>
|
|
|
388
407
|
}
|
|
389
408
|
};
|
|
390
409
|
|
|
410
|
+
/**
|
|
411
|
+
* Convenience wrapper which directly converts timespecs to numpy datetime64
|
|
412
|
+
*/
|
|
413
|
+
template <>
|
|
414
|
+
struct value_converter<qdb_timespec_t, qdb::numpy::datetime64>
|
|
415
|
+
{
|
|
416
|
+
value_converter<std::int64_t, qdb::numpy::datetime64> int64_to_datetime64_{};
|
|
417
|
+
value_converter<qdb_timespec_t, std::int64_t> ts_to_int64_{};
|
|
418
|
+
|
|
419
|
+
inline qdb::numpy::datetime64 operator()(qdb_timespec_t const & x) const
|
|
420
|
+
{
|
|
421
|
+
return int64_to_datetime64_(ts_to_int64_(x));
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
|
|
391
425
|
template <>
|
|
392
426
|
struct value_converter<qdb_timespec_t, traits::datetime64_ns_dtype>
|
|
393
427
|
: public value_converter<qdb_timespec_t, std::int64_t>
|
|
@@ -419,12 +453,38 @@ struct value_converter<traits::bytestring_dtype, qdb_string_t>
|
|
|
419
453
|
requires(ranges::sized_range<R> && ranges::contiguous_range<R>)
|
|
420
454
|
inline qdb_string_t operator()(R && x) const
|
|
421
455
|
{
|
|
422
|
-
std::size_t
|
|
423
|
-
|
|
424
|
-
char_t *
|
|
456
|
+
std::size_t n_chars = ranges::size(x);
|
|
457
|
+
std::size_t n_bytes = (n_chars + 1) * sizeof(char_t);
|
|
458
|
+
char_t const * x_ = ranges::data(x);
|
|
459
|
+
char_t * tmp = qdb::object_tracker::alloc<char_t>(n_bytes);
|
|
460
|
+
|
|
461
|
+
std::memcpy((void *)(tmp), x_, n_bytes);
|
|
425
462
|
|
|
426
|
-
|
|
427
|
-
|
|
463
|
+
// For safety purposes, always null-terminate the output string.
|
|
464
|
+
tmp[n_chars] = '\0';
|
|
465
|
+
assert(tmp[n_chars] == '\0');
|
|
466
|
+
|
|
467
|
+
return qdb_string_t{tmp, n_chars};
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
template <>
|
|
472
|
+
struct value_converter<std::string, qdb_string_t>
|
|
473
|
+
{
|
|
474
|
+
value_converter<traits::bytestring_dtype, qdb_string_t> delegate_{};
|
|
475
|
+
|
|
476
|
+
inline qdb_string_t operator()(std::string const & x) const
|
|
477
|
+
{
|
|
478
|
+
return delegate_(x);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
template <>
|
|
483
|
+
struct value_converter<qdb_string_t, std::string>
|
|
484
|
+
{
|
|
485
|
+
inline std::string operator()(qdb_string_t const & x) const
|
|
486
|
+
{
|
|
487
|
+
return {x.data, x.length};
|
|
428
488
|
}
|
|
429
489
|
};
|
|
430
490
|
|
|
@@ -600,6 +660,17 @@ struct value_converter<qdb_string_t, traits::unicode_dtype>
|
|
|
600
660
|
}
|
|
601
661
|
};
|
|
602
662
|
|
|
663
|
+
template <>
|
|
664
|
+
struct value_converter<qdb_ts_range_t, py::tuple>
|
|
665
|
+
{
|
|
666
|
+
value_converter<qdb_timespec_t, qdb::numpy::datetime64> delegate_{};
|
|
667
|
+
|
|
668
|
+
inline py::tuple operator()(qdb_ts_range_t const & x) const
|
|
669
|
+
{
|
|
670
|
+
return py::make_tuple(delegate_(x.begin), delegate_(x.end));
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
|
|
603
674
|
template <>
|
|
604
675
|
struct value_converter<py::object, qdb_blob_t>
|
|
605
676
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# CMAKE generated file: DO NOT EDIT!
|
|
2
|
-
# Generated by "Unix Makefiles" Generator, CMake Version 3.
|
|
2
|
+
# Generated by "Unix Makefiles" Generator, CMake Version 3.29
|
|
3
3
|
|
|
4
4
|
# Relative path conversion top directories.
|
|
5
5
|
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/thirdparty")
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
|
4
4
|
message(FATAL_ERROR "CMake >= 2.8.0 required")
|
|
5
5
|
endif()
|
|
6
|
-
if(CMAKE_VERSION VERSION_LESS "
|
|
7
|
-
message(FATAL_ERROR "CMake >=
|
|
6
|
+
if(CMAKE_VERSION VERSION_LESS "3.1.0")
|
|
7
|
+
message(FATAL_ERROR "CMake >= 3.1.0 required")
|
|
8
8
|
endif()
|
|
9
9
|
cmake_policy(PUSH)
|
|
10
|
-
cmake_policy(VERSION
|
|
10
|
+
cmake_policy(VERSION 3.1.0...3.27)
|
|
11
11
|
#----------------------------------------------------------------
|
|
12
12
|
# Generated CMake target import file.
|
|
13
13
|
#----------------------------------------------------------------
|
|
@@ -64,10 +64,6 @@ set_target_properties(date::date PROPERTIES
|
|
|
64
64
|
INTERFACE_SOURCES "${_IMPORT_PREFIX}/include/date/date.h"
|
|
65
65
|
)
|
|
66
66
|
|
|
67
|
-
if(CMAKE_VERSION VERSION_LESS 3.1.0)
|
|
68
|
-
message(FATAL_ERROR "This file relies on consumers using CMake 3.1.0 or greater.")
|
|
69
|
-
endif()
|
|
70
|
-
|
|
71
67
|
# Load information for each installed configuration.
|
|
72
68
|
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/dateTargets-*.cmake")
|
|
73
69
|
foreach(_cmake_config_file IN LISTS _cmake_config_files)
|
|
@@ -81,9 +77,12 @@ set(_IMPORT_PREFIX)
|
|
|
81
77
|
|
|
82
78
|
# Loop over all imported files and verify that they actually exist
|
|
83
79
|
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
if(CMAKE_VERSION VERSION_LESS "3.28"
|
|
81
|
+
OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
|
|
82
|
+
OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
|
|
83
|
+
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
|
|
84
|
+
if(NOT EXISTS "${_cmake_file}")
|
|
85
|
+
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
|
|
87
86
|
\"${_cmake_file}\"
|
|
88
87
|
but this file does not exist. Possible reasons include:
|
|
89
88
|
* The file was deleted, renamed, or moved to another location.
|
|
@@ -92,8 +91,9 @@ but this file does not exist. Possible reasons include:
|
|
|
92
91
|
\"${CMAKE_CURRENT_LIST_FILE}\"
|
|
93
92
|
but not all the files it references.
|
|
94
93
|
")
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
endif()
|
|
95
|
+
endforeach()
|
|
96
|
+
endif()
|
|
97
97
|
unset(_cmake_file)
|
|
98
98
|
unset("_cmake_import_check_files_for_${_cmake_target}")
|
|
99
99
|
endforeach()
|
quasardb/date/Makefile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# CMAKE generated file: DO NOT EDIT!
|
|
2
|
-
# Generated by "Unix Makefiles" Generator, CMake Version 3.
|
|
2
|
+
# Generated by "Unix Makefiles" Generator, CMake Version 3.29
|
|
3
3
|
|
|
4
4
|
# Default target executed when no arguments are given to make.
|
|
5
5
|
default_target: all
|
|
@@ -67,7 +67,7 @@ CMAKE_BINARY_DIR = /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.m
|
|
|
67
67
|
|
|
68
68
|
# Special rule for the target edit_cache
|
|
69
69
|
edit_cache:
|
|
70
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
|
|
70
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
|
|
71
71
|
/opt/local/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
|
72
72
|
.PHONY : edit_cache
|
|
73
73
|
|
|
@@ -77,7 +77,7 @@ edit_cache/fast: edit_cache
|
|
|
77
77
|
|
|
78
78
|
# Special rule for the target rebuild_cache
|
|
79
79
|
rebuild_cache:
|
|
80
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
|
80
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
|
|
81
81
|
/opt/local/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
|
82
82
|
.PHONY : rebuild_cache
|
|
83
83
|
|
|
@@ -87,7 +87,7 @@ rebuild_cache/fast: rebuild_cache
|
|
|
87
87
|
|
|
88
88
|
# Special rule for the target list_install_components
|
|
89
89
|
list_install_components:
|
|
90
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
|
|
90
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Unspecified\""
|
|
91
91
|
.PHONY : list_install_components
|
|
92
92
|
|
|
93
93
|
# Special rule for the target list_install_components
|
|
@@ -96,37 +96,37 @@ list_install_components/fast: list_install_components
|
|
|
96
96
|
|
|
97
97
|
# Special rule for the target install
|
|
98
98
|
install: preinstall
|
|
99
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
|
|
99
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
|
|
100
100
|
/opt/local/bin/cmake -P cmake_install.cmake
|
|
101
101
|
.PHONY : install
|
|
102
102
|
|
|
103
103
|
# Special rule for the target install
|
|
104
104
|
install/fast: preinstall/fast
|
|
105
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
|
|
105
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
|
|
106
106
|
/opt/local/bin/cmake -P cmake_install.cmake
|
|
107
107
|
.PHONY : install/fast
|
|
108
108
|
|
|
109
109
|
# Special rule for the target install/local
|
|
110
110
|
install/local: preinstall
|
|
111
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
|
|
111
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
|
|
112
112
|
/opt/local/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
|
113
113
|
.PHONY : install/local
|
|
114
114
|
|
|
115
115
|
# Special rule for the target install/local
|
|
116
116
|
install/local/fast: preinstall/fast
|
|
117
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
|
|
117
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
|
|
118
118
|
/opt/local/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
|
119
119
|
.PHONY : install/local/fast
|
|
120
120
|
|
|
121
121
|
# Special rule for the target install/strip
|
|
122
122
|
install/strip: preinstall
|
|
123
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
|
|
123
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
|
|
124
124
|
/opt/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
|
125
125
|
.PHONY : install/strip
|
|
126
126
|
|
|
127
127
|
# Special rule for the target install/strip
|
|
128
128
|
install/strip/fast: preinstall/fast
|
|
129
|
-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
|
|
129
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
|
|
130
130
|
/opt/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
|
131
131
|
.PHONY : install/strip/fast
|
|
132
132
|
|
|
@@ -52,7 +52,14 @@ else()
|
|
|
52
52
|
endif()
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
# if the installed
|
|
56
|
-
if("
|
|
55
|
+
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
|
56
|
+
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
|
57
57
|
return()
|
|
58
58
|
endif()
|
|
59
|
+
|
|
60
|
+
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
|
61
|
+
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
|
62
|
+
math(EXPR installedBits "8 * 8")
|
|
63
|
+
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
|
64
|
+
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
|
65
|
+
endif()
|
quasardb/date/dateTargets.cmake
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
|
4
4
|
message(FATAL_ERROR "CMake >= 2.8.0 required")
|
|
5
5
|
endif()
|
|
6
|
-
if(CMAKE_VERSION VERSION_LESS "
|
|
7
|
-
message(FATAL_ERROR "CMake >=
|
|
6
|
+
if(CMAKE_VERSION VERSION_LESS "3.0.0")
|
|
7
|
+
message(FATAL_ERROR "CMake >= 3.0.0 required")
|
|
8
8
|
endif()
|
|
9
9
|
cmake_policy(PUSH)
|
|
10
|
-
cmake_policy(VERSION
|
|
10
|
+
cmake_policy(VERSION 3.0.0...3.27)
|
|
11
11
|
#----------------------------------------------------------------
|
|
12
12
|
# Generated CMake target import file.
|
|
13
13
|
#----------------------------------------------------------------
|
|
@@ -15,10 +15,6 @@ cmake_policy(VERSION 2.8.3...3.22)
|
|
|
15
15
|
# Commands may need to know the format version.
|
|
16
16
|
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
17
17
|
|
|
18
|
-
if(CMAKE_VERSION VERSION_LESS 3.0.0)
|
|
19
|
-
message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")
|
|
20
|
-
endif()
|
|
21
|
-
|
|
22
18
|
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
|
23
19
|
set(_cmake_targets_defined "")
|
|
24
20
|
set(_cmake_targets_not_defined "")
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#include "retry.hpp"
|
|
2
|
+
#include <pybind11/chrono.h>
|
|
3
|
+
|
|
4
|
+
namespace qdb::detail
|
|
5
|
+
{
|
|
6
|
+
|
|
7
|
+
void register_retry_options(py::module_ & m)
|
|
8
|
+
{
|
|
9
|
+
namespace py = pybind11;
|
|
10
|
+
|
|
11
|
+
py::class_<retry_options>{m, "RetryOptions"} //
|
|
12
|
+
.def(py::init<std::size_t, std::chrono::milliseconds, std::size_t, double>(), //
|
|
13
|
+
py::arg("retries") = std::size_t{3}, //
|
|
14
|
+
py::kw_only(), //
|
|
15
|
+
py::arg("delay") = std::chrono::milliseconds{3000}, //
|
|
16
|
+
py::arg("exponent") = std::size_t{2}, //
|
|
17
|
+
py::arg("jitter") = double{0.1} //
|
|
18
|
+
) //
|
|
19
|
+
//
|
|
20
|
+
.def_readwrite("retries_left", &retry_options::retries_left) //
|
|
21
|
+
.def_readwrite("delay", &retry_options::delay) //
|
|
22
|
+
.def_readwrite("exponent", &retry_options::exponent) //
|
|
23
|
+
.def_readwrite("jitter", &retry_options::jitter) //
|
|
24
|
+
//
|
|
25
|
+
.def("has_next", &retry_options::has_next) //
|
|
26
|
+
.def("next", &retry_options::next) //
|
|
27
|
+
;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}; // namespace qdb::detail
|