quasardb 3.14.2.dev3__cp38-cp38-win_amd64.whl → 3.14.2.dev5__cp38-cp38-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 +6 -5
- quasardb/__init__.py +21 -7
- quasardb/cmake_install.cmake +6 -0
- quasardb/date/ALL_BUILD.vcxproj +10 -9
- quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake +2 -2
- quasardb/date/CMakeFiles/generate.stamp.depend +4 -4
- quasardb/date/INSTALL.vcxproj +6 -5
- quasardb/date/cmake_install.cmake +6 -0
- quasardb/date/dateTargets.cmake +2 -2
- quasardb/extensions/writer.py +59 -61
- quasardb/firehose.py +24 -22
- quasardb/numpy/__init__.py +181 -120
- quasardb/pandas/__init__.py +145 -95
- quasardb/pool.py +13 -2
- quasardb/pybind11/ALL_BUILD.vcxproj +10 -9
- quasardb/pybind11/CMakeFiles/generate.stamp.depend +14 -14
- quasardb/pybind11/INSTALL.vcxproj +6 -5
- quasardb/pybind11/cmake_install.cmake +6 -0
- quasardb/qdb_api.dll +0 -0
- quasardb/quasardb.cp38-win_amd64.pyd +0 -0
- quasardb/range-v3/ALL_BUILD.vcxproj +10 -9
- quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +2 -2
- quasardb/range-v3/CMakeFiles/generate.stamp.depend +11 -11
- quasardb/range-v3/INSTALL.vcxproj +6 -5
- quasardb/range-v3/cmake_install.cmake +6 -0
- quasardb/range-v3/range-v3-config.cmake +2 -2
- quasardb/range-v3/range.v3.headers.vcxproj +10 -9
- quasardb/stats.py +92 -80
- quasardb/table_cache.py +5 -1
- {quasardb-3.14.2.dev3.dist-info → quasardb-3.14.2.dev5.dist-info}/METADATA +3 -6
- quasardb-3.14.2.dev5.dist-info/RECORD +54 -0
- {quasardb-3.14.2.dev3.dist-info → quasardb-3.14.2.dev5.dist-info}/WHEEL +1 -1
- quasardb/CMakeLists.txt +0 -517
- quasardb/batch_column.hpp +0 -80
- quasardb/batch_inserter.hpp +0 -248
- quasardb/blob.hpp +0 -150
- quasardb/cluster.cpp +0 -102
- quasardb/cluster.hpp +0 -593
- quasardb/concepts.hpp +0 -322
- quasardb/continuous.cpp +0 -199
- quasardb/continuous.hpp +0 -109
- quasardb/convert/array.hpp +0 -299
- 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 -782
- quasardb/convert.hpp +0 -38
- quasardb/detail/invoke.hpp +0 -0
- quasardb/detail/qdb_resource.hpp +0 -129
- quasardb/detail/retry.cpp +0 -30
- quasardb/detail/retry.hpp +0 -147
- quasardb/detail/sleep.hpp +0 -53
- quasardb/detail/ts_column.hpp +0 -224
- quasardb/detail/writer.cpp +0 -440
- quasardb/detail/writer.hpp +0 -550
- 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 -393
- 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 -658
- quasardb/metrics.cpp +0 -103
- quasardb/metrics.hpp +0 -112
- quasardb/module.cpp +0 -92
- quasardb/module.hpp +0 -24
- quasardb/node.hpp +0 -132
- quasardb/numpy.cpp +0 -6
- quasardb/numpy.hpp +0 -489
- quasardb/object_tracker.hpp +0 -282
- quasardb/options.hpp +0 -273
- quasardb/perf.hpp +0 -336
- quasardb/properties.cpp +0 -41
- quasardb/properties.hpp +0 -85
- quasardb/pytypes.hpp +0 -221
- quasardb/query.cpp +0 -420
- quasardb/query.hpp +0 -92
- quasardb/reader.cpp +0 -282
- quasardb/reader.hpp +0 -256
- quasardb/remove_cvref.hpp +0 -31
- quasardb/string.hpp +0 -160
- quasardb/table.cpp +0 -257
- quasardb/table.hpp +0 -366
- quasardb/tag.hpp +0 -77
- quasardb/timestamp.hpp +0 -97
- quasardb/traits.hpp +0 -642
- 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.hpp +0 -354
- quasardb-3.14.2.dev3.dist-info/RECORD +0 -124
- {quasardb-3.14.2.dev3.dist-info → quasardb-3.14.2.dev5.dist-info}/LICENSE.md +0 -0
- {quasardb-3.14.2.dev3.dist-info → quasardb-3.14.2.dev5.dist-info}/top_level.txt +0 -0
quasardb/firehose.py
CHANGED
|
@@ -6,15 +6,14 @@ import numpy as np
|
|
|
6
6
|
FIREHOSE_TABLE = "$qdb.firehose"
|
|
7
7
|
POLL_INTERVAL = 0.1
|
|
8
8
|
|
|
9
|
-
logger = logging.getLogger(
|
|
9
|
+
logger = logging.getLogger("quasardb.firehose")
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def _init():
|
|
13
13
|
"""
|
|
14
14
|
Initialize our internal state.
|
|
15
15
|
"""
|
|
16
|
-
return {
|
|
17
|
-
'seen': set()}
|
|
16
|
+
return {"last": None, "seen": set()}
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
def _get_transactions_since(conn, table_name, last):
|
|
@@ -24,10 +23,12 @@ def _get_transactions_since(conn, table_name, last):
|
|
|
24
23
|
"""
|
|
25
24
|
if last is None:
|
|
26
25
|
q = "SELECT $timestamp, transaction_id, begin, end FROM \"{}\" WHERE table = '{}' ORDER BY $timestamp".format(
|
|
27
|
-
FIREHOSE_TABLE, table_name
|
|
26
|
+
FIREHOSE_TABLE, table_name
|
|
27
|
+
)
|
|
28
28
|
else:
|
|
29
29
|
q = "SELECT $timestamp, transaction_id, begin, end FROM \"{}\" IN RANGE ({}, +1y) WHERE table = '{}' ORDER BY $timestamp".format(
|
|
30
|
-
FIREHOSE_TABLE, last[
|
|
30
|
+
FIREHOSE_TABLE, last["$timestamp"], table_name
|
|
31
|
+
)
|
|
31
32
|
|
|
32
33
|
return conn.query(q)
|
|
33
34
|
|
|
@@ -36,8 +37,7 @@ def _get_transaction_data(conn, table_name, begin, end):
|
|
|
36
37
|
"""
|
|
37
38
|
Gets all data from a certain table.
|
|
38
39
|
"""
|
|
39
|
-
q =
|
|
40
|
-
table_name, begin, end)
|
|
40
|
+
q = 'SELECT * FROM "{}" IN RANGE ({}, {}) '.format(table_name, begin, end)
|
|
41
41
|
return conn.query(q)
|
|
42
42
|
|
|
43
43
|
|
|
@@ -50,33 +50,35 @@ def _get_next(conn, table_name, state):
|
|
|
50
50
|
# 3. For each of the transactions, pull in all data
|
|
51
51
|
# 4. Concatenate all this data (in order of quasardb transaction)
|
|
52
52
|
|
|
53
|
-
txs = _get_transactions_since(conn, table_name, state[
|
|
53
|
+
txs = _get_transactions_since(conn, table_name, state["last"])
|
|
54
54
|
|
|
55
55
|
xs = list()
|
|
56
56
|
for tx in txs:
|
|
57
|
-
txid = tx[
|
|
57
|
+
txid = tx["transaction_id"]
|
|
58
58
|
|
|
59
|
-
if state[
|
|
59
|
+
if state["last"] is not None and tx["$timestamp"] > state["last"]["$timestamp"]:
|
|
60
60
|
# At this point we are guaranteed that the transaction we encounter is
|
|
61
61
|
# 'new', will not conflict with any other transaction ids. It is thus
|
|
62
62
|
# safe to reset the txid set.
|
|
63
|
-
state[
|
|
64
|
-
|
|
65
|
-
if txid not in state[
|
|
66
|
-
xs = xs + _get_transaction_data(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
state["seen"] = set()
|
|
64
|
+
|
|
65
|
+
if txid not in state["seen"]:
|
|
66
|
+
xs = xs + _get_transaction_data(
|
|
67
|
+
conn,
|
|
68
|
+
table_name,
|
|
69
|
+
tx["begin"],
|
|
70
|
+
# The firehose logs transaction `end` span as
|
|
71
|
+
# end inclusive, while our bulk reader and/or query
|
|
72
|
+
# language are end exclusive.
|
|
73
|
+
tx["end"] + np.timedelta64(1, "ns"),
|
|
74
|
+
)
|
|
73
75
|
|
|
74
76
|
# Because it is possible that multiple firehose changes are stored with the
|
|
75
77
|
# exact same $timestamp, we also keep track of the actually seen
|
|
76
78
|
# transaction ids.
|
|
77
|
-
state[
|
|
79
|
+
state["seen"].add(txid)
|
|
78
80
|
|
|
79
|
-
state[
|
|
81
|
+
state["last"] = tx
|
|
80
82
|
|
|
81
83
|
return (state, xs)
|
|
82
84
|
|