cassandra 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -1
- data/Rakefile +1 -1
- data/cassandra.gemspec +4 -4
- data/lib/cassandra.rb +1 -1
- data/lib/cassandra/cassandra.rb +6 -3
- data/lib/cassandra/mock.rb +7 -1
- data/test/cassandra_test.rb +4 -3
- metadata +6 -6
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
v0.12.1
|
2
|
+
- Fix issue with simple_uuid dependency.
|
3
|
+
- Fix issue with get_range & get_range_batch keeping all results when a block is given. Resolves Issue# 112.
|
4
|
+
|
1
5
|
v0.12.0 Changed thrift_client dependency to 0.7.0
|
2
6
|
|
3
7
|
v0.11.4
|
@@ -64,7 +68,7 @@ v0.7.2 Switch to newly-extraced simple_uuid gem, minor bugfixes.
|
|
64
68
|
|
65
69
|
v0.7.1 update thrift-generated code to 0.5
|
66
70
|
|
67
|
-
v0.7 Various improvements.
|
71
|
+
v0.7 Various improvements.
|
68
72
|
- Compatibility with Cassandra 0.5.
|
69
73
|
- performance improvements
|
70
74
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ unless ENV['FROM_BIN_CASSANDRA_HELPER']
|
|
9
9
|
p.project = "fauna"
|
10
10
|
p.summary = "A Ruby client for the Cassandra distributed database."
|
11
11
|
p.rubygems_version = ">= 0.8"
|
12
|
-
p.dependencies = ['thrift_client >=0.7.0', 'json', 'rake', 'simple_uuid >=0.
|
12
|
+
p.dependencies = ['thrift_client >=0.7.0', 'json', 'rake', 'simple_uuid >=0.2.0']
|
13
13
|
p.ignore_pattern = /^(data|vendor\/cassandra|cassandra|vendor\/thrift|.*\.rbc)/
|
14
14
|
p.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
|
15
15
|
p.retain_gemspec = true
|
data/cassandra.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{cassandra}
|
5
|
-
s.version = "0.12.
|
5
|
+
s.version = "0.12.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [%q{Evan Weaver, Ryan King}]
|
@@ -27,17 +27,17 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_runtime_dependency(%q<thrift_client>, [">= 0.7.0"])
|
28
28
|
s.add_runtime_dependency(%q<json>, [">= 0"])
|
29
29
|
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
30
|
-
s.add_runtime_dependency(%q<simple_uuid>, [">= 0.
|
30
|
+
s.add_runtime_dependency(%q<simple_uuid>, [">= 0.2.0"])
|
31
31
|
else
|
32
32
|
s.add_dependency(%q<thrift_client>, [">= 0.7.0"])
|
33
33
|
s.add_dependency(%q<json>, [">= 0"])
|
34
34
|
s.add_dependency(%q<rake>, [">= 0"])
|
35
|
-
s.add_dependency(%q<simple_uuid>, [">= 0.
|
35
|
+
s.add_dependency(%q<simple_uuid>, [">= 0.2.0"])
|
36
36
|
end
|
37
37
|
else
|
38
38
|
s.add_dependency(%q<thrift_client>, [">= 0.7.0"])
|
39
39
|
s.add_dependency(%q<json>, [">= 0"])
|
40
40
|
s.add_dependency(%q<rake>, [">= 0"])
|
41
|
-
s.add_dependency(%q<simple_uuid>, [">= 0.
|
41
|
+
s.add_dependency(%q<simple_uuid>, [">= 0.2.0"])
|
42
42
|
end
|
43
43
|
end
|
data/lib/cassandra.rb
CHANGED
data/lib/cassandra/cassandra.rb
CHANGED
@@ -764,14 +764,17 @@ class Cassandra
|
|
764
764
|
next if result.length == count
|
765
765
|
|
766
766
|
unless columns == {}
|
767
|
-
|
768
|
-
|
767
|
+
if block_given?
|
768
|
+
yield key, columns
|
769
|
+
else
|
770
|
+
result[key] = columns
|
771
|
+
end
|
769
772
|
end
|
770
773
|
last_key = key
|
771
774
|
end
|
772
775
|
end
|
773
776
|
|
774
|
-
result
|
777
|
+
result if !block_given?
|
775
778
|
end
|
776
779
|
|
777
780
|
##
|
data/lib/cassandra/mock.rb
CHANGED
@@ -204,7 +204,7 @@ class Cassandra
|
|
204
204
|
:reversed => false
|
205
205
|
)
|
206
206
|
)
|
207
|
-
_get_range(column_family,
|
207
|
+
res = _get_range(column_family,
|
208
208
|
options[:start_key],
|
209
209
|
options[:finish_key],
|
210
210
|
options[:key_count],
|
@@ -214,6 +214,12 @@ class Cassandra
|
|
214
214
|
options[:count],
|
215
215
|
options[:consistency],
|
216
216
|
options[:reversed], &blk)
|
217
|
+
|
218
|
+
if blk.nil?
|
219
|
+
res
|
220
|
+
else
|
221
|
+
nil
|
222
|
+
end
|
217
223
|
end
|
218
224
|
|
219
225
|
def get_range_keys(column_family, options = {})
|
data/test/cassandra_test.rb
CHANGED
@@ -286,13 +286,14 @@ class CassandraTest < Test::Unit::TestCase
|
|
286
286
|
|
287
287
|
values = (0..4).collect{|n| { :key => "test_get_range_block#{n}", :columns => { "body-#{n}" => "v" }} }.reverse
|
288
288
|
|
289
|
-
@twitter.get_range(:Statuses, :start_key => k.to_s, :key_count => 5)
|
289
|
+
returned_value = @twitter.get_range(:Statuses, :start_key => k.to_s, :key_count => 5) do |key,columns|
|
290
290
|
expected = values.pop
|
291
291
|
assert_equal expected[:key], key
|
292
292
|
assert_equal expected[:columns], columns
|
293
|
-
|
294
|
-
assert_equal [],values
|
293
|
+
end
|
295
294
|
|
295
|
+
assert_equal [], values
|
296
|
+
assert_nil returned_value
|
296
297
|
end
|
297
298
|
|
298
299
|
def test_get_range_reversed
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cassandra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 0.12.
|
9
|
+
- 1
|
10
|
+
version: 0.12.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Evan Weaver, Ryan King
|
@@ -69,12 +69,12 @@ dependencies:
|
|
69
69
|
requirements:
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
hash:
|
72
|
+
hash: 23
|
73
73
|
segments:
|
74
74
|
- 0
|
75
|
-
-
|
75
|
+
- 2
|
76
76
|
- 0
|
77
|
-
version: 0.
|
77
|
+
version: 0.2.0
|
78
78
|
type: :runtime
|
79
79
|
version_requirements: *id004
|
80
80
|
description: A Ruby client for the Cassandra distributed database.
|