rdbpython 0.2.1__tar.gz → 0.2.3__tar.gz

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.
Files changed (57) hide show
  1. {rdbpython-0.2.1/src/rdbpython.egg-info → rdbpython-0.2.3}/PKG-INFO +1 -2
  2. {rdbpython-0.2.1 → rdbpython-0.2.3}/pyproject.toml +7 -4
  3. {rdbpython-0.2.1 → rdbpython-0.2.3}/scripts/build-rocksdb-linux.sh +1 -1
  4. {rdbpython-0.2.1 → rdbpython-0.2.3}/scripts/build-rocksdb-macos.sh +1 -1
  5. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/lib_rocksdb.pyx +60 -10
  6. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/table_factory.pxd +9 -0
  7. {rdbpython-0.2.1 → rdbpython-0.2.3/src/rdbpython.egg-info}/PKG-INFO +1 -2
  8. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpython.egg-info/SOURCES.txt +5 -6
  9. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpython.egg-info/requires.txt +0 -1
  10. rdbpython-0.2.1/tests/unit/rocksdb/__init__.py +0 -0
  11. {rdbpython-0.2.1 → rdbpython-0.2.3}/LICENSE.md +0 -0
  12. {rdbpython-0.2.1 → rdbpython-0.2.3}/MANIFEST.in +0 -0
  13. {rdbpython-0.2.1 → rdbpython-0.2.3}/README.md +0 -0
  14. {rdbpython-0.2.1 → rdbpython-0.2.3}/scripts/rocksdb-cstdint.patch +0 -0
  15. {rdbpython-0.2.1 → rdbpython-0.2.3}/setup.cfg +0 -0
  16. {rdbpython-0.2.1 → rdbpython-0.2.3}/setup.py +0 -0
  17. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/__init__.py +0 -0
  18. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/backup.pxd +0 -0
  19. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/cache.pxd +0 -0
  20. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/comparator.pxd +0 -0
  21. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/db.pxd +0 -0
  22. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/env.pxd +0 -0
  23. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/errors.py +0 -0
  24. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/filter_policy.pxd +0 -0
  25. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/comparator_wrapper.hpp +0 -0
  26. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/filter_policy_wrapper.hpp +0 -0
  27. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/memtable_factories.hpp +0 -0
  28. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/merge_operator_wrapper.hpp +0 -0
  29. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/slice_transform_wrapper.hpp +0 -0
  30. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/utils.hpp +0 -0
  31. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/include/rdb_include/write_batch_iter_helper.hpp +0 -0
  32. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/interfaces.py +0 -0
  33. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/iterator.pxd +0 -0
  34. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/lib_rocksdb.pxd +0 -0
  35. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/lib_rocksdb.pyi +0 -0
  36. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/lib_utils.py +0 -0
  37. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/logger.pxd +0 -0
  38. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/memtablerep.pxd +0 -0
  39. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/merge_operator.pxd +0 -0
  40. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/merge_operators.py +0 -0
  41. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/options.pxd +0 -0
  42. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/slice_.pxd +0 -0
  43. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/slice_transform.pxd +0 -0
  44. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/snapshot.pxd +0 -0
  45. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/status.pxd +0 -0
  46. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/std_memory.pxd +0 -0
  47. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/transaction.pxd +0 -0
  48. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpy/universal_compaction.pxd +0 -0
  49. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpython.egg-info/dependency_links.txt +0 -0
  50. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpython.egg-info/not-zip-safe +0 -0
  51. {rdbpython-0.2.1 → rdbpython-0.2.3}/src/rdbpython.egg-info/top_level.txt +0 -0
  52. {rdbpython-0.2.1 → rdbpython-0.2.3}/tests/conftest.py +0 -0
  53. {rdbpython-0.2.1/tests/performance/rocksdb → rdbpython-0.2.3/tests/functional}/__init__.py +0 -0
  54. {rdbpython-0.2.1/tests/unit/rocksdb → rdbpython-0.2.3/tests/functional}/test_db.py +0 -0
  55. {rdbpython-0.2.1/tests/unit/rocksdb → rdbpython-0.2.3/tests/functional}/test_memtable.py +0 -0
  56. {rdbpython-0.2.1/tests/unit/rocksdb → rdbpython-0.2.3/tests/functional}/test_options.py +0 -0
  57. {rdbpython-0.2.1/tests/unit/rocksdb → rdbpython-0.2.3/tests/functional}/test_transaction.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rdbpython
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Python bindings for RocksDB with Cython
5
5
  Author-email: Gor Arakelyan <gorarkln@gmail.com>
6
6
  Maintainer-email: Gor Arakelyan <gorarkln@gmail.com>
@@ -27,7 +27,6 @@ Classifier: Topic :: Database
27
27
  Requires-Python: >=3.9
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE.md
30
- Requires-Dist: attrs
31
30
  Provides-Extra: dev
32
31
  Requires-Dist: ruff>=0.1.0; extra == "dev"
33
32
  Requires-Dist: pre-commit>=3.0.0; extra == "dev"
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
10
10
  # ============================================================================
11
11
  [project]
12
12
  name = "rdbpython"
13
- version = "0.2.1"
13
+ version = "0.2.3"
14
14
  description = "Python bindings for RocksDB with Cython"
15
15
  readme = "README.md"
16
16
  license = "MIT"
@@ -44,9 +44,7 @@ classifiers = [
44
44
  "Topic :: Database",
45
45
  ]
46
46
  requires-python = ">=3.9"
47
- dependencies = [
48
- "attrs",
49
- ]
47
+ dependencies = []
50
48
 
51
49
  [project.urls]
52
50
  Homepage = "https://github.com/everyabc/rdbpy"
@@ -288,6 +286,11 @@ convention = "google"
288
286
  "D", # docstrings not required in tests
289
287
  "ANN", # type annotations not required in tests
290
288
  ]
289
+ "bench/**/*.py" = [
290
+ "T20", # print allowed in benchmarks
291
+ "D", # docstrings not required in benchmarks
292
+ "ANN", # type annotations not required in benchmarks
293
+ ]
291
294
  "setup.py" = [
292
295
  "T20", # print allowed in setup
293
296
  "D", # docstrings not required in setup
@@ -54,7 +54,7 @@ export PREFIX="$RDBPY_DEP_DIR"
54
54
  # ==============================================================================
55
55
  echo "Building zlib..."
56
56
  ZLIB_VERSION="1.3.1"
57
- curl -L "https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz" -o "zlib-${ZLIB_VERSION}.tar.gz"
57
+ curl -L "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o "zlib-${ZLIB_VERSION}.tar.gz"
58
58
  tar xzf "zlib-${ZLIB_VERSION}.tar.gz"
59
59
  cd "zlib-${ZLIB_VERSION}"
60
60
  ./configure --prefix="$PREFIX"
@@ -60,7 +60,7 @@ rewrite_dep_rpath() {
60
60
  # zlib
61
61
  echo "Building zlib..."
62
62
  ZLIB_VERSION="1.3.1"
63
- curl -L "https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz" -o "zlib-${ZLIB_VERSION}.tar.gz"
63
+ curl -L "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" -o "zlib-${ZLIB_VERSION}.tar.gz"
64
64
  tar xzf "zlib-${ZLIB_VERSION}.tar.gz"
65
65
  cd "zlib-${ZLIB_VERSION}"
66
66
  ./configure --prefix="$PREFIX"
@@ -591,7 +591,16 @@ cdef class BlockBasedTableFactory(PyTableFactory):
591
591
  block_size=None,
592
592
  block_size_deviation=None,
593
593
  block_restart_interval=None,
594
- whole_key_filtering=None):
594
+ whole_key_filtering=None,
595
+ cache_index_and_filter_blocks=None,
596
+ cache_index_and_filter_blocks_with_high_priority=None,
597
+ pin_l0_filter_and_index_blocks_in_cache=None,
598
+ pin_top_level_index_and_filter=None,
599
+ partition_filters=None,
600
+ metadata_block_size=None,
601
+ format_version=None,
602
+ optimize_filters_for_memory=None,
603
+ read_amp_bytes_per_bit=None):
595
604
 
596
605
  cdef table_factory.BlockBasedTableOptions table_options
597
606
 
@@ -635,6 +644,37 @@ cdef class BlockBasedTableFactory(PyTableFactory):
635
644
  else:
636
645
  table_options.whole_key_filtering = False
637
646
 
647
+ if cache_index_and_filter_blocks is not None:
648
+ table_options.cache_index_and_filter_blocks = bool(cache_index_and_filter_blocks)
649
+
650
+ if cache_index_and_filter_blocks_with_high_priority is not None:
651
+ table_options.cache_index_and_filter_blocks_with_high_priority = bool(
652
+ cache_index_and_filter_blocks_with_high_priority
653
+ )
654
+
655
+ if pin_l0_filter_and_index_blocks_in_cache is not None:
656
+ table_options.pin_l0_filter_and_index_blocks_in_cache = bool(
657
+ pin_l0_filter_and_index_blocks_in_cache
658
+ )
659
+
660
+ if pin_top_level_index_and_filter is not None:
661
+ table_options.pin_top_level_index_and_filter = bool(pin_top_level_index_and_filter)
662
+
663
+ if partition_filters is not None:
664
+ table_options.partition_filters = bool(partition_filters)
665
+
666
+ if metadata_block_size is not None:
667
+ table_options.metadata_block_size = metadata_block_size
668
+
669
+ if format_version is not None:
670
+ table_options.format_version = format_version
671
+
672
+ if optimize_filters_for_memory is not None:
673
+ table_options.optimize_filters_for_memory = bool(optimize_filters_for_memory)
674
+
675
+ if read_amp_bytes_per_bit is not None:
676
+ table_options.read_amp_bytes_per_bit = read_amp_bytes_per_bit
677
+
638
678
  if block_cache is not None:
639
679
  table_options.block_cache = block_cache.get_cache()
640
680
 
@@ -2662,7 +2702,8 @@ cdef class Transaction(object):
2662
2702
  cpdef void commit(self):
2663
2703
  self._ensure_open()
2664
2704
  cdef Status st
2665
- st = self.txn.Commit()
2705
+ with nogil:
2706
+ st = self.txn.Commit()
2666
2707
  self.closed = True
2667
2708
  self.txn = NULL # Pointer invalid after commit
2668
2709
  check_status(st)
@@ -2673,7 +2714,8 @@ cdef class Transaction(object):
2673
2714
  if self.txn == NULL:
2674
2715
  return
2675
2716
  cdef Status st
2676
- st = self.txn.Rollback()
2717
+ with nogil:
2718
+ st = self.txn.Rollback()
2677
2719
  self.closed = True
2678
2720
  self.txn = NULL # Pointer invalid after rollback
2679
2721
  check_status(st)
@@ -2746,9 +2788,11 @@ cdef class Transaction(object):
2746
2788
  cdef db.ColumnFamilyHandle* cf_handle
2747
2789
  if column_family is not None:
2748
2790
  cf_handle = column_family.get_handle()
2749
- st = self.txn.Put(cf_handle, c_key, c_value, assume_tracked)
2791
+ with nogil:
2792
+ st = self.txn.Put(cf_handle, c_key, c_value, assume_tracked)
2750
2793
  else:
2751
- st = self.txn.Put(c_key, c_value)
2794
+ with nogil:
2795
+ st = self.txn.Put(c_key, c_value)
2752
2796
  check_status(st)
2753
2797
 
2754
2798
  cpdef void merge(self, bytes key, bytes value, ColumnFamilyHandle column_family = None, cpp_bool assume_tracked = False):
@@ -2759,9 +2803,11 @@ cdef class Transaction(object):
2759
2803
  cdef db.ColumnFamilyHandle* cf_handle
2760
2804
  if column_family is not None:
2761
2805
  cf_handle = column_family.get_handle()
2762
- st = self.txn.Merge(cf_handle, c_key, c_value, assume_tracked)
2806
+ with nogil:
2807
+ st = self.txn.Merge(cf_handle, c_key, c_value, assume_tracked)
2763
2808
  else:
2764
- st = self.txn.Merge(c_key, c_value)
2809
+ with nogil:
2810
+ st = self.txn.Merge(c_key, c_value)
2765
2811
  check_status(st)
2766
2812
 
2767
2813
  cpdef void delete_single(self, bytes key, ColumnFamilyHandle column_family = None, cpp_bool assume_tracked = False):
@@ -2771,9 +2817,11 @@ cdef class Transaction(object):
2771
2817
  cdef db.ColumnFamilyHandle* cf_handle
2772
2818
  if column_family is not None:
2773
2819
  cf_handle = column_family.get_handle()
2774
- st = self.txn.Delete(cf_handle, c_key, assume_tracked)
2820
+ with nogil:
2821
+ st = self.txn.Delete(cf_handle, c_key, assume_tracked)
2775
2822
  else:
2776
- st = self.txn.Delete(c_key)
2823
+ with nogil:
2824
+ st = self.txn.Delete(c_key)
2777
2825
  check_status(st)
2778
2826
 
2779
2827
  cpdef get(self, bytes key, ColumnFamilyHandle column_family = None):
@@ -2781,10 +2829,12 @@ cdef class Transaction(object):
2781
2829
  cdef Status st
2782
2830
  cdef string res
2783
2831
  cdef options.ReadOptions opts
2832
+ cdef Slice c_key = bytes_to_slice(key)
2784
2833
  cdef db.ColumnFamilyHandle* cf_handle = self.db.db.DefaultColumnFamily()
2785
2834
  if column_family is not None:
2786
2835
  cf_handle = column_family.get_handle()
2787
- st = self.txn.Get(opts, cf_handle, bytes_to_slice(key), cython.address(res))
2836
+ with nogil:
2837
+ st = self.txn.Get(opts, cf_handle, c_key, cython.address(res))
2788
2838
 
2789
2839
  if st.ok():
2790
2840
  return string_to_bytes(res)
@@ -27,6 +27,15 @@ cdef extern from "rocksdb/table.h" namespace "rocksdb":
27
27
  int block_size_deviation
28
28
  int block_restart_interval
29
29
  cpp_bool whole_key_filtering
30
+ cpp_bool cache_index_and_filter_blocks
31
+ cpp_bool cache_index_and_filter_blocks_with_high_priority
32
+ cpp_bool pin_l0_filter_and_index_blocks_in_cache
33
+ cpp_bool pin_top_level_index_and_filter
34
+ cpp_bool partition_filters
35
+ size_t metadata_block_size
36
+ uint32_t format_version
37
+ cpp_bool optimize_filters_for_memory
38
+ int read_amp_bytes_per_bit
30
39
  shared_ptr[Cache] block_cache
31
40
  shared_ptr[Cache] block_cache_compressed
32
41
  shared_ptr[FilterPolicy] filter_policy
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rdbpython
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Python bindings for RocksDB with Cython
5
5
  Author-email: Gor Arakelyan <gorarkln@gmail.com>
6
6
  Maintainer-email: Gor Arakelyan <gorarkln@gmail.com>
@@ -27,7 +27,6 @@ Classifier: Topic :: Database
27
27
  Requires-Python: >=3.9
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE.md
30
- Requires-Dist: attrs
31
30
  Provides-Extra: dev
32
31
  Requires-Dist: ruff>=0.1.0; extra == "dev"
33
32
  Requires-Dist: pre-commit>=3.0.0; extra == "dev"
@@ -47,9 +47,8 @@ src/rdbpython.egg-info/not-zip-safe
47
47
  src/rdbpython.egg-info/requires.txt
48
48
  src/rdbpython.egg-info/top_level.txt
49
49
  tests/conftest.py
50
- tests/performance/rocksdb/__init__.py
51
- tests/unit/rocksdb/__init__.py
52
- tests/unit/rocksdb/test_db.py
53
- tests/unit/rocksdb/test_memtable.py
54
- tests/unit/rocksdb/test_options.py
55
- tests/unit/rocksdb/test_transaction.py
50
+ tests/functional/__init__.py
51
+ tests/functional/test_db.py
52
+ tests/functional/test_memtable.py
53
+ tests/functional/test_options.py
54
+ tests/functional/test_transaction.py
@@ -1,4 +1,3 @@
1
- attrs
2
1
 
3
2
  [all]
4
3
  rdbpy[cython,dev,test]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes