quasardb 3.14.2.dev0__cp310-cp310-win_amd64.whl → 3.14.2.dev4__cp310-cp310-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/INSTALL.vcxproj +9 -4
- quasardb/__init__.py +33 -4
- quasardb/cmake_install.cmake +6 -0
- quasardb/date/ALL_BUILD.vcxproj +9 -8
- quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake +13 -13
- quasardb/date/CMakeFiles/generate.stamp.depend +4 -4
- quasardb/date/INSTALL.vcxproj +9 -4
- quasardb/date/cmake_install.cmake +6 -0
- quasardb/date/dateConfigVersion.cmake +0 -5
- quasardb/date/dateTargets.cmake +4 -8
- quasardb/numpy/__init__.py +58 -10
- quasardb/pandas/__init__.py +58 -102
- quasardb/pybind11/ALL_BUILD.vcxproj +9 -8
- quasardb/pybind11/CMakeFiles/generate.stamp.depend +14 -14
- quasardb/pybind11/INSTALL.vcxproj +9 -4
- quasardb/pybind11/cmake_install.cmake +6 -0
- quasardb/qdb_api.dll +0 -0
- quasardb/quasardb.cp310-win_amd64.pyd +0 -0
- quasardb/range-v3/ALL_BUILD.vcxproj +9 -8
- quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +13 -13
- quasardb/range-v3/CMakeFiles/generate.stamp.depend +11 -11
- quasardb/range-v3/INSTALL.vcxproj +9 -4
- quasardb/range-v3/cmake_install.cmake +42 -0
- quasardb/range-v3/range-v3-config-version.cmake +0 -5
- quasardb/range-v3/range-v3-config.cmake +4 -8
- quasardb/range-v3/range.v3.headers.vcxproj +9 -8
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/METADATA +15 -10
- quasardb-3.14.2.dev4.dist-info/RECORD +54 -0
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/WHEEL +1 -1
- quasardb/CMakeLists.txt +0 -500
- quasardb/batch_column.hpp +0 -80
- quasardb/batch_inserter.hpp +0 -248
- quasardb/blob.hpp +0 -150
- quasardb/cluster.cpp +0 -89
- quasardb/cluster.hpp +0 -551
- quasardb/concepts.hpp +0 -278
- quasardb/continuous.cpp +0 -149
- quasardb/continuous.hpp +0 -106
- quasardb/convert/array.hpp +0 -282
- quasardb/convert/point.hpp +0 -330
- quasardb/convert/range.hpp +0 -282
- quasardb/convert/unicode.hpp +0 -598
- quasardb/convert/util.hpp +0 -22
- quasardb/convert/value.hpp +0 -711
- quasardb/convert.hpp +0 -38
- quasardb/detail/qdb_resource.hpp +0 -129
- quasardb/detail/ts_column.hpp +0 -224
- quasardb/direct_blob.hpp +0 -108
- quasardb/direct_handle.hpp +0 -83
- quasardb/direct_integer.hpp +0 -94
- quasardb/dispatch.hpp +0 -157
- quasardb/double.hpp +0 -87
- quasardb/entry.hpp +0 -273
- quasardb/error.hpp +0 -318
- quasardb/handle.cpp +0 -29
- quasardb/handle.hpp +0 -98
- quasardb/integer.hpp +0 -88
- quasardb/logger.cpp +0 -106
- quasardb/logger.hpp +0 -228
- quasardb/masked_array.hpp +0 -651
- quasardb/metrics.cpp +0 -103
- quasardb/metrics.hpp +0 -112
- quasardb/module.cpp +0 -76
- quasardb/module.hpp +0 -24
- quasardb/node.hpp +0 -123
- quasardb/numpy.cpp +0 -6
- quasardb/numpy.hpp +0 -489
- quasardb/object_tracker.hpp +0 -283
- quasardb/options.hpp +0 -244
- quasardb/perf.hpp +0 -336
- quasardb/pytypes.hpp +0 -221
- quasardb/query.cpp +0 -420
- quasardb/query.hpp +0 -92
- quasardb/reader/ts_row.hpp +0 -281
- quasardb/reader/ts_value.hpp +0 -245
- quasardb/remove_cvref.hpp +0 -31
- quasardb/string.hpp +0 -160
- quasardb/table.cpp +0 -289
- quasardb/table.hpp +0 -325
- quasardb/table_reader.hpp +0 -220
- quasardb/tag.hpp +0 -77
- quasardb/timestamp.hpp +0 -97
- quasardb/traits.hpp +0 -619
- quasardb/ts_iterator.hpp +0 -193
- quasardb/utils/blob_deque.hpp +0 -96
- quasardb/utils/ostream.hpp +0 -17
- quasardb/utils/permutation.hpp +0 -50
- quasardb/utils/stable_sort.hpp +0 -25
- quasardb/utils/unzip_view.hpp +0 -89
- quasardb/utils.cpp +0 -28
- quasardb/utils.hpp +0 -174
- quasardb/writer.cpp +0 -534
- quasardb/writer.hpp +0 -396
- quasardb-3.14.2.dev0.dist-info/RECORD +0 -118
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/LICENSE.md +0 -0
- {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/top_level.txt +0 -0
quasardb/logger.hpp
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* Official Python API
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
|
|
6
|
-
* All rights reserved.
|
|
7
|
-
*
|
|
8
|
-
* Redistribution and use in source and binary forms, with or without
|
|
9
|
-
* modification, are permitted provided that the following conditions are met:
|
|
10
|
-
*
|
|
11
|
-
* * Redistributions of source code must retain the above copyright
|
|
12
|
-
* notice, this list of conditions and the following disclaimer.
|
|
13
|
-
* * Redistributions in binary form must reproduce the above copyright
|
|
14
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
15
|
-
* documentation and/or other materials provided with the distribution.
|
|
16
|
-
* * Neither the name of quasardb nor the names of its contributors may
|
|
17
|
-
* be used to endorse or promote products derived from this software
|
|
18
|
-
* without specific prior written permission.
|
|
19
|
-
*
|
|
20
|
-
* THIS SOFTWARE IS PROVIDED BY QUASARDB AND CONTRIBUTORS ``AS IS'' AND ANY
|
|
21
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
22
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
-
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
|
|
24
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
25
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
26
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
27
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
29
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
-
*/
|
|
31
|
-
#pragma once
|
|
32
|
-
|
|
33
|
-
#include <qdb/log.h>
|
|
34
|
-
#include <pybind11/pybind11.h>
|
|
35
|
-
#include <atomic>
|
|
36
|
-
#include <mutex>
|
|
37
|
-
|
|
38
|
-
namespace qdb
|
|
39
|
-
{
|
|
40
|
-
namespace py = pybind11;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Utility class that wraps around Python's logging module. Should *not*
|
|
44
|
-
* be used from Python directly, and as such is not registered as a Python
|
|
45
|
-
* class.
|
|
46
|
-
*
|
|
47
|
-
* Note that every log invocations calls a python function, causes a bunch
|
|
48
|
-
* of reflections, and is generally as slow as you expect it to be. This cannot
|
|
49
|
-
* be optimized.
|
|
50
|
-
*
|
|
51
|
-
* As such, try to keep this logging out of the critical performance path.
|
|
52
|
-
*/
|
|
53
|
-
class logger
|
|
54
|
-
{
|
|
55
|
-
public:
|
|
56
|
-
/**
|
|
57
|
-
* Default constructor, invoking any .debug() etc on a default initialized
|
|
58
|
-
* instantiation of this class leads to undefined behavior, but it's needed
|
|
59
|
-
* for certain situations.
|
|
60
|
-
*/
|
|
61
|
-
logger(){};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Simple logger instance, all complexity is handled in the logging handlers.
|
|
65
|
-
*/
|
|
66
|
-
logger(const std::string & module_name)
|
|
67
|
-
: _module_name(module_name)
|
|
68
|
-
{}
|
|
69
|
-
|
|
70
|
-
public:
|
|
71
|
-
/**
|
|
72
|
-
* Wraps logger.debug
|
|
73
|
-
*/
|
|
74
|
-
template <typename... Args>
|
|
75
|
-
void debug(Args &&... args) const
|
|
76
|
-
{
|
|
77
|
-
_log("debug", std::forward<Args>(args)...);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Wraps logger.info
|
|
82
|
-
*/
|
|
83
|
-
template <typename... Args>
|
|
84
|
-
void info(Args &&... args) const
|
|
85
|
-
{
|
|
86
|
-
_log("info", std::forward<Args>(args)...);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Wraps logger.warn
|
|
91
|
-
*/
|
|
92
|
-
template <typename... Args>
|
|
93
|
-
void warn(Args &&... args) const
|
|
94
|
-
{
|
|
95
|
-
_log("warning", std::forward<Args>(args)...);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Wraps logger.error
|
|
100
|
-
*/
|
|
101
|
-
template <typename... Args>
|
|
102
|
-
void error(Args &&... args) const
|
|
103
|
-
{
|
|
104
|
-
_log("error", std::forward<Args>(args)...);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Wraps logger.critical
|
|
109
|
-
*/
|
|
110
|
-
template <typename... Args>
|
|
111
|
-
void critical(Args &&... args) const
|
|
112
|
-
{
|
|
113
|
-
_log("critical", std::forward<Args>(args)...);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
private:
|
|
117
|
-
template <typename... Args>
|
|
118
|
-
void _log(Args &&... args) const
|
|
119
|
-
{
|
|
120
|
-
_do_log(_module_name, std::forward<Args>(args)...);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
template <typename... Args>
|
|
124
|
-
static void _do_log(
|
|
125
|
-
std::string const & module_name, char const * level, const std::string & msg, Args &&... args)
|
|
126
|
-
{
|
|
127
|
-
/**
|
|
128
|
-
* Calls Python imports, functions, etc, reflection kicks in, relatively slow.
|
|
129
|
-
*
|
|
130
|
-
* BUGFIX(leon) 2021-02-08
|
|
131
|
-
*
|
|
132
|
-
* We were observing crashes upon process exit, which were related to persistent
|
|
133
|
-
* references to this logger being kept in logger.cpp. We got a double-free, due
|
|
134
|
-
* to an incorrect reference count being observed.
|
|
135
|
-
*
|
|
136
|
-
* We now do all the reflection / lookups inside this function, which causes
|
|
137
|
-
* a performance degradation, but makes reasoning over object ownership /
|
|
138
|
-
* lifecycle much easier, thus no more double-free reference-counted issues.
|
|
139
|
-
*
|
|
140
|
-
* A future improvement would be to figure out how to properly deal with
|
|
141
|
-
* Python's reference counting + persistent object ownership, possibly by
|
|
142
|
-
* installing a cleanup handler.
|
|
143
|
-
*/
|
|
144
|
-
py::module logging = py::module::import("logging");
|
|
145
|
-
py::object get_logger = logging.attr("getLogger");
|
|
146
|
-
py::object logger = get_logger(module_name);
|
|
147
|
-
py::object logfn = logger.attr(level);
|
|
148
|
-
|
|
149
|
-
char const * errors = NULL;
|
|
150
|
-
PyObject * buf = PyUnicode_DecodeLatin1(msg.data(), msg.size(), errors);
|
|
151
|
-
assert(buf != NULL);
|
|
152
|
-
assert(errors == NULL);
|
|
153
|
-
|
|
154
|
-
py::str buf_ = py::reinterpret_steal<py::str>(buf);
|
|
155
|
-
|
|
156
|
-
logfn(buf_, std::forward<Args>(args)...);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
private:
|
|
160
|
-
std::string _module_name;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* QuasarDB's logging handler works with callbacks, and unfortunately is fairly
|
|
165
|
-
* error prone to 'just keep exactly one callback': if there are no active
|
|
166
|
-
* sessions left, the callback is removed.
|
|
167
|
-
*
|
|
168
|
-
* As such, the only way to bridge this logging API with QuasarDB's is to:
|
|
169
|
-
*
|
|
170
|
-
* - frequently (i.e. every new connection) remove any existing callbacks and
|
|
171
|
-
* set our new callback.
|
|
172
|
-
*
|
|
173
|
-
* - when a callback is invoked, keep a local container with buffered logs.
|
|
174
|
-
*
|
|
175
|
-
* - from all other functions, basically after every native qdb call, flush all
|
|
176
|
-
* buffered logs.
|
|
177
|
-
*
|
|
178
|
-
* - unfortunately, QuasarDB also buffers the logs before triggering callbacks,
|
|
179
|
-
* so it is unlikely that relevant logs are already present here right after an
|
|
180
|
-
* error. :'(
|
|
181
|
-
*
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
|
-
namespace native
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
typedef struct
|
|
188
|
-
{
|
|
189
|
-
int year;
|
|
190
|
-
int mon;
|
|
191
|
-
int day;
|
|
192
|
-
int hour;
|
|
193
|
-
int min;
|
|
194
|
-
int sec;
|
|
195
|
-
} message_time_t;
|
|
196
|
-
|
|
197
|
-
typedef struct
|
|
198
|
-
{
|
|
199
|
-
qdb_log_level_t level;
|
|
200
|
-
message_time_t timestamp;
|
|
201
|
-
|
|
202
|
-
int pid;
|
|
203
|
-
int tid;
|
|
204
|
-
std::string message;
|
|
205
|
-
|
|
206
|
-
} message_t;
|
|
207
|
-
|
|
208
|
-
void swap_callback();
|
|
209
|
-
|
|
210
|
-
void flush();
|
|
211
|
-
|
|
212
|
-
void _callback( //
|
|
213
|
-
qdb_log_level_t log_level, // qdb log level
|
|
214
|
-
const unsigned long * date, // [years, months, day, hours, minute, seconds] (valid only in the
|
|
215
|
-
// context of the callback)
|
|
216
|
-
unsigned long pid, // process id
|
|
217
|
-
unsigned long tid, // thread id
|
|
218
|
-
const char * message_buffer, // message buffer (valid only in the context of the callback)
|
|
219
|
-
size_t message_size); // message buffer size
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Implementation function of flush(), which assumes that locks have been
|
|
223
|
-
* acquired and buffer actually contains logs.
|
|
224
|
-
*/
|
|
225
|
-
void _do_flush();
|
|
226
|
-
} // namespace native
|
|
227
|
-
|
|
228
|
-
} // namespace qdb
|