sessionm-cassandra_object 4.0.17 → 4.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed329a15a831823620ffa071ce312de25c3f375f
4
- data.tar.gz: 6f818bc4fc78a4431ee347cb02744381079e4164
3
+ metadata.gz: f4f7695ab50cc8f809469eae9e85df59aa5e8167
4
+ data.tar.gz: c366e423d4218302c58b9470fabdce04fbddc5e2
5
5
  SHA512:
6
- metadata.gz: e0e93509823634b57f7933c30c6b37e4dab27663bb484dfafadf23f80a329b56805f34e9cfd2ee101b4d24cdfe2c5bc1f6d6250834921d1a429a289b92bb123b
7
- data.tar.gz: 48c59e303a94544bc5e668cca4377fdc78e30472a202afb2a02ada6411f4bc6e3f74d10591ac2d279d1da3317669dddc798a8d931d16af017fb68149f6624556
6
+ metadata.gz: 65b1137b9b00dfdcd4dabc4c1c6d4112b2d98b9a9cb039e11a11d5308c56cdd41007638b4b6210a1fdb42a649cacf50d2b3d57f05cefb48b17345038f83bdabd
7
+ data.tar.gz: 828a23a774fe4d56a085c376dc7673910391ef8d6a441ea440f1f6319edab25200792714486eb801ba1f32a25cf61ab51279b1526a6918f0d862e45524aa23e1
@@ -1,6 +1,17 @@
1
1
  module CassandraObject
2
2
  module Adapters
3
3
  class CassandraDriver
4
+ CLUSTER_CONFIG_OPTIONS = [
5
+ :credentials, :auth_provider, :compression, :hosts, :logger, :port,
6
+ :load_balancing_policy, :reconnection_policy, :retry_policy, :listeners,
7
+ :consistency, :trace, :page_size, :compressor, :username, :password,
8
+ :ssl, :server_cert, :client_cert, :private_key, :passphrase,
9
+ :connect_timeout, :futures_factory, :datacenter, :address_resolution,
10
+ :address_resolution_policy, :idle_timeout, :heartbeat_interval, :timeout,
11
+ :synchronize_schema, :schema_refresh_delay, :schema_refresh_timeout,
12
+ :shuffle_replicas, :client_timestamps
13
+ ]
14
+
4
15
  attr_reader :config
5
16
 
6
17
  def initialize(config)
@@ -25,14 +36,17 @@ module CassandraObject
25
36
  end
26
37
 
27
38
  def cluster_config
28
- {
39
+ config.slice(*CLUSTER_CONFIG_OPTIONS).reverse_merge(
29
40
  :hosts => config[:servers].map { |server| server.sub /:\d+/, '' },
30
- :port => config[:port] || 9042,
31
- :connect_timeout => config[:thrift][:connect_timeout] || 10,
32
- :timeout => config[:thrift][:timeout] || 10,
33
- :logger => config[:logger] || (defined?(Rails) && Rails.logger) || Logger.new(STDOUT),
41
+ :port => 9042,
42
+ :connect_timeout => config[:thrift].try(:[], :connect_timeout) || 10,
43
+ :timeout => config[:thrift].try(:[], :timeout) || 10,
44
+ :logger => (defined?(Rails) && Rails.logger) || Logger.new(STDOUT),
45
+ :heartbeat_interval => nil,
46
+ :idle_timeout => nil
47
+ ).merge(
34
48
  :consistency => (config[:consistency] || {})[:write_default].try(:to_sym) || :one,
35
- }
49
+ )
36
50
  end
37
51
 
38
52
  class SchemaCache < ActiveRecord::ConnectionAdapters::SchemaCache
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sessionm-cassandra_object'
5
- s.version = '4.0.17'
5
+ s.version = '4.0.18'
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: 4.0.17
4
+ version: 4.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-22 00:00:00.000000000 Z
12
+ date: 2016-04-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Cassandra ActiveModel
15
15
  email: doug@sessionm.com