slatedb 0.5.0-aarch64-linux → 0.6.1-aarch64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed29074506d3ec0998e585cf316ce03e2518aab3e42ec26704e2f41cb2df6f25
4
- data.tar.gz: 18a4c04c383ea51511db610953a055d4416ae41a1acb21ad44cd743a6d617ee2
3
+ metadata.gz: f94b5f32f05b9d21536aa9441c17e42539db489eae97aa46556f35dfa699b7dd
4
+ data.tar.gz: 1620d5a46e797daf8de95d821415be96a5fc6c80e4f97a278b07a1032ae1c240
5
5
  SHA512:
6
- metadata.gz: 7d54388635318353eaf700ef410c1aed4fd2c2a2ff434ad5e6cba98d5046ec6e6e1c8968f62be9e44b35336b64364972ad8336c54a248496425533caf82d1fe4
7
- data.tar.gz: f4e74b56361d0b76f395704554ed50c180a05629ef9329599b1e938ed562a74a65a3ca33273481fb6976ccae2e0f10076fae150e980728ae9b786067eb99b74d
6
+ metadata.gz: ce0bef97705696cf225053c27f088e5c3dabe30f0d05f358e7a71d405e39fe2b7f864c5d0d29e57f74636e6d7eb1319ed05b9d12eed107dfc8410c86e4c4cafa
7
+ data.tar.gz: cf8eaa8427cdd8d9346635fe7c1463cf5be0a05256da13e3679105e371d5cc7c82e383c357c7c0dd092f0f745581ac4e0b4ef1404967a07631ec1d95542e00cf
data/README.md CHANGED
@@ -64,6 +64,34 @@ SlateDb::Database.open("/tmp/mydb") do |db|
64
64
  end # automatically closed
65
65
  ```
66
66
 
67
+ ### Compaction Controls
68
+
69
+ SlateDB 0.17 adds controls for how long compaction inputs remain protected from
70
+ garbage collection and when to consolidate sorted runs:
71
+
72
+ ```ruby
73
+ SlateDb::Database.open("mydb",
74
+ url: "s3://mybucket/path",
75
+ compactor_checkpoint_lifetime: 30 * 60_000,
76
+ sorted_run_consolidation_threshold: 8) do |db|
77
+ db.put("key", "value")
78
+ end
79
+ ```
80
+
81
+ `compactor_checkpoint_lifetime` is in milliseconds and defaults to 15 minutes.
82
+ Reads, scans, snapshots, and transactions using old compaction inputs must finish
83
+ within that time; after it expires, garbage collection can remove those inputs.
84
+
85
+ `sorted_run_consolidation_threshold` starts fallback consolidation when the
86
+ projected sorted-run count exceeds the threshold. It is not a hard limit.
87
+ Zero disables it (the default); use at least two to enable it. SlateDB warns and
88
+ disables the trigger for one. Low thresholds can increase storage reads and writes.
89
+
90
+ ### Key Size
91
+
92
+ Keys can now exceed the previous 65,535-byte limit, up to SlateDB's new
93
+ 4,294,967,295-byte limit. Very large keys still require enough memory to process.
94
+
67
95
  ### Persistent Storage
68
96
 
69
97
  For persistent storage, provide an object store URL:
@@ -501,6 +529,14 @@ SlateDb::Reader.open("/tmp/mydb", url: "s3://bucket/path") do |reader|
501
529
  reader.scan("prefix:").each do |k, v|
502
530
  puts "#{k}: #{v}"
503
531
  end
532
+
533
+ # Range and prefix scans accept :asc/:ascending or :desc/:descending.
534
+ reader.scan("user:100", "user:200", order: :desc).each do |k, v|
535
+ puts "#{k}: #{v}"
536
+ end
537
+ reader.scan_prefix("user:", from: "100", to: "200", order: :desc).each do |k, v|
538
+ puts "#{k}: #{v}"
539
+ end
504
540
  end
505
541
 
506
542
  # Open at a specific checkpoint (pins the reader to that checkpoint's state)
Binary file
Binary file
Binary file
@@ -12,6 +12,12 @@ module SlateDb
12
12
  # @param merge_operator [Symbol, String, Proc, nil] Optional merge operator.
13
13
  # Can be a symbol/string ("string_concat" or "concat") or a Proc/lambda
14
14
  # that takes (key, existing_value, new_value) and returns the merged value.
15
+ # @param compactor_checkpoint_lifetime [Integer, nil] How long compaction inputs
16
+ # are protected from garbage collection, in milliseconds (default: 15 minutes).
17
+ # Reads using those inputs must finish within this time.
18
+ # @param sorted_run_consolidation_threshold [Integer, nil] Sorted-run count above
19
+ # which fallback consolidation starts. Zero disables it (default); use at least
20
+ # two to enable it. One is disabled by SlateDB with a warning. This is not a hard limit.
15
21
  # @yield [db] If a block is given, yields the database and ensures it's closed
16
22
  # @return [Database] The opened database (or block result if block given)
17
23
  #
@@ -38,8 +44,12 @@ module SlateDb
38
44
  # db.merge("counter", "3")
39
45
  # db.get("counter") # => "8"
40
46
  #
41
- def open(path, url: nil, merge_operator: nil)
42
- opts = {}
47
+ def open(path, url: nil, merge_operator: nil,
48
+ compactor_checkpoint_lifetime: nil, sorted_run_consolidation_threshold: nil)
49
+ opts = {
50
+ compactor_checkpoint_lifetime: compactor_checkpoint_lifetime,
51
+ sorted_run_consolidation_threshold: sorted_run_consolidation_threshold
52
+ }.compact
43
53
 
44
54
  case merge_operator
45
55
  when Symbol, String
@@ -106,16 +106,19 @@ module SlateDb
106
106
  #
107
107
  # @param start_key [String] The start key (inclusive)
108
108
  # @param end_key [String, nil] The end key (exclusive)
109
+ # @param order [Symbol, String, nil] Iteration order (:asc/:ascending or :desc/:descending)
109
110
  # @return [Iterator] An iterator over key-value pairs
110
111
  #
111
112
  def scan(start_key, end_key = nil, durability_filter: nil, dirty: nil,
112
- read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, &)
113
- opts = {}
114
- opts[:durability_filter] = durability_filter.to_s if durability_filter
115
- opts[:dirty] = dirty unless dirty.nil?
116
- opts[:read_ahead_bytes] = read_ahead_bytes if read_ahead_bytes
117
- opts[:cache_blocks] = cache_blocks unless cache_blocks.nil?
118
- opts[:max_fetch_tasks] = max_fetch_tasks if max_fetch_tasks
113
+ read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, order: nil, &)
114
+ opts = {
115
+ durability_filter: durability_filter&.to_s,
116
+ dirty: dirty,
117
+ read_ahead_bytes: read_ahead_bytes,
118
+ cache_blocks: cache_blocks,
119
+ max_fetch_tasks: max_fetch_tasks,
120
+ order: order&.to_s
121
+ }.compact
119
122
 
120
123
  iter = if opts.empty?
121
124
  _scan(start_key, end_key)
@@ -138,6 +141,7 @@ module SlateDb
138
141
  # @param read_ahead_bytes [Integer, nil] Number of bytes to read ahead
139
142
  # @param cache_blocks [Boolean, nil] Whether to cache blocks
140
143
  # @param max_fetch_tasks [Integer, nil] Maximum number of fetch tasks
144
+ # @param order [Symbol, String, nil] Iteration order (:asc/:ascending or :desc/:descending)
141
145
  # @param from [String, nil] Inclusive lower bound suffix, appended to the
142
146
  # prefix, to start scanning from (e.g. prefix "user:" with from "100"
143
147
  # starts at "user:100"). Defaults to the start of the prefix.
@@ -146,7 +150,7 @@ module SlateDb
146
150
  # @return [Iterator] An iterator over key-value pairs
147
151
  #
148
152
  def scan_prefix(prefix, durability_filter: nil, dirty: nil,
149
- read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil,
153
+ read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, order: nil,
150
154
  from: nil, to: nil, &)
151
155
  opts = {
152
156
  durability_filter: durability_filter&.to_s,
@@ -154,6 +158,7 @@ module SlateDb
154
158
  read_ahead_bytes: read_ahead_bytes,
155
159
  cache_blocks: cache_blocks,
156
160
  max_fetch_tasks: max_fetch_tasks,
161
+ order: order&.to_s,
157
162
  subrange_from: from,
158
163
  subrange_to: to
159
164
  }.compact
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SlateDb
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slatedb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - SlateDB Contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-26 00:00:00.000000000 Z
11
+ date: 2026-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.86'
61
+ version: '1.92'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.86'
68
+ version: '1.92'
69
69
  description: A cloud-native embedded key-value store built on object storage
70
70
  email:
71
71
  - slatedb@example.com