sessionm-cassandra_object 2.7.1 → 2.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 18f0db796f737b6250c5bbcef6ecffcff2dbf5e3
4
- data.tar.gz: 100827ead34c4b52b7509f045bf89fd1faac39d9
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NWE0ODM4MzQwM2FiYjc0N2JiODdlMmM4MmVkZDE5YmFmZTQxMDA4NQ==
5
+ data.tar.gz: !binary |-
6
+ YjU0NzIzNzBmNDQzZjJiYTExNzk1NjA1YzdkZDU1YjQ3MTdjM2Q5OQ==
5
7
  SHA512:
6
- metadata.gz: eb33d37e2c12f078161a002962f137998a108bc2cf758dddf6eff941dfb67a89ef237a8507eb70cd3a15267d610379587d0af9ba4697d7287cede739e208fbc2
7
- data.tar.gz: 470a03f816a4d6481b8dd8e9a39849f8e73e3bd48ab3116386403f4ca1608690e7278780ac39192894226d2f07a2c7f0ab5bf79d56a31c42d8af869fac160316
8
+ metadata.gz: !binary |-
9
+ MmI0NDNkODg4MzM3NjE3ZWNmODFiYjlhZGNjOGNkYWZiMGI1YzNlZTUwYjY2
10
+ MWMzYWY5MTgzNTE3MmJiYzg2N2U5NmVkMzc0MTk0NTFhN2M2YjlmNDBlODZm
11
+ NjQ0ZmNiZjNlNmEyZDIyOTBlNGY5MTdkMDMyOTkyMGZiMzZkN2E=
12
+ data.tar.gz: !binary |-
13
+ MTM1YTBiY2M2Njc0ZDFhOWJhY2JiZjA2OTk1ZmZmODM3NzQxMTA2N2NlMThk
14
+ ZjlkMGQ5NTA5OTYxMmJkNWFjZDI1NWU0MDJkZGRmMGQzZmEyNWY1YzQ1ZTE5
15
+ M2Y2ZWJmMDVhOWQzZmY3ZGEyNmNkYzAzODc0NDI1Yjk4NDJkYWM=
@@ -2,6 +2,22 @@ module CassandraObject
2
2
  module FinderMethods
3
3
  extend ActiveSupport::Concern
4
4
  module ClassMethods
5
+ def column_parent
6
+ @column_parent ||= CassandraThrift::ColumnParent.new(:column_family => column_family)
7
+ end
8
+
9
+ def slice_range_count
10
+ @slice_range_count ||= 100
11
+ end
12
+
13
+ def slice_range_count=(v)
14
+ @slice_range_count = v
15
+ end
16
+
17
+ def slice_predicate
18
+ @slice_predicate ||= CassandraThrift::SlicePredicate.new(:slice_range => CassandraThrift::SliceRange.new(:count => slice_range_count, :reversed => false, :start => '', :finish => ''))
19
+ end
20
+
5
21
  def find(key, opts={})
6
22
  # kludge to play nice ActiveRecord association
7
23
  opts.assert_valid_keys(:conditions, :consistency)
@@ -13,7 +29,7 @@ module CassandraObject
13
29
  begin
14
30
  CassandraObject::Base.with_connection(key, :read) do
15
31
  ActiveSupport::Notifications.instrument("get.cassandra_object", column_family: column_family, key: key) do
16
- connection.get column_family, key, opts.slice(:consistency)
32
+ connection.get column_parent, key, slice_predicate, opts.slice(:consistency)
17
33
  end
18
34
  end
19
35
  end
@@ -86,19 +102,6 @@ module CassandraObject
86
102
  multi_get_by_expression(expression, options).values
87
103
  end
88
104
 
89
- # Selecting a slice of a super column
90
- def get_slice(key, start, finish, opts={})
91
- CassandraObject::Base.with_connection(key, :read) do
92
- connection.get_slice(column_family,
93
- key,
94
- start,
95
- finish,
96
- opts[:count] || 100,
97
- opts[:reversed] || false,
98
- opts[:consistency] || thrift_read_consistency)
99
- end
100
- end
101
-
102
105
  private
103
106
  def _columns_to_hash(columns)
104
107
  {}.tap do |hsh|
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sessionm-cassandra_object'
5
- s.version = '2.7.1'
5
+ s.version = '2.7.2'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sessionm-cassandra_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-01 00:00:00.000000000 Z
13
+ date: 2015-12-06 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Cassandra ActiveModel
16
16
  email: klange@sessionm.com
@@ -19,7 +19,7 @@ extensions: []
19
19
  extra_rdoc_files:
20
20
  - README.markdown
21
21
  files:
22
- - ".gitignore"
22
+ - .gitignore
23
23
  - CHANGELOG
24
24
  - Gemfile
25
25
  - LICENSE
@@ -118,17 +118,17 @@ require_paths:
118
118
  - lib
119
119
  required_ruby_version: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - ">="
121
+ - - ! '>='
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - ">="
126
+ - - ! '>='
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.2.2
131
+ rubygems_version: 2.4.6
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Cassandra ActiveModel