quasardb 3.14.1.dev5__cp310-cp310-macosx_10_14_x86_64.whl → 3.14.2.dev1__cp310-cp310-macosx_10_14_x86_64.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 +15 -1
- quasardb/__init__.py +1 -1
- quasardb/batch_column.hpp +1 -1
- quasardb/batch_inserter.hpp +1 -1
- quasardb/blob.hpp +1 -1
- quasardb/cluster.cpp +89 -0
- quasardb/cluster.hpp +38 -51
- quasardb/cmake_install.cmake +1 -1
- quasardb/continuous.hpp +1 -1
- quasardb/convert/array.hpp +1 -1
- quasardb/convert/point.hpp +1 -1
- quasardb/convert/range.hpp +1 -1
- quasardb/convert/value.hpp +1 -1
- quasardb/convert.hpp +1 -1
- quasardb/date/cmake_install.cmake +1 -1
- quasardb/detail/qdb_resource.hpp +11 -1
- quasardb/detail/ts_column.hpp +1 -1
- quasardb/direct_blob.hpp +1 -1
- quasardb/direct_handle.hpp +1 -1
- quasardb/direct_integer.hpp +1 -1
- quasardb/double.hpp +1 -1
- quasardb/entry.hpp +1 -1
- quasardb/error.hpp +1 -1
- quasardb/handle.cpp +29 -0
- quasardb/handle.hpp +3 -15
- quasardb/integer.hpp +1 -1
- quasardb/libqdb_api.dylib +0 -0
- quasardb/logger.cpp +3 -0
- quasardb/logger.hpp +1 -1
- quasardb/masked_array.hpp +1 -1
- quasardb/metrics.cpp +103 -0
- quasardb/metrics.hpp +112 -0
- quasardb/module.cpp +2 -0
- quasardb/node.hpp +1 -1
- quasardb/numpy.hpp +1 -1
- quasardb/options.hpp +1 -1
- quasardb/pandas/__init__.py +1 -1
- quasardb/perf.hpp +1 -1
- quasardb/pybind11/cmake_install.cmake +1 -1
- quasardb/pytypes.hpp +1 -1
- quasardb/quasardb.cpython-310-darwin.so +0 -0
- quasardb/query.cpp +14 -3
- quasardb/query.hpp +1 -1
- quasardb/range-v3/cmake_install.cmake +1 -1
- quasardb/reader/ts_row.hpp +1 -1
- quasardb/reader/ts_value.hpp +1 -1
- quasardb/string.hpp +1 -1
- quasardb/table.cpp +34 -0
- quasardb/table.hpp +64 -32
- quasardb/table_reader.hpp +1 -1
- quasardb/tag.hpp +1 -1
- quasardb/timestamp.hpp +1 -1
- quasardb/utils.hpp +1 -1
- quasardb/writer.cpp +4 -0
- quasardb/writer.hpp +1 -1
- {quasardb-3.14.1.dev5.dist-info → quasardb-3.14.2.dev1.dist-info}/LICENSE.md +1 -1
- {quasardb-3.14.1.dev5.dist-info → quasardb-3.14.2.dev1.dist-info}/METADATA +1 -1
- quasardb-3.14.2.dev1.dist-info/RECORD +109 -0
- quasardb-3.14.1.dev5.dist-info/RECORD +0 -105
- {quasardb-3.14.1.dev5.dist-info → quasardb-3.14.2.dev1.dist-info}/WHEEL +0 -0
- {quasardb-3.14.1.dev5.dist-info → quasardb-3.14.2.dev1.dist-info}/top_level.txt +0 -0
quasardb/CMakeLists.txt
CHANGED
|
@@ -2,9 +2,19 @@ cmake_minimum_required(VERSION 3.9.4)
|
|
|
2
2
|
project(quasardb)
|
|
3
3
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
|
4
4
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
|
5
|
-
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.
|
|
5
|
+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
|
|
6
6
|
set(CMAKE_VERBOSE_MAKEFILE FALSE)
|
|
7
7
|
|
|
8
|
+
if(APPLE)
|
|
9
|
+
# Robustly get the SDK path using xcrun.
|
|
10
|
+
execute_process(
|
|
11
|
+
COMMAND xcrun --sdk macosx --show-sdk-path
|
|
12
|
+
OUTPUT_VARIABLE SDK_PATH
|
|
13
|
+
COMMAND_ERROR_IS_FATAL ANY
|
|
14
|
+
)
|
|
15
|
+
string(STRIP "${SDK_PATH}" CMAKE_OSX_SYSROOT)
|
|
16
|
+
endif()
|
|
17
|
+
|
|
8
18
|
include(CheckIPOSupported)
|
|
9
19
|
|
|
10
20
|
option(QDB_LINK_STATIC_LIB "Link qdb_api_static instead of dynamic qdb_api." OFF)
|
|
@@ -325,6 +335,7 @@ set(QDB_FILES
|
|
|
325
335
|
batch_inserter.hpp
|
|
326
336
|
blob.hpp
|
|
327
337
|
cluster.hpp
|
|
338
|
+
cluster.cpp
|
|
328
339
|
concepts.hpp
|
|
329
340
|
continuous.cpp
|
|
330
341
|
continuous.hpp
|
|
@@ -333,9 +344,12 @@ set(QDB_FILES
|
|
|
333
344
|
error.hpp
|
|
334
345
|
entry.hpp
|
|
335
346
|
handle.hpp
|
|
347
|
+
handle.cpp
|
|
336
348
|
logger.hpp
|
|
337
349
|
logger.cpp
|
|
338
350
|
masked_array.hpp
|
|
351
|
+
metrics.hpp
|
|
352
|
+
metrics.cpp
|
|
339
353
|
module.hpp
|
|
340
354
|
module.cpp
|
|
341
355
|
node.hpp
|
quasardb/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pylint: disable=C0103,C0111,C0302,R0903
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2009-
|
|
3
|
+
# Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
|
|
4
4
|
# All rights reserved.
|
|
5
5
|
#
|
|
6
6
|
# Redistribution and use in source and binary forms, with or without
|
quasardb/batch_column.hpp
CHANGED
quasardb/batch_inserter.hpp
CHANGED
quasardb/blob.hpp
CHANGED
quasardb/cluster.cpp
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#include "cluster.hpp"
|
|
2
|
+
#include "metrics.hpp"
|
|
3
|
+
#include <chrono>
|
|
4
|
+
#include <thread>
|
|
5
|
+
|
|
6
|
+
namespace qdb
|
|
7
|
+
{
|
|
8
|
+
|
|
9
|
+
cluster::cluster(const std::string & uri,
|
|
10
|
+
const std::string & user_name,
|
|
11
|
+
const std::string & user_private_key,
|
|
12
|
+
const std::string & cluster_public_key,
|
|
13
|
+
const std::string & user_security_file,
|
|
14
|
+
const std::string & cluster_public_key_file,
|
|
15
|
+
std::chrono::milliseconds timeout,
|
|
16
|
+
bool do_version_check)
|
|
17
|
+
: _uri{uri}
|
|
18
|
+
, _handle{make_handle_ptr()}
|
|
19
|
+
, _json_loads{pybind11::module::import("json").attr("loads")}
|
|
20
|
+
, _logger("quasardb.cluster")
|
|
21
|
+
{
|
|
22
|
+
if (do_version_check == true)
|
|
23
|
+
{
|
|
24
|
+
_logger.warn(
|
|
25
|
+
"do_version_check parameter has been deprecated and a no-op. It will be removed from a "
|
|
26
|
+
"future release");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
options().apply_credentials(user_name, user_private_key, cluster_public_key, //
|
|
30
|
+
user_security_file, cluster_public_key_file);
|
|
31
|
+
|
|
32
|
+
options().set_timeout(timeout);
|
|
33
|
+
|
|
34
|
+
// HACKS(leon): we need to ensure there is always one callback active
|
|
35
|
+
// for qdb. Callbacks can be lost when the last active session
|
|
36
|
+
// gets closed. As such, the most pragmatic place to 'check'
|
|
37
|
+
// for this callback is when establishing a new connection.
|
|
38
|
+
qdb::native::swap_callback();
|
|
39
|
+
|
|
40
|
+
_logger.info("Connecting to cluster %s", _uri);
|
|
41
|
+
_handle->connect(_uri);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
void cluster::close()
|
|
45
|
+
{
|
|
46
|
+
_logger.info("Closing connection to cluster");
|
|
47
|
+
|
|
48
|
+
try
|
|
49
|
+
{
|
|
50
|
+
if (is_open() == true) [[likely]]
|
|
51
|
+
{
|
|
52
|
+
_handle->close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (qdb::invalid_handle_exception const & e)
|
|
56
|
+
{
|
|
57
|
+
// This can happen if, for example, we call close() after an error occured; in those
|
|
58
|
+
// circumstances, we fully expect the connection to already be invalid, and we should
|
|
59
|
+
// not care if this specific exception is raised.
|
|
60
|
+
_logger.warn("Connection already closed");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
_handle.reset();
|
|
64
|
+
|
|
65
|
+
assert(is_open() == false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
void cluster::wait_for_compaction()
|
|
69
|
+
{
|
|
70
|
+
|
|
71
|
+
// We define this function in the .cpp file so we can avoid including chrono and thread
|
|
72
|
+
// in the header file.
|
|
73
|
+
|
|
74
|
+
using namespace std::chrono_literals;
|
|
75
|
+
|
|
76
|
+
for (;;)
|
|
77
|
+
{
|
|
78
|
+
std::uint64_t progress = compact_progress();
|
|
79
|
+
|
|
80
|
+
if (progress == 0) [[unlikely]]
|
|
81
|
+
{
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
std::this_thread::sleep_for(100ms);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
}; // namespace qdb
|
quasardb/cluster.hpp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Official Python API
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
*
|
|
8
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -72,58 +72,10 @@ public:
|
|
|
72
72
|
const std::string & user_security_file = {},
|
|
73
73
|
const std::string & cluster_public_key_file = {},
|
|
74
74
|
std::chrono::milliseconds timeout = std::chrono::minutes{1},
|
|
75
|
-
bool do_version_check = false)
|
|
76
|
-
: _uri{uri}
|
|
77
|
-
, _handle{make_handle_ptr()}
|
|
78
|
-
, _json_loads{pybind11::module::import("json").attr("loads")}
|
|
79
|
-
, _logger("quasardb.cluster")
|
|
80
|
-
{
|
|
81
|
-
if (do_version_check == true)
|
|
82
|
-
{
|
|
83
|
-
_logger.warn(
|
|
84
|
-
"do_version_check parameter has been deprecated and a no-op. It will be removed from a "
|
|
85
|
-
"future release");
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
options().apply_credentials(user_name, user_private_key, cluster_public_key, //
|
|
89
|
-
user_security_file, cluster_public_key_file);
|
|
90
|
-
|
|
91
|
-
options().set_timeout(timeout);
|
|
92
|
-
|
|
93
|
-
// HACKS(leon): we need to ensure there is always one callback active
|
|
94
|
-
// for qdb. Callbacks can be lost when the last active session
|
|
95
|
-
// gets closed. As such, the most pragmatic place to 'check'
|
|
96
|
-
// for this callback is when establishing a new connection.
|
|
97
|
-
qdb::native::swap_callback();
|
|
98
|
-
|
|
99
|
-
_logger.info("Connecting to cluster %s", _uri);
|
|
100
|
-
_handle->connect(_uri);
|
|
101
|
-
}
|
|
75
|
+
bool do_version_check = false);
|
|
102
76
|
|
|
103
77
|
public:
|
|
104
|
-
void close()
|
|
105
|
-
{
|
|
106
|
-
_logger.info("Closing connection to cluster");
|
|
107
|
-
|
|
108
|
-
try
|
|
109
|
-
{
|
|
110
|
-
if (is_open() == true) [[likely]]
|
|
111
|
-
{
|
|
112
|
-
_handle->close();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
catch (qdb::invalid_handle_exception const & e)
|
|
116
|
-
{
|
|
117
|
-
// This can happen if, for example, we call close() after an error occured; in those
|
|
118
|
-
// circumstances, we fully expect the connection to already be invalid, and we should
|
|
119
|
-
// not care if this specific exception is raised.
|
|
120
|
-
_logger.warn("Connection already closed");
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
_handle.reset();
|
|
124
|
-
|
|
125
|
-
assert(is_open() == false);
|
|
126
|
-
}
|
|
78
|
+
void close();
|
|
127
79
|
|
|
128
80
|
bool is_open() const
|
|
129
81
|
{
|
|
@@ -463,6 +415,37 @@ public:
|
|
|
463
415
|
static_cast<int>(timeout_ms.count())));
|
|
464
416
|
}
|
|
465
417
|
|
|
418
|
+
void compact_full()
|
|
419
|
+
{
|
|
420
|
+
check_open();
|
|
421
|
+
|
|
422
|
+
qdb_compact_params_t params{};
|
|
423
|
+
params.options = qdb_compact_full;
|
|
424
|
+
|
|
425
|
+
qdb::qdb_throw_if_error(*_handle, qdb_cluster_compact(*_handle, ¶ms));
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// Returns 0 when finished / no compaction running
|
|
429
|
+
std::uint64_t compact_progress()
|
|
430
|
+
{
|
|
431
|
+
check_open();
|
|
432
|
+
|
|
433
|
+
std::uint64_t progress;
|
|
434
|
+
|
|
435
|
+
qdb::qdb_throw_if_error(*_handle, qdb_cluster_get_compact_progress(*_handle, &progress));
|
|
436
|
+
|
|
437
|
+
return progress;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
void compact_abort()
|
|
441
|
+
{
|
|
442
|
+
check_open();
|
|
443
|
+
|
|
444
|
+
qdb::qdb_throw_if_error(*_handle, qdb_cluster_abort_compact(*_handle));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
void wait_for_compaction();
|
|
448
|
+
|
|
466
449
|
public:
|
|
467
450
|
std::vector<std::string> endpoints()
|
|
468
451
|
{
|
|
@@ -558,6 +541,10 @@ static inline void register_cluster(Module & m)
|
|
|
558
541
|
.def("purge_all", &qdb::cluster::purge_all) //
|
|
559
542
|
.def("trim_all", &qdb::cluster::trim_all) //
|
|
560
543
|
.def("purge_cache", &qdb::cluster::purge_cache) //
|
|
544
|
+
.def("compact_full", &qdb::cluster::compact_full) //
|
|
545
|
+
.def("compact_progress", &qdb::cluster::compact_progress) //
|
|
546
|
+
.def("compact_abort", &qdb::cluster::compact_abort) //
|
|
547
|
+
.def("wait_for_compaction", &qdb::cluster::wait_for_compaction) //
|
|
561
548
|
.def("endpoints", &qdb::cluster::endpoints); //
|
|
562
549
|
}
|
|
563
550
|
|
quasardb/cmake_install.cmake
CHANGED
|
@@ -34,7 +34,7 @@ endif()
|
|
|
34
34
|
|
|
35
35
|
# Set default install directory permissions.
|
|
36
36
|
if(NOT DEFINED CMAKE_OBJDUMP)
|
|
37
|
-
set(CMAKE_OBJDUMP "/
|
|
37
|
+
set(CMAKE_OBJDUMP "/usr/local/clang16/bin/llvm-objdump")
|
|
38
38
|
endif()
|
|
39
39
|
|
|
40
40
|
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
quasardb/continuous.hpp
CHANGED
quasardb/convert/array.hpp
CHANGED
quasardb/convert/point.hpp
CHANGED
quasardb/convert/range.hpp
CHANGED
quasardb/convert/value.hpp
CHANGED
quasardb/convert.hpp
CHANGED
|
@@ -34,7 +34,7 @@ endif()
|
|
|
34
34
|
|
|
35
35
|
# Set default install directory permissions.
|
|
36
36
|
if(NOT DEFINED CMAKE_OBJDUMP)
|
|
37
|
-
set(CMAKE_OBJDUMP "/
|
|
37
|
+
set(CMAKE_OBJDUMP "/usr/local/clang16/bin/llvm-objdump")
|
|
38
38
|
endif()
|
|
39
39
|
|
|
40
40
|
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
|
quasardb/detail/qdb_resource.hpp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Official Python API
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
*
|
|
8
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -104,6 +104,16 @@ public:
|
|
|
104
104
|
return *p_;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
ValueType * operator->()
|
|
108
|
+
{
|
|
109
|
+
return p_;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
constexpr ValueType const * operator->() const
|
|
113
|
+
{
|
|
114
|
+
return p_;
|
|
115
|
+
}
|
|
116
|
+
|
|
107
117
|
constexpr ValueType const & operator*() const
|
|
108
118
|
{
|
|
109
119
|
return *p_;
|
quasardb/detail/ts_column.hpp
CHANGED
quasardb/direct_blob.hpp
CHANGED
quasardb/direct_handle.hpp
CHANGED
quasardb/direct_integer.hpp
CHANGED
quasardb/double.hpp
CHANGED
quasardb/entry.hpp
CHANGED
quasardb/error.hpp
CHANGED
quasardb/handle.cpp
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#include "handle.hpp"
|
|
2
|
+
#include "metrics.hpp"
|
|
3
|
+
|
|
4
|
+
namespace qdb
|
|
5
|
+
{
|
|
6
|
+
|
|
7
|
+
void handle::connect(const std::string & uri)
|
|
8
|
+
{
|
|
9
|
+
qdb_error_t err;
|
|
10
|
+
{
|
|
11
|
+
metrics::scoped_capture{"qdb_connect"};
|
|
12
|
+
err = qdb_connect(handle_, uri.c_str());
|
|
13
|
+
}
|
|
14
|
+
qdb::qdb_throw_if_error(handle_, err);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
void handle::close()
|
|
18
|
+
{
|
|
19
|
+
if (handle_ != nullptr)
|
|
20
|
+
{
|
|
21
|
+
metrics::scoped_capture{"qdb_close"};
|
|
22
|
+
qdb_close(handle_);
|
|
23
|
+
handle_ = nullptr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
assert(handle_ == nullptr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}; // namespace qdb
|
quasardb/handle.hpp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Official Python API
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
*
|
|
8
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -54,26 +54,14 @@ public:
|
|
|
54
54
|
close();
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
void connect(const std::string & uri)
|
|
58
|
-
{
|
|
59
|
-
qdb::qdb_throw_if_error(handle_, qdb_connect(handle_, uri.c_str()));
|
|
60
|
-
}
|
|
57
|
+
void connect(const std::string & uri);
|
|
61
58
|
|
|
62
59
|
operator qdb_handle_t() const noexcept
|
|
63
60
|
{
|
|
64
61
|
return handle_;
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
void close()
|
|
68
|
-
{
|
|
69
|
-
if (handle_ != nullptr)
|
|
70
|
-
{
|
|
71
|
-
qdb_close(handle_);
|
|
72
|
-
handle_ = nullptr;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
assert(handle_ == nullptr);
|
|
76
|
-
}
|
|
64
|
+
void close();
|
|
77
65
|
|
|
78
66
|
constexpr inline bool is_open() const
|
|
79
67
|
{
|
quasardb/integer.hpp
CHANGED
quasardb/libqdb_api.dylib
CHANGED
|
Binary file
|
quasardb/logger.cpp
CHANGED
|
@@ -11,6 +11,8 @@ void qdb::native::swap_callback()
|
|
|
11
11
|
{
|
|
12
12
|
// Potential race condition avoidance!
|
|
13
13
|
std::lock_guard<std::mutex> guard(_buffer_lock);
|
|
14
|
+
|
|
15
|
+
#ifndef NDEBUG
|
|
14
16
|
qdb_error_t error;
|
|
15
17
|
|
|
16
18
|
error = qdb_log_remove_callback(local_callback_id);
|
|
@@ -26,6 +28,7 @@ void qdb::native::swap_callback()
|
|
|
26
28
|
// fprintf(stderr, "unable to add new callback: %s (%#x)\n", qdb_error(error), error);
|
|
27
29
|
// fflush(stderr);
|
|
28
30
|
}
|
|
31
|
+
#endif
|
|
29
32
|
|
|
30
33
|
_logger = qdb::logger("quasardb.native");
|
|
31
34
|
}
|
quasardb/logger.hpp
CHANGED
quasardb/masked_array.hpp
CHANGED