cequel 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cequel/keyspace.rb +3 -3
- data/lib/cequel/model/dictionary.rb +1 -0
- data/lib/cequel/version.rb +1 -1
- data/spec/examples/keyspace_spec.rb +22 -1
- metadata +5 -21
data/lib/cequel/keyspace.rb
CHANGED
@@ -54,10 +54,10 @@ module Cequel
|
|
54
54
|
return @connection_pool if defined? @connection_pool
|
55
55
|
if @configuration[:pool]
|
56
56
|
options = {
|
57
|
-
:size => configuration[:pool],
|
58
|
-
:timeout => configuration[:pool_timeout]
|
57
|
+
:size => @configuration[:pool] || 10,
|
58
|
+
:timeout => @configuration[:pool_timeout] || 5
|
59
59
|
}
|
60
|
-
@connection_pool = ConnectionPool.new(
|
60
|
+
@connection_pool = ConnectionPool.new(options) do
|
61
61
|
build_connection
|
62
62
|
end
|
63
63
|
else
|
data/lib/cequel/version.rb
CHANGED
@@ -32,7 +32,6 @@ DELETE FROM posts
|
|
32
32
|
APPLY BATCH
|
33
33
|
CQL
|
34
34
|
|
35
|
-
|
36
35
|
cequel.batch(:auto_apply => 2) do
|
37
36
|
cequel[:posts].insert(:id => 1, :title => 'Hey')
|
38
37
|
cequel[:posts].update(:body => 'Body')
|
@@ -45,6 +44,28 @@ CQL
|
|
45
44
|
end
|
46
45
|
end
|
47
46
|
|
47
|
+
describe '::connection_pool' do
|
48
|
+
it 'should use connection pool if pool specified' do
|
49
|
+
#NOTE: called one time per pool entry
|
50
|
+
Cequel::Keyspace.any_instance.should_receive(:build_connection).once.and_return(connection)
|
51
|
+
Cequel::Keyspace.any_instance.should_receive(:connection).never
|
52
|
+
keyspace = Cequel::Keyspace.new(:pool => 1)
|
53
|
+
|
54
|
+
keyspace.with_connection { |conn| }
|
55
|
+
keyspace.with_connection { |conn| }
|
56
|
+
keyspace.with_connection { |conn| }
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should not use connection pool if no pool specified' do
|
60
|
+
Cequel::Keyspace.any_instance.should_receive(:connection).exactly(3).times.and_return(connection)
|
61
|
+
keyspace = Cequel::Keyspace.new({})
|
62
|
+
|
63
|
+
keyspace.with_connection { |conn| }
|
64
|
+
keyspace.with_connection { |conn| }
|
65
|
+
keyspace.with_connection { |conn| }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
48
69
|
describe '::logger=' do
|
49
70
|
let(:io) { StringIO.new }
|
50
71
|
let(:logger) { Logger.new(io) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -142,7 +142,7 @@ dependencies:
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
- !ruby/object:Gem::Dependency
|
145
|
-
name:
|
145
|
+
name: debugger
|
146
146
|
requirement: !ruby/object:Gem::Requirement
|
147
147
|
none: false
|
148
148
|
requirements:
|
@@ -157,22 +157,6 @@ dependencies:
|
|
157
157
|
- - ! '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
|
-
- !ruby/object:Gem::Dependency
|
161
|
-
name: redcarpet
|
162
|
-
requirement: !ruby/object:Gem::Requirement
|
163
|
-
none: false
|
164
|
-
requirements:
|
165
|
-
- - <
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
version: '2.0'
|
168
|
-
type: :development
|
169
|
-
prerelease: false
|
170
|
-
version_requirements: !ruby/object:Gem::Requirement
|
171
|
-
none: false
|
172
|
-
requirements:
|
173
|
-
- - <
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
version: '2.0'
|
176
160
|
description: ! 'Cequel is a lightweight query abstraction layer for Cassandra''s CQL
|
177
161
|
language. It
|
178
162
|
|
@@ -261,7 +245,7 @@ files:
|
|
261
245
|
- spec/support/helpers.rb
|
262
246
|
- spec/support/result_stub.rb
|
263
247
|
- spec/shared/readable_dictionary.rb
|
264
|
-
homepage:
|
248
|
+
homepage: https://github.com/brewster/cequel
|
265
249
|
licenses:
|
266
250
|
- MIT
|
267
251
|
post_install_message:
|
@@ -283,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
267
|
requirements:
|
284
268
|
- Cassandra 1.0+
|
285
269
|
rubyforge_project:
|
286
|
-
rubygems_version: 1.8.
|
270
|
+
rubygems_version: 1.8.25
|
287
271
|
signing_key:
|
288
272
|
specification_version: 3
|
289
273
|
summary: Query abstraction layer and object-row mapper for Cassandra and CQL
|