slatedb 0.5.0 → 0.7.0
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 +4 -4
- data/README.md +150 -44
- data/ext/slatedb/Cargo.toml +7 -8
- data/ext/slatedb/src/checkpoint.rs +47 -0
- data/ext/slatedb/src/database.rs +61 -19
- data/ext/slatedb/src/lib.rs +2 -0
- data/ext/slatedb/src/merge_ops.rs +2 -185
- data/ext/slatedb/src/reader.rs +21 -6
- data/ext/slatedb/src/runtime.rs +1 -52
- data/ext/slatedb/src/snapshot.rs +4 -0
- data/ext/slatedb/src/transaction.rs +4 -0
- data/lib/slatedb/database.rb +51 -27
- data/lib/slatedb/reader.rb +38 -27
- data/lib/slatedb/snapshot.rb +17 -9
- data/lib/slatedb/transaction.rb +17 -9
- data/lib/slatedb/version.rb +1 -1
- metadata +6 -5
data/lib/slatedb/snapshot.rb
CHANGED
|
@@ -8,13 +8,16 @@ module SlateDb
|
|
|
8
8
|
# @param durability_filter [String, nil] Filter by durability level
|
|
9
9
|
# @param dirty [Boolean, nil] Whether to include uncommitted data
|
|
10
10
|
# @param cache_blocks [Boolean, nil] Whether to cache blocks
|
|
11
|
+
# @param max_concurrent_sources [Integer, nil] Concurrent sources after the first
|
|
12
|
+
# miss (default: 1; zero also means serial fetching).
|
|
11
13
|
# @return [String, nil] The value, or nil if not found
|
|
12
14
|
#
|
|
13
|
-
def get(key, durability_filter: nil, dirty: nil, cache_blocks: nil)
|
|
15
|
+
def get(key, durability_filter: nil, dirty: nil, cache_blocks: nil, max_concurrent_sources: nil)
|
|
14
16
|
opts = {}
|
|
15
17
|
opts[:durability_filter] = durability_filter.to_s if durability_filter
|
|
16
18
|
opts[:dirty] = dirty unless dirty.nil?
|
|
17
19
|
opts[:cache_blocks] = cache_blocks unless cache_blocks.nil?
|
|
20
|
+
opts[:max_concurrent_sources] = max_concurrent_sources unless max_concurrent_sources.nil?
|
|
18
21
|
|
|
19
22
|
if opts.empty?
|
|
20
23
|
_get(key)
|
|
@@ -27,16 +30,19 @@ module SlateDb
|
|
|
27
30
|
#
|
|
28
31
|
# @param start_key [String] The start key (inclusive)
|
|
29
32
|
# @param end_key [String, nil] The end key (exclusive)
|
|
33
|
+
# @param order [Symbol, String, nil] :asc/:ascending or :desc/:descending
|
|
30
34
|
# @return [Iterator] An iterator over key-value pairs
|
|
31
35
|
#
|
|
32
36
|
def scan(start_key, end_key = nil, durability_filter: nil, dirty: nil,
|
|
33
|
-
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, &)
|
|
34
|
-
opts = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, order: nil, &)
|
|
38
|
+
opts = {
|
|
39
|
+
durability_filter: durability_filter&.to_s,
|
|
40
|
+
dirty: dirty,
|
|
41
|
+
read_ahead_bytes: read_ahead_bytes,
|
|
42
|
+
cache_blocks: cache_blocks,
|
|
43
|
+
max_fetch_tasks: max_fetch_tasks,
|
|
44
|
+
order: order&.to_s
|
|
45
|
+
}.compact
|
|
40
46
|
|
|
41
47
|
iter = if opts.empty?
|
|
42
48
|
_scan(start_key, end_key)
|
|
@@ -59,6 +65,7 @@ module SlateDb
|
|
|
59
65
|
# @param read_ahead_bytes [Integer, nil] Number of bytes to read ahead
|
|
60
66
|
# @param cache_blocks [Boolean, nil] Whether to cache blocks
|
|
61
67
|
# @param max_fetch_tasks [Integer, nil] Maximum number of fetch tasks
|
|
68
|
+
# @param order [Symbol, String, nil] :asc/:ascending or :desc/:descending
|
|
62
69
|
# @param from [String, nil] Inclusive lower bound suffix, appended to the
|
|
63
70
|
# prefix, to start scanning from. Defaults to the start of the prefix.
|
|
64
71
|
# @param to [String, nil] Exclusive upper bound suffix, appended to the
|
|
@@ -66,7 +73,7 @@ module SlateDb
|
|
|
66
73
|
# @return [Iterator] An iterator over key-value pairs
|
|
67
74
|
#
|
|
68
75
|
def scan_prefix(prefix, durability_filter: nil, dirty: nil,
|
|
69
|
-
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil,
|
|
76
|
+
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, order: nil,
|
|
70
77
|
from: nil, to: nil, &)
|
|
71
78
|
opts = {
|
|
72
79
|
durability_filter: durability_filter&.to_s,
|
|
@@ -74,6 +81,7 @@ module SlateDb
|
|
|
74
81
|
read_ahead_bytes: read_ahead_bytes,
|
|
75
82
|
cache_blocks: cache_blocks,
|
|
76
83
|
max_fetch_tasks: max_fetch_tasks,
|
|
84
|
+
order: order&.to_s,
|
|
77
85
|
subrange_from: from,
|
|
78
86
|
subrange_to: to
|
|
79
87
|
}.compact
|
data/lib/slatedb/transaction.rb
CHANGED
|
@@ -8,13 +8,16 @@ module SlateDb
|
|
|
8
8
|
# @param durability_filter [String, nil] Filter by durability level
|
|
9
9
|
# @param dirty [Boolean, nil] Whether to include uncommitted data
|
|
10
10
|
# @param cache_blocks [Boolean, nil] Whether to cache blocks
|
|
11
|
+
# @param max_concurrent_sources [Integer, nil] Concurrent sources after the first
|
|
12
|
+
# miss (default: 1; zero also means serial fetching).
|
|
11
13
|
# @return [String, nil] The value, or nil if not found
|
|
12
14
|
#
|
|
13
|
-
def get(key, durability_filter: nil, dirty: nil, cache_blocks: nil)
|
|
15
|
+
def get(key, durability_filter: nil, dirty: nil, cache_blocks: nil, max_concurrent_sources: nil)
|
|
14
16
|
opts = {}
|
|
15
17
|
opts[:durability_filter] = durability_filter.to_s if durability_filter
|
|
16
18
|
opts[:dirty] = dirty unless dirty.nil?
|
|
17
19
|
opts[:cache_blocks] = cache_blocks unless cache_blocks.nil?
|
|
20
|
+
opts[:max_concurrent_sources] = max_concurrent_sources unless max_concurrent_sources.nil?
|
|
18
21
|
|
|
19
22
|
if opts.empty?
|
|
20
23
|
_get(key)
|
|
@@ -66,16 +69,19 @@ module SlateDb
|
|
|
66
69
|
#
|
|
67
70
|
# @param start_key [String] The start key (inclusive)
|
|
68
71
|
# @param end_key [String, nil] The end key (exclusive)
|
|
72
|
+
# @param order [Symbol, String, nil] :asc/:ascending or :desc/:descending
|
|
69
73
|
# @return [Iterator] An iterator over key-value pairs
|
|
70
74
|
#
|
|
71
75
|
def scan(start_key, end_key = nil, durability_filter: nil, dirty: nil,
|
|
72
|
-
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, &)
|
|
73
|
-
opts = {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, order: nil, &)
|
|
77
|
+
opts = {
|
|
78
|
+
durability_filter: durability_filter&.to_s,
|
|
79
|
+
dirty: dirty,
|
|
80
|
+
read_ahead_bytes: read_ahead_bytes,
|
|
81
|
+
cache_blocks: cache_blocks,
|
|
82
|
+
max_fetch_tasks: max_fetch_tasks,
|
|
83
|
+
order: order&.to_s
|
|
84
|
+
}.compact
|
|
79
85
|
|
|
80
86
|
iter = if opts.empty?
|
|
81
87
|
_scan(start_key, end_key)
|
|
@@ -98,6 +104,7 @@ module SlateDb
|
|
|
98
104
|
# @param read_ahead_bytes [Integer, nil] Number of bytes to read ahead
|
|
99
105
|
# @param cache_blocks [Boolean, nil] Whether to cache blocks
|
|
100
106
|
# @param max_fetch_tasks [Integer, nil] Maximum number of fetch tasks
|
|
107
|
+
# @param order [Symbol, String, nil] :asc/:ascending or :desc/:descending
|
|
101
108
|
# @param from [String, nil] Inclusive lower bound suffix, appended to the
|
|
102
109
|
# prefix, to start scanning from. Defaults to the start of the prefix.
|
|
103
110
|
# @param to [String, nil] Exclusive upper bound suffix, appended to the
|
|
@@ -105,7 +112,7 @@ module SlateDb
|
|
|
105
112
|
# @return [Iterator] An iterator over key-value pairs
|
|
106
113
|
#
|
|
107
114
|
def scan_prefix(prefix, durability_filter: nil, dirty: nil,
|
|
108
|
-
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil,
|
|
115
|
+
read_ahead_bytes: nil, cache_blocks: nil, max_fetch_tasks: nil, order: nil,
|
|
109
116
|
from: nil, to: nil, &)
|
|
110
117
|
opts = {
|
|
111
118
|
durability_filter: durability_filter&.to_s,
|
|
@@ -113,6 +120,7 @@ module SlateDb
|
|
|
113
120
|
read_ahead_bytes: read_ahead_bytes,
|
|
114
121
|
cache_blocks: cache_blocks,
|
|
115
122
|
max_fetch_tasks: max_fetch_tasks,
|
|
123
|
+
order: order&.to_s,
|
|
116
124
|
subrange_from: from,
|
|
117
125
|
subrange_to: to
|
|
118
126
|
}.compact
|
data/lib/slatedb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slatedb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SlateDB Contributors
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.9.
|
|
18
|
+
version: 0.9.130
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.9.
|
|
25
|
+
version: 0.9.130
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rake
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -71,14 +71,14 @@ dependencies:
|
|
|
71
71
|
requirements:
|
|
72
72
|
- - "~>"
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '1.
|
|
74
|
+
version: '1.92'
|
|
75
75
|
type: :development
|
|
76
76
|
prerelease: false
|
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
|
79
79
|
- - "~>"
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '1.
|
|
81
|
+
version: '1.92'
|
|
82
82
|
description: A cloud-native embedded key-value store built on object storage
|
|
83
83
|
email:
|
|
84
84
|
- slatedb@example.com
|
|
@@ -93,6 +93,7 @@ files:
|
|
|
93
93
|
- ext/slatedb/Cargo.toml
|
|
94
94
|
- ext/slatedb/extconf.rb
|
|
95
95
|
- ext/slatedb/src/admin.rs
|
|
96
|
+
- ext/slatedb/src/checkpoint.rs
|
|
96
97
|
- ext/slatedb/src/database.rs
|
|
97
98
|
- ext/slatedb/src/errors.rs
|
|
98
99
|
- ext/slatedb/src/iterator.rs
|