gotime-cassandra_object 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -23,6 +23,17 @@ Add the following to your Gemfile:
23
23
  end
24
24
  end
25
25
 
26
+ == Connecting to the Server
27
+
28
+ CassandraObject::Base.establish_connection(
29
+ keyspace: 'my_app_development',
30
+ servers: '127.0.0.1:9160',
31
+ thrift: {
32
+ timeout: 20
33
+ retries: 2
34
+ }
35
+ )
36
+
26
37
  == Creating and updating records
27
38
 
28
39
  Cassandra Object has equivalent methods as ActiveRecord:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'gotime-cassandra_object'
5
- s.version = '2.4.0'
5
+ s.version = '2.4.1'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ['lib']
20
20
 
21
21
  s.add_runtime_dependency('activemodel', "~> 3.0")
22
- s.add_runtime_dependency('cassandra', "~> 0.11.3")
22
+ s.add_runtime_dependency('cassandra', "~> 0.12.0")
23
23
 
24
24
  s.add_development_dependency('bundler', "~> 1.0.0")
25
25
  end
@@ -21,7 +21,7 @@ module CassandraObject
21
21
  batch = []
22
22
  end
23
23
  end
24
-
24
+
25
25
  if batch.size > 0
26
26
  yield batch
27
27
  end
@@ -43,6 +43,10 @@ module CassandraObject
43
43
  multi_get(ids).values.compact
44
44
  end
45
45
 
46
+ def count
47
+ connection.count_range(column_family)
48
+ end
49
+
46
50
  def multi_get(keys, options={})
47
51
  attribute_results = ActiveSupport::Notifications.instrument("multi_get.cassandra_object", column_family: column_family, keys: keys) do
48
52
  connection.multi_get(column_family, keys.map(&:to_s), consistency: thrift_read_consistency)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gotime-cassandra_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-08-12 00:00:00.000000000Z
13
+ date: 2011-08-22 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
17
- requirement: &70214289018920 !ruby/object:Gem::Requirement
17
+ requirement: &70296304870220 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,21 +22,21 @@ dependencies:
22
22
  version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70214289018920
25
+ version_requirements: *70296304870220
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: cassandra
28
- requirement: &70214289018260 !ruby/object:Gem::Requirement
28
+ requirement: &70296304869760 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.11.3
33
+ version: 0.12.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70214289018260
36
+ version_requirements: *70296304869760
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &70214289017500 !ruby/object:Gem::Requirement
39
+ requirement: &70296304869300 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70214289017500
47
+ version_requirements: *70296304869300
48
48
  description: Cassandra ActiveModel
49
49
  email: gems@gotime.com
50
50
  executables: []