quasardb 3.14.1.dev4__cp38-cp38-macosx_10_14_x86_64.whl → 3.14.2.dev0__cp38-cp38-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.

Files changed (71) hide show
  1. quasardb/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  2. quasardb/CMakeLists.txt +5 -1
  3. quasardb/Makefile +9 -9
  4. quasardb/__init__.py +1 -1
  5. quasardb/batch_column.hpp +1 -1
  6. quasardb/batch_inserter.hpp +1 -1
  7. quasardb/blob.hpp +1 -1
  8. quasardb/cluster.cpp +89 -0
  9. quasardb/cluster.hpp +114 -34
  10. quasardb/cmake_install.cmake +4 -4
  11. quasardb/continuous.hpp +1 -1
  12. quasardb/convert/array.hpp +1 -1
  13. quasardb/convert/point.hpp +1 -1
  14. quasardb/convert/range.hpp +1 -1
  15. quasardb/convert/value.hpp +1 -1
  16. quasardb/convert.hpp +1 -1
  17. quasardb/date/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  18. quasardb/date/Makefile +9 -9
  19. quasardb/date/cmake_install.cmake +4 -4
  20. quasardb/detail/qdb_resource.hpp +11 -1
  21. quasardb/detail/ts_column.hpp +1 -1
  22. quasardb/direct_blob.hpp +1 -1
  23. quasardb/direct_handle.hpp +1 -1
  24. quasardb/direct_integer.hpp +1 -1
  25. quasardb/double.hpp +1 -1
  26. quasardb/entry.hpp +1 -1
  27. quasardb/error.hpp +26 -2
  28. quasardb/handle.cpp +29 -0
  29. quasardb/handle.hpp +29 -12
  30. quasardb/integer.hpp +1 -1
  31. quasardb/libqdb_api.dylib +0 -0
  32. quasardb/logger.cpp +3 -0
  33. quasardb/logger.hpp +1 -1
  34. quasardb/masked_array.hpp +1 -1
  35. quasardb/metrics.cpp +103 -0
  36. quasardb/metrics.hpp +112 -0
  37. quasardb/module.cpp +2 -0
  38. quasardb/node.hpp +1 -1
  39. quasardb/numpy.hpp +1 -1
  40. quasardb/options.hpp +16 -1
  41. quasardb/pandas/__init__.py +1 -1
  42. quasardb/perf.hpp +1 -1
  43. quasardb/pybind11/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  44. quasardb/pybind11/Makefile +9 -9
  45. quasardb/pybind11/cmake_install.cmake +1 -1
  46. quasardb/pytypes.hpp +1 -1
  47. quasardb/quasardb.cpython-38-darwin.so +0 -0
  48. quasardb/query.cpp +14 -3
  49. quasardb/query.hpp +1 -1
  50. quasardb/range-v3/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  51. quasardb/range-v3/CMakeFiles/range.v3.headers.dir/build.make +12 -12
  52. quasardb/range-v3/Makefile +14 -14
  53. quasardb/range-v3/cmake_install.cmake +4 -4
  54. quasardb/reader/ts_row.hpp +1 -1
  55. quasardb/reader/ts_value.hpp +1 -1
  56. quasardb/string.hpp +1 -1
  57. quasardb/table.cpp +50 -0
  58. quasardb/table.hpp +70 -32
  59. quasardb/table_reader.hpp +6 -2
  60. quasardb/tag.hpp +1 -1
  61. quasardb/timestamp.hpp +1 -1
  62. quasardb/utils.hpp +1 -1
  63. quasardb/writer.cpp +6 -0
  64. quasardb/writer.hpp +1 -1
  65. {quasardb-3.14.1.dev4.dist-info → quasardb-3.14.2.dev0.dist-info}/LICENSE.md +1 -1
  66. {quasardb-3.14.1.dev4.dist-info → quasardb-3.14.2.dev0.dist-info}/METADATA +1 -1
  67. quasardb-3.14.2.dev0.dist-info/RECORD +109 -0
  68. quasardb/add_boost_test.cmake +0 -43
  69. quasardb-3.14.1.dev4.dist-info/RECORD +0 -106
  70. {quasardb-3.14.1.dev4.dist-info → quasardb-3.14.2.dev0.dist-info}/WHEEL +0 -0
  71. {quasardb-3.14.1.dev4.dist-info → quasardb-3.14.2.dev0.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Relative path conversion top directories.
5
5
  set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/thirdparty")
6
- set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb")
6
+ set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb")
7
7
 
8
8
  # Force unix paths in dependencies.
9
9
  set(CMAKE_FORCE_UNIX_PATHS 1)
quasardb/CMakeLists.txt CHANGED
@@ -2,7 +2,7 @@ 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.14")
5
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
6
6
  set(CMAKE_VERBOSE_MAKEFILE FALSE)
7
7
 
8
8
  include(CheckIPOSupported)
@@ -325,6 +325,7 @@ set(QDB_FILES
325
325
  batch_inserter.hpp
326
326
  blob.hpp
327
327
  cluster.hpp
328
+ cluster.cpp
328
329
  concepts.hpp
329
330
  continuous.cpp
330
331
  continuous.hpp
@@ -333,9 +334,12 @@ set(QDB_FILES
333
334
  error.hpp
334
335
  entry.hpp
335
336
  handle.hpp
337
+ handle.cpp
336
338
  logger.hpp
337
339
  logger.cpp
338
340
  masked_array.hpp
341
+ metrics.hpp
342
+ metrics.cpp
339
343
  module.hpp
340
344
  module.cpp
341
345
  node.hpp
quasardb/Makefile CHANGED
@@ -60,7 +60,7 @@ EQUALS = =
60
60
  CMAKE_SOURCE_DIR = /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/quasardb
61
61
 
62
62
  # The top-level build directory on which CMake was run.
63
- CMAKE_BINARY_DIR = /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38
63
+ CMAKE_BINARY_DIR = /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38
64
64
 
65
65
  #=============================================================================
66
66
  # Targets provided globally by CMake.
@@ -132,14 +132,14 @@ install/strip/fast: preinstall/fast
132
132
 
133
133
  # The main all target
134
134
  all: cmake_check_build_system
135
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(CMAKE_COMMAND) -E cmake_progress_start /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38/CMakeFiles /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb//CMakeFiles/progress.marks
136
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/all
137
- $(CMAKE_COMMAND) -E cmake_progress_start /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38/CMakeFiles 0
135
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(CMAKE_COMMAND) -E cmake_progress_start /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38/CMakeFiles /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb//CMakeFiles/progress.marks
136
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/all
137
+ $(CMAKE_COMMAND) -E cmake_progress_start /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38/CMakeFiles 0
138
138
  .PHONY : all
139
139
 
140
140
  # The main clean target
141
141
  clean:
142
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/clean
142
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/clean
143
143
  .PHONY : clean
144
144
 
145
145
  # The main clean target
@@ -148,17 +148,17 @@ clean/fast: clean
148
148
 
149
149
  # Prepare targets for installation.
150
150
  preinstall: all
151
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/preinstall
151
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/preinstall
152
152
  .PHONY : preinstall
153
153
 
154
154
  # Prepare targets for installation.
155
155
  preinstall/fast:
156
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/preinstall
156
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/preinstall
157
157
  .PHONY : preinstall/fast
158
158
 
159
159
  # clear depends
160
160
  depend:
161
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
161
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
162
162
  .PHONY : depend
163
163
 
164
164
  # Help Target
@@ -184,6 +184,6 @@ help:
184
184
  # No rule that depends on this can have commands that come from listfiles
185
185
  # because they might be regenerated.
186
186
  cmake_check_build_system:
187
- cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-12.0-x86_64-cpython-38 && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
187
+ cd /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.macosx-14.0-x86_64-cpython-38 && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
188
188
  .PHONY : cmake_check_build_system
189
189
 
quasardb/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # pylint: disable=C0103,C0111,C0302,R0903
2
2
 
3
- # Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
quasardb/blob.hpp CHANGED
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
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-2023, quasardb SAS. All rights reserved.
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
@@ -57,6 +57,7 @@
57
57
  #include <pybind11/operators.h>
58
58
  #include <pybind11/stl.h>
59
59
  #include <chrono>
60
+ #include <iostream>
60
61
 
61
62
  namespace qdb
62
63
  {
@@ -71,39 +72,30 @@ public:
71
72
  const std::string & user_security_file = {},
72
73
  const std::string & cluster_public_key_file = {},
73
74
  std::chrono::milliseconds timeout = std::chrono::minutes{1},
74
- bool do_version_check = false)
75
- : _uri{uri}
76
- , _handle{make_handle_ptr()}
77
- , _json_loads{pybind11::module::import("json").attr("loads")}
78
- , _logger("quasardb.cluster")
79
- {
80
- if (do_version_check == true)
81
- {
82
- _logger.warn(
83
- "do_version_check parameter has been deprecated and a no-op. It will be removed from a "
84
- "future release");
85
- }
86
-
87
- options().apply_credentials(user_name, user_private_key, cluster_public_key, //
88
- user_security_file, cluster_public_key_file);
75
+ bool do_version_check = false);
89
76
 
90
- options().set_timeout(timeout);
91
-
92
- // HACKS(leon): we need to ensure there is always one callback active
93
- // for qdb. Callbacks can be lost when the last active session
94
- // gets closed. As such, the most pragmatic place to 'check'
95
- // for this callback is when establishing a new connection.
96
- qdb::native::swap_callback();
77
+ public:
78
+ void close();
97
79
 
98
- _logger.info("Connecting to cluster %s", _uri);
99
- _handle->connect(_uri);
80
+ bool is_open() const
81
+ {
82
+ return _handle.get() != nullptr && _handle->is_open();
100
83
  }
101
84
 
102
- public:
103
- void close()
85
+ /**
86
+ * Throws exception if the connection is not open. Should be invoked before any operation
87
+ * is done on the handle, as the QuasarDB C API only checks for a canary presence in the
88
+ * handle's memory arena. If a compiler is optimizing enough, the handle can be closed but
89
+ * the canary still present in memory, so it's UB.
90
+ *
91
+ * As such, we should check on a higher level.
92
+ */
93
+ void check_open() const
104
94
  {
105
- _logger.info("Closing connection to cluster");
106
- _handle.reset();
95
+ if (is_open() == false) [[unlikely]]
96
+ {
97
+ throw qdb::invalid_handle_exception{};
98
+ }
107
99
  }
108
100
 
109
101
  void tidy_memory()
@@ -153,11 +145,6 @@ public:
153
145
  return *this;
154
146
  }
155
147
 
156
- bool is_open() const
157
- {
158
- return _handle.get() != nullptr;
159
- }
160
-
161
148
  void exit(pybind11::object type, pybind11::object value, pybind11::object traceback)
162
149
  {
163
150
  return close();
@@ -165,6 +152,8 @@ public:
165
152
 
166
153
  pybind11::object node_config(const std::string & uri)
167
154
  {
155
+ check_open();
156
+
168
157
  const char * content = nullptr;
169
158
  qdb_size_t content_length = 0;
170
159
 
@@ -176,6 +165,8 @@ public:
176
165
 
177
166
  pybind11::object node_status(const std::string & uri)
178
167
  {
168
+ check_open();
169
+
179
170
  const char * content = nullptr;
180
171
  qdb_size_t content_length = 0;
181
172
 
@@ -187,6 +178,8 @@ public:
187
178
 
188
179
  pybind11::object node_topology(const std::string & uri)
189
180
  {
181
+ check_open();
182
+
190
183
  const char * content = nullptr;
191
184
  qdb_size_t content_length = 0;
192
185
 
@@ -199,64 +192,88 @@ public:
199
192
  public:
200
193
  qdb::tag tag(const std::string & alias)
201
194
  {
195
+ check_open();
196
+
202
197
  return qdb::tag{_handle, alias};
203
198
  }
204
199
 
205
200
  qdb::blob_entry blob(const std::string & alias)
206
201
  {
202
+ check_open();
203
+
207
204
  return qdb::blob_entry{_handle, alias};
208
205
  }
209
206
 
210
207
  qdb::string_entry string(const std::string & alias)
211
208
  {
209
+ check_open();
210
+
212
211
  return qdb::string_entry{_handle, alias};
213
212
  }
214
213
 
215
214
  qdb::integer_entry integer(const std::string & alias)
216
215
  {
216
+ check_open();
217
+
217
218
  return qdb::integer_entry{_handle, alias};
218
219
  }
219
220
 
220
221
  qdb::double_entry double_(const std::string & alias)
221
222
  {
223
+ check_open();
224
+
222
225
  return qdb::double_entry{_handle, alias};
223
226
  }
224
227
 
225
228
  qdb::timestamp_entry timestamp(const std::string & alias)
226
229
  {
230
+ check_open();
231
+
227
232
  return qdb::timestamp_entry{_handle, alias};
228
233
  }
229
234
 
230
235
  qdb::table table(const std::string & alias)
231
236
  {
237
+ check_open();
238
+
232
239
  return qdb::table{_handle, alias};
233
240
  }
234
241
 
235
242
  // the batch_inserter_ptr is non-copyable
236
243
  qdb::batch_inserter_ptr inserter(const std::vector<batch_column_info> & ci)
237
244
  {
245
+ check_open();
246
+
238
247
  return std::make_unique<qdb::batch_inserter>(_handle, ci);
239
248
  }
240
249
 
241
250
  // the batch_inserter_ptr is non-copyable
242
251
  qdb::writer_ptr writer()
243
252
  {
253
+ check_open();
254
+
244
255
  return std::make_unique<qdb::writer>(_handle);
245
256
  }
246
257
 
247
258
  // the batch_inserter_ptr is non-copyable
248
259
  qdb::writer_ptr pinned_writer()
249
260
  {
261
+ check_open();
262
+
250
263
  return writer();
251
264
  }
252
265
 
253
266
  qdb::options options()
254
267
  {
268
+ check_open();
269
+
255
270
  return qdb::options{_handle};
256
271
  }
257
272
 
258
273
  qdb::perf perf()
259
274
  {
275
+ check_open();
276
+
260
277
  return qdb::perf{_handle};
261
278
  }
262
279
 
@@ -268,6 +285,8 @@ public:
268
285
  public:
269
286
  std::vector<std::string> prefix_get(const std::string & prefix, qdb_int_t max_count)
270
287
  {
288
+ check_open();
289
+
271
290
  const char ** result = nullptr;
272
291
  size_t count = 0;
273
292
 
@@ -283,6 +302,8 @@ public:
283
302
 
284
303
  qdb_uint_t prefix_count(const std::string & prefix)
285
304
  {
305
+ check_open();
306
+
286
307
  qdb_uint_t count = 0;
287
308
 
288
309
  const qdb_error_t err = qdb_prefix_count(*_handle, prefix.c_str(), &count);
@@ -294,22 +315,30 @@ public:
294
315
  public:
295
316
  qdb::find_query find(const std::string & query_string)
296
317
  {
318
+ check_open();
319
+
297
320
  return qdb::find_query{_handle, query_string};
298
321
  }
299
322
 
300
323
  py::object query(const std::string & query_string, const py::object & blobs)
301
324
  {
325
+ check_open();
326
+
302
327
  return py::cast(qdb::dict_query(_handle, query_string, blobs));
303
328
  }
304
329
 
305
330
  py::object query_numpy(const std::string & query_string)
306
331
  {
332
+ check_open();
333
+
307
334
  return py::cast(qdb::numpy_query(_handle, query_string));
308
335
  }
309
336
 
310
337
  std::shared_ptr<qdb::query_continuous> query_continuous_full(
311
338
  const std::string & query_string, std::chrono::milliseconds pace, const py::object & blobs)
312
339
  {
340
+ check_open();
341
+
313
342
  return std::make_shared<qdb::query_continuous>(
314
343
  _handle, qdb_query_continuous_full, pace, query_string, blobs);
315
344
  }
@@ -317,6 +346,8 @@ public:
317
346
  std::shared_ptr<qdb::query_continuous> query_continuous_new_values(
318
347
  const std::string & query_string, std::chrono::milliseconds pace, const py::object & blobs)
319
348
  {
349
+ check_open();
350
+
320
351
  return std::make_shared<qdb::query_continuous>(
321
352
  _handle, qdb_query_continuous_new_values_only, pace, query_string, blobs);
322
353
  }
@@ -324,6 +355,8 @@ public:
324
355
  public:
325
356
  std::vector<std::string> suffix_get(const std::string & suffix, qdb_int_t max_count)
326
357
  {
358
+ check_open();
359
+
327
360
  const char ** result = nullptr;
328
361
  size_t count = 0;
329
362
 
@@ -339,6 +372,8 @@ public:
339
372
 
340
373
  qdb_uint_t suffix_count(const std::string & suffix)
341
374
  {
375
+ check_open();
376
+
342
377
  qdb_uint_t count = 0;
343
378
 
344
379
  const qdb_error_t err = qdb_suffix_count(*_handle, suffix.c_str(), &count);
@@ -350,31 +385,72 @@ public:
350
385
  public:
351
386
  void purge_all(std::chrono::milliseconds timeout_ms)
352
387
  {
388
+ check_open();
389
+
353
390
  qdb::qdb_throw_if_error(
354
391
  *_handle, qdb_purge_all(*_handle, static_cast<int>(timeout_ms.count())));
355
392
  }
356
393
 
357
394
  void purge_cache(std::chrono::milliseconds timeout_ms)
358
395
  {
396
+ check_open();
397
+
359
398
  qdb::qdb_throw_if_error(
360
399
  *_handle, qdb_purge_cache(*_handle, static_cast<int>(timeout_ms.count())));
361
400
  }
362
401
 
363
402
  void wait_for_stabilization(std::chrono::milliseconds timeout_ms)
364
403
  {
404
+ check_open();
405
+
365
406
  qdb::qdb_throw_if_error(
366
407
  *_handle, qdb_wait_for_stabilization(*_handle, static_cast<int>(timeout_ms.count())));
367
408
  }
368
409
 
369
410
  void trim_all(std::chrono::milliseconds pause_ms, std::chrono::milliseconds timeout_ms)
370
411
  {
412
+ check_open();
413
+
371
414
  qdb::qdb_throw_if_error(*_handle, qdb_trim_all(*_handle, static_cast<int>(pause_ms.count()),
372
415
  static_cast<int>(timeout_ms.count())));
373
416
  }
374
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, &params));
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
+
375
449
  public:
376
450
  std::vector<std::string> endpoints()
377
451
  {
452
+ check_open();
453
+
378
454
  qdb_remote_node_t * endpoints = nullptr;
379
455
  qdb_size_t count = 0;
380
456
 
@@ -465,6 +541,10 @@ static inline void register_cluster(Module & m)
465
541
  .def("purge_all", &qdb::cluster::purge_all) //
466
542
  .def("trim_all", &qdb::cluster::trim_all) //
467
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) //
468
548
  .def("endpoints", &qdb::cluster::endpoints); //
469
549
  }
470
550
 
@@ -34,14 +34,14 @@ endif()
34
34
 
35
35
  # Set default install directory permissions.
36
36
  if(NOT DEFINED CMAKE_OBJDUMP)
37
- set(CMAKE_OBJDUMP "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump")
37
+ set(CMAKE_OBJDUMP "/usr/local/clang16/bin/llvm-objdump")
38
38
  endif()
39
39
 
40
40
  if(NOT CMAKE_INSTALL_LOCAL_ONLY)
41
41
  # Include the install script for each subdirectory.
42
- include("/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/date/cmake_install.cmake")
43
- include("/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/pybind11/cmake_install.cmake")
44
- include("/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb/range-v3/cmake_install.cmake")
42
+ include("/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/date/cmake_install.cmake")
43
+ include("/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/pybind11/cmake_install.cmake")
44
+ include("/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb/range-v3/cmake_install.cmake")
45
45
 
46
46
  endif()
47
47
 
quasardb/continuous.hpp CHANGED
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
quasardb/convert.hpp CHANGED
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * Official Python API
4
4
  *
5
- * Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
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
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Relative path conversion top directories.
5
5
  set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/thirdparty")
6
- set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-12.0-x86_64-cpython-38/quasardb")
6
+ set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/lib.macosx-14.0-x86_64-cpython-38/quasardb")
7
7
 
8
8
  # Force unix paths in dependencies.
9
9
  set(CMAKE_FORCE_UNIX_PATHS 1)