quasardb 3.14.2.dev0__cp37-cp37m-win_amd64.whl → 3.14.2.dev2__cp37-cp37m-win_amd64.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/CMakeLists.txt +30 -13
- quasardb/INSTALL.vcxproj +4 -0
- 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/ALL_BUILD.vcxproj +4 -4
- quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake +12 -12
- quasardb/date/CMakeFiles/generate.stamp.depend +4 -4
- quasardb/date/INSTALL.vcxproj +4 -0
- quasardb/date/dateConfigVersion.cmake +0 -5
- 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/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/ALL_BUILD.vcxproj +4 -4
- quasardb/pybind11/CMakeFiles/generate.stamp.depend +14 -14
- quasardb/pybind11/INSTALL.vcxproj +4 -0
- quasardb/qdb_api.dll +0 -0
- quasardb/quasardb.cp37-win_amd64.pyd +0 -0
- quasardb/range-v3/ALL_BUILD.vcxproj +4 -4
- quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +12 -12
- quasardb/range-v3/CMakeFiles/generate.stamp.depend +11 -11
- quasardb/range-v3/INSTALL.vcxproj +4 -0
- quasardb/range-v3/cmake_install.cmake +36 -0
- quasardb/range-v3/range-v3-config-version.cmake +0 -5
- quasardb/range-v3/range-v3-config.cmake +3 -7
- quasardb/range-v3/range.v3.headers.vcxproj +4 -4
- 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 +6 -6
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev2.dist-info}/RECORD +55 -49
- {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
|
{
|
quasardb/date/ALL_BUILD.vcxproj
CHANGED
|
@@ -120,7 +120,7 @@ endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
|
|
|
120
120
|
exit /b %1
|
|
121
121
|
:cmDone
|
|
122
122
|
if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
123
|
-
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\Program Files\CMake\share\cmake-3.
|
|
123
|
+
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\Program Files\CMake\share\cmake-3.30\Modules\BasicConfigVersion-SameMajorVersion.cmake.in;C:\Program Files\CMake\share\cmake-3.30\Modules\CMakePackageConfigHelpers.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\GNUInstallDirs.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\WriteBasicConfigVersionFile.cmake;%(AdditionalInputs)</AdditionalInputs>
|
|
124
124
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\generate.stamp</Outputs>
|
|
125
125
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
|
|
126
126
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Building Custom Rule C:/TeamCity/work/938b0bdf6727d1ad/thirdparty/date/CMakeLists.txt</Message>
|
|
@@ -133,7 +133,7 @@ endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
|
|
|
133
133
|
exit /b %1
|
|
134
134
|
:cmDone
|
|
135
135
|
if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
136
|
-
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Program Files\CMake\share\cmake-3.
|
|
136
|
+
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Program Files\CMake\share\cmake-3.30\Modules\BasicConfigVersion-SameMajorVersion.cmake.in;C:\Program Files\CMake\share\cmake-3.30\Modules\CMakePackageConfigHelpers.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\GNUInstallDirs.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\WriteBasicConfigVersionFile.cmake;%(AdditionalInputs)</AdditionalInputs>
|
|
137
137
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\generate.stamp</Outputs>
|
|
138
138
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
|
|
139
139
|
<Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Building Custom Rule C:/TeamCity/work/938b0bdf6727d1ad/thirdparty/date/CMakeLists.txt</Message>
|
|
@@ -146,7 +146,7 @@ endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
|
|
|
146
146
|
exit /b %1
|
|
147
147
|
:cmDone
|
|
148
148
|
if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
149
|
-
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\Program Files\CMake\share\cmake-3.
|
|
149
|
+
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\Program Files\CMake\share\cmake-3.30\Modules\BasicConfigVersion-SameMajorVersion.cmake.in;C:\Program Files\CMake\share\cmake-3.30\Modules\CMakePackageConfigHelpers.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\GNUInstallDirs.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\WriteBasicConfigVersionFile.cmake;%(AdditionalInputs)</AdditionalInputs>
|
|
150
150
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\generate.stamp</Outputs>
|
|
151
151
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
|
|
152
152
|
<Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Building Custom Rule C:/TeamCity/work/938b0bdf6727d1ad/thirdparty/date/CMakeLists.txt</Message>
|
|
@@ -159,7 +159,7 @@ endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
|
|
|
159
159
|
exit /b %1
|
|
160
160
|
:cmDone
|
|
161
161
|
if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
162
|
-
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">C:\Program Files\CMake\share\cmake-3.
|
|
162
|
+
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">C:\Program Files\CMake\share\cmake-3.30\Modules\BasicConfigVersion-SameMajorVersion.cmake.in;C:\Program Files\CMake\share\cmake-3.30\Modules\CMakePackageConfigHelpers.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\GNUInstallDirs.cmake;C:\Program Files\CMake\share\cmake-3.30\Modules\WriteBasicConfigVersionFile.cmake;%(AdditionalInputs)</AdditionalInputs>
|
|
163
163
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\generate.stamp</Outputs>
|
|
164
164
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
|
|
165
165
|
</CustomBuild>
|
|
@@ -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.28)
|
|
11
11
|
#----------------------------------------------------------------
|
|
12
12
|
# Generated CMake target import file.
|
|
13
13
|
#----------------------------------------------------------------
|
|
@@ -62,10 +62,6 @@ set_target_properties(date::date PROPERTIES
|
|
|
62
62
|
INTERFACE_SOURCES "${_IMPORT_PREFIX}/include/date/date.h"
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
-
if(CMAKE_VERSION VERSION_LESS 3.1.0)
|
|
66
|
-
message(FATAL_ERROR "This file relies on consumers using CMake 3.1.0 or greater.")
|
|
67
|
-
endif()
|
|
68
|
-
|
|
69
65
|
# Load information for each installed configuration.
|
|
70
66
|
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/dateTargets-*.cmake")
|
|
71
67
|
foreach(_cmake_config_file IN LISTS _cmake_config_files)
|
|
@@ -79,9 +75,12 @@ set(_IMPORT_PREFIX)
|
|
|
79
75
|
|
|
80
76
|
# Loop over all imported files and verify that they actually exist
|
|
81
77
|
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
if(CMAKE_VERSION VERSION_LESS "3.28"
|
|
79
|
+
OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
|
|
80
|
+
OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
|
|
81
|
+
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
|
|
82
|
+
if(NOT EXISTS "${_cmake_file}")
|
|
83
|
+
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
|
|
85
84
|
\"${_cmake_file}\"
|
|
86
85
|
but this file does not exist. Possible reasons include:
|
|
87
86
|
* The file was deleted, renamed, or moved to another location.
|
|
@@ -90,8 +89,9 @@ but this file does not exist. Possible reasons include:
|
|
|
90
89
|
\"${CMAKE_CURRENT_LIST_FILE}\"
|
|
91
90
|
but not all the files it references.
|
|
92
91
|
")
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
endif()
|
|
93
|
+
endforeach()
|
|
94
|
+
endif()
|
|
95
95
|
unset(_cmake_file)
|
|
96
96
|
unset("_cmake_import_check_files_for_${_cmake_target}")
|
|
97
97
|
endforeach()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CMake generation dependency list for this directory.
|
|
2
|
-
C:/Program Files/CMake/share/cmake-3.
|
|
3
|
-
C:/Program Files/CMake/share/cmake-3.
|
|
4
|
-
C:/Program Files/CMake/share/cmake-3.
|
|
5
|
-
C:/Program Files/CMake/share/cmake-3.
|
|
2
|
+
C:/Program Files/CMake/share/cmake-3.30/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
|
|
3
|
+
C:/Program Files/CMake/share/cmake-3.30/Modules/CMakePackageConfigHelpers.cmake
|
|
4
|
+
C:/Program Files/CMake/share/cmake-3.30/Modules/GNUInstallDirs.cmake
|
|
5
|
+
C:/Program Files/CMake/share/cmake-3.30/Modules/WriteBasicConfigVersionFile.cmake
|
|
6
6
|
C:/TeamCity/work/938b0bdf6727d1ad/thirdparty/date/CMakeLists.txt
|
quasardb/date/INSTALL.vcxproj
CHANGED
|
@@ -126,6 +126,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
|
126
126
|
</ItemDefinitionGroup>
|
|
127
127
|
<ItemGroup>
|
|
128
128
|
<CustomBuild Include="C:\TeamCity\work\938b0bdf6727d1ad\build\temp.win-amd64-cpython-37\Release\CMakeFiles\f67c48e17cb5e5058bf3ae9fdd3d9af6\INSTALL_force.rule">
|
|
129
|
+
<BuildInParallel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BuildInParallel>
|
|
129
130
|
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> </Message>
|
|
130
131
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
|
|
131
132
|
cd .
|
|
@@ -140,6 +141,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
|
140
141
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\INSTALL_force</Outputs>
|
|
141
142
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
|
|
142
143
|
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</VerifyInputsAndOutputsExist>
|
|
144
|
+
<BuildInParallel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</BuildInParallel>
|
|
143
145
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> </Message>
|
|
144
146
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">setlocal
|
|
145
147
|
cd .
|
|
@@ -154,6 +156,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
|
154
156
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\INSTALL_force</Outputs>
|
|
155
157
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
|
|
156
158
|
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</VerifyInputsAndOutputsExist>
|
|
159
|
+
<BuildInParallel Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">true</BuildInParallel>
|
|
157
160
|
<Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'"> </Message>
|
|
158
161
|
<Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">setlocal
|
|
159
162
|
cd .
|
|
@@ -168,6 +171,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
|
|
|
168
171
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\TeamCity\work\938b0bdf6727d1ad\build\lib.win-amd64-cpython-37\quasardb\date\CMakeFiles\INSTALL_force</Outputs>
|
|
169
172
|
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
|
|
170
173
|
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</VerifyInputsAndOutputsExist>
|
|
174
|
+
<BuildInParallel Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</BuildInParallel>
|
|
171
175
|
<Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'"> </Message>
|
|
172
176
|
<Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">setlocal
|
|
173
177
|
cd .
|
|
@@ -52,11 +52,6 @@ else()
|
|
|
52
52
|
endif()
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
# if the installed project requested no architecture check, don't perform the check
|
|
56
|
-
if("FALSE")
|
|
57
|
-
return()
|
|
58
|
-
endif()
|
|
59
|
-
|
|
60
55
|
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
|
61
56
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
|
62
57
|
return()
|
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.28)
|
|
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
|