cassandra 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +15 -0
- data/Gemfile +8 -0
- data/Manifest +18 -0
- data/Rakefile +2 -1
- data/cassandra.gemspec +13 -9
- data/conf/0.6/schema.json +2 -2
- data/conf/0.6/storage-conf.xml +18 -18
- data/conf/0.8/schema.json +3 -0
- data/conf/0.8/schema.txt +7 -1
- data/conf/1.0/cassandra.in.sh +41 -0
- data/conf/1.0/cassandra.yaml +415 -0
- data/conf/1.0/log4j-server.properties +40 -0
- data/conf/1.0/schema.json +72 -0
- data/conf/1.0/schema.txt +57 -0
- data/ext/cassandra_native.c +34 -0
- data/ext/extconf.rb +9 -0
- data/lib/cassandra.rb +1 -0
- data/lib/cassandra/0.6/protocol.rb +10 -9
- data/lib/cassandra/cassandra.rb +32 -25
- data/lib/cassandra/columns.rb +38 -13
- data/lib/cassandra/composite.rb +37 -15
- data/lib/cassandra/dynamic_composite.rb +96 -0
- data/lib/cassandra/mock.rb +23 -14
- data/test/cassandra_mock_test.rb +6 -0
- data/test/cassandra_test.rb +390 -49
- data/test/composite_type_test.rb +42 -7
- metadata +47 -21
data/test/composite_type_test.rb
CHANGED
@@ -6,19 +6,28 @@ class CompositeTypesTest < Test::Unit::TestCase
|
|
6
6
|
def setup
|
7
7
|
@col_parts = [[363].pack('N'), 'extradites-mulling', SimpleUUID::UUID.new().bytes]
|
8
8
|
@col = Cassandra::Composite.new(*@col_parts)
|
9
|
+
|
10
|
+
@part0_length = 2 + 4 + 1 # size + int + end_term
|
11
|
+
@part1_length = 2 + @col_parts[1].length + 1 # size + string_len + end_term
|
12
|
+
@part2_length = 2 + @col_parts[2].length + 1 # size + uuid_bytes + end_term
|
13
|
+
|
14
|
+
@types = ['IntegerType', 'UTF8Type', 'TimeUUIDType']
|
15
|
+
@type_aliaes = ['i', 's', 't']
|
16
|
+
|
17
|
+
@dycol = Cassandra::DynamicComposite.new(*@types.zip(@col_parts))
|
18
|
+
@dycol_alias = Cassandra::DynamicComposite.new(*@type_aliaes.zip(@col_parts))
|
9
19
|
end
|
10
20
|
|
11
21
|
def test_creation_from_parts
|
12
|
-
|
13
|
-
|
14
|
-
|
22
|
+
(0..2).each do |i|
|
23
|
+
assert_equal(@col_parts[i], @col[i])
|
24
|
+
assert_equal(@col_parts[i], @dycol[i])
|
25
|
+
assert_equal(@col_parts[i], @dycol_alias[i])
|
26
|
+
end
|
15
27
|
end
|
16
28
|
|
17
29
|
def test_packing_and_unpacking
|
18
|
-
part0_length
|
19
|
-
part1_length = 2 + @col_parts[1].length + 1 # size + string_len + end_term
|
20
|
-
part2_length = 2 + @col_parts[2].length + 1 # size + uuid_bytes + end_term
|
21
|
-
assert_equal(part0_length + part1_length + part2_length, @col.pack.length)
|
30
|
+
assert_equal(@part0_length + @part1_length + @part2_length, @col.pack.length)
|
22
31
|
|
23
32
|
col2 = Cassandra::Composite.new(@col.pack)
|
24
33
|
assert_equal(@col_parts[0], col2[0])
|
@@ -26,4 +35,30 @@ class CompositeTypesTest < Test::Unit::TestCase
|
|
26
35
|
assert_equal(@col_parts[2], col2[2])
|
27
36
|
assert_equal(@col, col2)
|
28
37
|
end
|
38
|
+
|
39
|
+
def test_packing_and_unpacking_dynamic_columns
|
40
|
+
part0_length = @part0_length + 2 + @types[0].length
|
41
|
+
part1_length = @part1_length + 2 + @types[1].length
|
42
|
+
part2_length = @part2_length + 2 + @types[2].length
|
43
|
+
assert_equal(part0_length + part1_length + part2_length, @dycol.pack.length)
|
44
|
+
|
45
|
+
col2 = Cassandra::DynamicComposite.new(@dycol.pack)
|
46
|
+
assert_equal(@col_parts[0], col2[0])
|
47
|
+
assert_equal(@col_parts[1], col2[1])
|
48
|
+
assert_equal(@col_parts[2], col2[2])
|
49
|
+
assert_equal(@dycol, col2)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_packing_and_unpacking_dynamic_columns_with_aliases
|
53
|
+
part0_length = @part0_length + 2
|
54
|
+
part1_length = @part1_length + 2
|
55
|
+
part2_length = @part2_length + 2
|
56
|
+
assert_equal(part0_length + part1_length + part2_length, @dycol_alias.pack.length)
|
57
|
+
|
58
|
+
col2 = Cassandra::DynamicComposite.new(@dycol_alias.pack)
|
59
|
+
assert_equal(@col_parts[0], col2[0])
|
60
|
+
assert_equal(@col_parts[1], col2[1])
|
61
|
+
assert_equal(@col_parts[2], col2[2])
|
62
|
+
assert_equal(@dycol_alias, col2)
|
63
|
+
end
|
29
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cassandra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,25 +9,25 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-06 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thrift_client
|
16
|
-
requirement: &
|
16
|
+
requirement: &70277980333560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- - <
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0.9'
|
22
19
|
- - ! '>='
|
23
20
|
- !ruby/object:Gem::Version
|
24
21
|
version: 0.7.0
|
22
|
+
- - <
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0.9'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70277980333560
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: json
|
30
|
-
requirement: &
|
30
|
+
requirement: &70277980332520 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70277980332520
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: rake
|
41
|
-
requirement: &
|
41
|
+
requirement: &70277980331940 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: '0'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70277980331940
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: simple_uuid
|
52
|
-
requirement: &
|
52
|
+
requirement: &70277980331080 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
@@ -57,17 +57,31 @@ dependencies:
|
|
57
57
|
version: 0.2.0
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70277980331080
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: echoe
|
63
|
+
requirement: &70277980330380 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: *70277980330380
|
61
72
|
description: A Ruby client for the Cassandra distributed database.
|
62
73
|
email: ''
|
63
74
|
executables:
|
64
75
|
- cassandra_helper
|
65
|
-
extensions:
|
76
|
+
extensions:
|
77
|
+
- ext/extconf.rb
|
66
78
|
extra_rdoc_files:
|
67
79
|
- CHANGELOG
|
68
80
|
- LICENSE
|
69
81
|
- README.md
|
70
82
|
- bin/cassandra_helper
|
83
|
+
- ext/cassandra_native.c
|
84
|
+
- ext/extconf.rb
|
71
85
|
- lib/cassandra.rb
|
72
86
|
- lib/cassandra/0.6.rb
|
73
87
|
- lib/cassandra/0.6/cassandra.rb
|
@@ -81,10 +95,10 @@ extra_rdoc_files:
|
|
81
95
|
- lib/cassandra/0.8/cassandra.rb
|
82
96
|
- lib/cassandra/0.8/columns.rb
|
83
97
|
- lib/cassandra/0.8/protocol.rb
|
98
|
+
- lib/cassandra/1.0.rb
|
84
99
|
- lib/cassandra/1.0/cassandra.rb
|
85
100
|
- lib/cassandra/1.0/columns.rb
|
86
101
|
- lib/cassandra/1.0/protocol.rb
|
87
|
-
- lib/cassandra/1.0.rb
|
88
102
|
- lib/cassandra/array.rb
|
89
103
|
- lib/cassandra/cassandra.rb
|
90
104
|
- lib/cassandra/column_family.rb
|
@@ -93,6 +107,7 @@ extra_rdoc_files:
|
|
93
107
|
- lib/cassandra/composite.rb
|
94
108
|
- lib/cassandra/constants.rb
|
95
109
|
- lib/cassandra/debug.rb
|
110
|
+
- lib/cassandra/dynamic_composite.rb
|
96
111
|
- lib/cassandra/helpers.rb
|
97
112
|
- lib/cassandra/keyspace.rb
|
98
113
|
- lib/cassandra/long.rb
|
@@ -102,6 +117,7 @@ extra_rdoc_files:
|
|
102
117
|
- lib/cassandra/time.rb
|
103
118
|
files:
|
104
119
|
- CHANGELOG
|
120
|
+
- Gemfile
|
105
121
|
- LICENSE
|
106
122
|
- Manifest
|
107
123
|
- README.md
|
@@ -121,6 +137,13 @@ files:
|
|
121
137
|
- conf/0.8/log4j-server.properties
|
122
138
|
- conf/0.8/schema.json
|
123
139
|
- conf/0.8/schema.txt
|
140
|
+
- conf/1.0/cassandra.in.sh
|
141
|
+
- conf/1.0/cassandra.yaml
|
142
|
+
- conf/1.0/log4j-server.properties
|
143
|
+
- conf/1.0/schema.json
|
144
|
+
- conf/1.0/schema.txt
|
145
|
+
- ext/cassandra_native.c
|
146
|
+
- ext/extconf.rb
|
124
147
|
- lib/cassandra.rb
|
125
148
|
- lib/cassandra/0.6.rb
|
126
149
|
- lib/cassandra/0.6/cassandra.rb
|
@@ -134,10 +157,10 @@ files:
|
|
134
157
|
- lib/cassandra/0.8/cassandra.rb
|
135
158
|
- lib/cassandra/0.8/columns.rb
|
136
159
|
- lib/cassandra/0.8/protocol.rb
|
160
|
+
- lib/cassandra/1.0.rb
|
137
161
|
- lib/cassandra/1.0/cassandra.rb
|
138
162
|
- lib/cassandra/1.0/columns.rb
|
139
163
|
- lib/cassandra/1.0/protocol.rb
|
140
|
-
- lib/cassandra/1.0.rb
|
141
164
|
- lib/cassandra/array.rb
|
142
165
|
- lib/cassandra/cassandra.rb
|
143
166
|
- lib/cassandra/column_family.rb
|
@@ -146,6 +169,7 @@ files:
|
|
146
169
|
- lib/cassandra/composite.rb
|
147
170
|
- lib/cassandra/constants.rb
|
148
171
|
- lib/cassandra/debug.rb
|
172
|
+
- lib/cassandra/dynamic_composite.rb
|
149
173
|
- lib/cassandra/helpers.rb
|
150
174
|
- lib/cassandra/keyspace.rb
|
151
175
|
- lib/cassandra/long.rb
|
@@ -174,7 +198,7 @@ files:
|
|
174
198
|
- vendor/1.0/gen-rb/cassandra_constants.rb
|
175
199
|
- vendor/1.0/gen-rb/cassandra_types.rb
|
176
200
|
- cassandra.gemspec
|
177
|
-
homepage: http://github.com/twitter/cassandra
|
201
|
+
homepage: http://github.com/twitter/cassandra
|
178
202
|
licenses: []
|
179
203
|
post_install_message:
|
180
204
|
rdoc_options:
|
@@ -186,6 +210,7 @@ rdoc_options:
|
|
186
210
|
- README.md
|
187
211
|
require_paths:
|
188
212
|
- lib
|
213
|
+
- ext
|
189
214
|
required_ruby_version: !ruby/object:Gem::Requirement
|
190
215
|
none: false
|
191
216
|
requirements:
|
@@ -199,16 +224,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
224
|
- !ruby/object:Gem::Version
|
200
225
|
version: '0.8'
|
201
226
|
requirements: []
|
202
|
-
rubyforge_project:
|
227
|
+
rubyforge_project: cassandra
|
203
228
|
rubygems_version: 1.8.17
|
204
229
|
signing_key:
|
205
230
|
specification_version: 3
|
206
231
|
summary: A Ruby client for the Cassandra distributed database.
|
207
232
|
test_files:
|
208
|
-
- test/cassandra_mock_test.rb
|
209
|
-
- test/ordered_hash_test.rb
|
210
233
|
- test/cassandra_client_test.rb
|
234
|
+
- test/cassandra_mock_test.rb
|
211
235
|
- test/cassandra_test.rb
|
212
236
|
- test/comparable_types_test.rb
|
213
|
-
- test/
|
237
|
+
- test/composite_type_test.rb
|
214
238
|
- test/eventmachine_test.rb
|
239
|
+
- test/ordered_hash_test.rb
|
240
|
+
- test/test_helper.rb
|