cassandra-driver 3.2.1 → 3.2.2

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: c8e0d7864e62d15fe4b121fa231a7aacf0e5b9ac
4
- data.tar.gz: d764b23105540c02c13ba4c6178e9b670b643df9
3
+ metadata.gz: 950f81b3248939bd7178b7e6c05144ed7da77cb6
4
+ data.tar.gz: efc50ee4050ea234d8e63e509d4f298ca671a876
5
5
  SHA512:
6
- metadata.gz: ff7569c2777c2181b05f3dad7fbd77d1c10bd118f34992f8a8987085338e3f9d95725548365d9e3f1545c7a58a6dacfd2a9ef9dcf5328f00341d78e3cc8fa2f2
7
- data.tar.gz: 560dc83528a665916db34e8299b902348da48d3ff14d931703357dc261b941afdc3139e3d0588434ef92860ef172392b9101735f84a17f1fab5f3202cf483c93
6
+ metadata.gz: d85304895d5b91d7774c08a146889c07919fccd8c0841cf7596a53f499a70cd8bae02781e03ccbf7f3592fe3eb4d19fbaaef98f88f8143f7636566071812dcba
7
+ data.tar.gz: 9bd76f5c388c000c572a85905febeedc6c37e67a60441842c25970ce9df54a91dbd66d2de858b7db245d05402c00488d7422a35cddaa11ed77394faaba08b42d
data/README.md CHANGED
@@ -21,14 +21,14 @@ better compatibility and support for DataStax Enterprise.
21
21
 
22
22
  This driver is based on [the cql-rb gem](https://github.com/iconara/cql-rb) by [Theo Hultberg](https://github.com/iconara) and we added support for:
23
23
 
24
- * [Asynchronous execution](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/asynchronous_io/)
25
- * One-off, [prepared](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/basics/prepared_statements/) and [batch statements](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/basics/batch_statements/)
26
- * Automatic peer discovery and cluster metadata with [support for change notifications](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/state_listeners/)
27
- * Various [load-balancing](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/load_balancing/), [retry](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/retry_policies/) and [reconnection](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/reconnection/) policies with [ability to write your own](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/load_balancing/implementing_a_policy/)
28
- * [SSL encryption](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/security/ssl_encryption/)
29
- * [Flexible and robust error handling](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/error_handling/)
30
- * [Per-request execution information and tracing](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/debugging/)
31
- * [Configurable address resolution](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/address_resolution/)
24
+ * [Asynchronous execution](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/asynchronous_io/)
25
+ * One-off, [prepared](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/basics/prepared_statements/) and [batch statements](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/basics/batch_statements/)
26
+ * Automatic peer discovery and cluster metadata with [support for change notifications](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/state_listeners/)
27
+ * Various [load-balancing](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/load_balancing/), [retry](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/retry_policies/) and [reconnection](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/reconnection/) policies with [ability to write your own](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/load_balancing/implementing_a_policy/)
28
+ * [SSL encryption](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/security/ssl_encryption/)
29
+ * [Flexible and robust error handling](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/error_handling/)
30
+ * [Per-request execution information and tracing](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/debugging/)
31
+ * [Configurable address resolution](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/address_resolution/)
32
32
 
33
33
  [Check out the slides from Ruby Driver Explained](https://speakerdeck.com/avalanche123/ruby-driver-explained) for a detailed overview of the Ruby Driver architecture.
34
34
 
@@ -76,9 +76,9 @@ __Note__: The host you specify is just a seed node, the driver will automaticall
76
76
 
77
77
  Read more:
78
78
 
79
- * [`Cassandra.cluster` options](http://docs.datastax.com/en/developer/ruby-driver/3.0/api/cassandra/#cluster-class_method)
80
- * [`Session#execute_async` options](http://docs.datastax.com/en/developer/ruby-driver/3.0/api/cassandra/session/#execute_async-instance_method)
81
- * [Usage documentation](http://docs.datastax.com/en/developer/ruby-driver/3.0/features)
79
+ * [`Cassandra.cluster` options](http://docs.datastax.com/en/developer/ruby-driver/3.1/api/cassandra/#cluster-class_method)
80
+ * [`Session#execute_async` options](http://docs.datastax.com/en/developer/ruby-driver/3.1/api/cassandra/session/#execute_async-instance_method)
81
+ * [Usage documentation](http://docs.datastax.com/en/developer/ruby-driver/3.1/features)
82
82
 
83
83
  ## Installation
84
84
 
@@ -94,14 +94,14 @@ Install via Gemfile
94
94
  gem 'cassandra-driver'
95
95
  ```
96
96
 
97
- __Note__: if you want to use compression you should also install [snappy](http://rubygems.org/gems/snappy) or [lz4-ruby](http://rubygems.org/gems/lz4-ruby). [Read more about compression.](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/#compression)
97
+ __Note__: if you want to use compression you should also install [snappy](http://rubygems.org/gems/snappy) or [lz4-ruby](http://rubygems.org/gems/lz4-ruby). [Read more about compression.](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/#compression)
98
98
 
99
99
 
100
100
  ## Upgrading from cql-rb
101
101
 
102
102
  Some of the new features added to the driver have unfortunately led to changes in the original cql-rb API.
103
103
  In the examples directory, you can find [an example of how to wrap the ruby driver to achieve almost complete
104
- interface parity with cql-rb](https://github.com/datastax/ruby-driver/blob/v3.2.1/examples/cql-rb-wrapper.rb)
104
+ interface parity with cql-rb](https://github.com/datastax/ruby-driver/blob/v3.2.2/examples/cql-rb-wrapper.rb)
105
105
  to assist you with gradual upgrade.
106
106
 
107
107
  If you are upgrading to DataStax Enterprise, use the [Ruby DSE driver](https://github.com/datastax/ruby-dse-driver.git)
@@ -112,7 +112,7 @@ This minor release adds support for MRI 2.4.x and also contains a few miscellane
112
112
  support for Ruby versions prior to 2.2. This was already officially the case, but the minimum version limit is
113
113
  now enforced.
114
114
 
115
- See the [changelog](https://github.com/datastax/ruby-driver/blob/v3.2.1/CHANGELOG.md) for more information on all
115
+ See the [changelog](https://github.com/datastax/ruby-driver/blob/v3.2.2/CHANGELOG.md) for more information on all
116
116
  changes in this version and past versions.
117
117
 
118
118
  ## What's new in v3.1
@@ -180,7 +180,7 @@ examples in the `features/` directory.
180
180
  ## Running tests
181
181
 
182
182
  If you don't feel like reading through the following instructions on how to run
183
- ruby-driver tests, feel free to [check out .travis.yml for the entire build code](https://github.com/datastax/ruby-driver/blob/v3.2.1/.travis.yml).
183
+ ruby-driver tests, feel free to [check out .travis.yml for the entire build code](https://github.com/datastax/ruby-driver/blob/v3.2.2/.travis.yml).
184
184
 
185
185
  * Check out the driver codebase and install test dependencies:
186
186
 
@@ -204,7 +204,7 @@ CASSANDRA_VERSION=2.1.12 bundle exec rake test # run both as well as integration
204
204
  ## Changelog & versioning
205
205
 
206
206
  Check out the [releases on GitHub](https://github.com/datastax/ruby-driver/releases) and
207
- [changelog](https://github.com/datastax/ruby-driver/blob/v3.2.1/CHANGELOG.md). Version
207
+ [changelog](https://github.com/datastax/ruby-driver/blob/v3.2.2/CHANGELOG.md). Version
208
208
  numbering follows the [semantic versioning](http://semver.org/) scheme.
209
209
 
210
210
  Private and experimental APIs, defined as whatever is not in the
@@ -227,7 +227,7 @@ the release.
227
227
  * Because the driver reactor is using `IO.select`, the maximum number of tcp connections allowed is 1024.
228
228
  * Because the driver uses `IO#write_nonblock`, Windows is not supported.
229
229
 
230
- Please [refer to the usage documentation for more information on common pitfalls](http://docs.datastax.com/en/developer/ruby-driver/3.0/features/)
230
+ Please [refer to the usage documentation for more information on common pitfalls](http://docs.datastax.com/en/developer/ruby-driver/3.1/features/)
231
231
 
232
232
  ## Contributing
233
233
 
@@ -257,4 +257,4 @@ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
257
257
  either express or implied. See the License for the specific language governing permissions
258
258
  and limitations under the License.
259
259
 
260
- [1]: http://docs.datastax.com/en/developer/ruby-driver/3.0/api
260
+ [1]: http://docs.datastax.com/en/developer/ruby-driver/3.1/api
@@ -204,7 +204,13 @@ module Cassandra
204
204
  end
205
205
 
206
206
  def all(*futures)
207
- futures = Array(futures.first) if futures.one?
207
+ # May get called with varargs or an array of futures. In the latter case,
208
+ # the first element in futures is the array of futures. Promote it.
209
+ futures = Array(futures.first) if futures.one?
210
+
211
+ # Special case where there are no futures to aggregate.
212
+ return Value.new([]) if futures.empty?
213
+
208
214
  monitor = Monitor.new
209
215
  promise = Promise.new(@executor)
210
216
  remaining = futures.length
@@ -53,24 +53,30 @@ module Cassandra
53
53
  end
54
54
 
55
55
  def read_decimal(len = bytesize)
56
- size = read_signed_int
56
+ scale = read_signed_int
57
57
  number_string = read_varint(len - 4).to_s
58
- if number_string.length <= size
59
- if number_string.start_with?(MINUS)
60
- number_string = number_string[1, number_string.length - 1]
61
- fraction_string = MINUS + ZERO << DECIMAL_POINT
58
+ if scale < 0
59
+ # Special case where the actual scale is positive; scale in the protocol is actually negative of
60
+ # reality.
61
+ BigDecimal.new(number_string + '0' * -scale)
62
+ else
63
+ if number_string.length <= scale
64
+ if number_string.start_with?(MINUS)
65
+ number_string = number_string[1, number_string.length - 1]
66
+ fraction_string = MINUS + ZERO << DECIMAL_POINT
67
+ else
68
+ fraction_string = ZERO + DECIMAL_POINT
69
+ end
70
+ (scale - number_string.length).times { fraction_string << ZERO }
71
+ fraction_string << number_string
62
72
  else
63
- fraction_string = ZERO + DECIMAL_POINT
73
+ fraction_string = number_string[0, number_string.length - scale]
74
+ fraction_string << DECIMAL_POINT
75
+ fraction_string <<
76
+ number_string[number_string.length - scale, number_string.length]
64
77
  end
65
- (size - number_string.length).times { fraction_string << ZERO }
66
- fraction_string << number_string
67
- else
68
- fraction_string = number_string[0, number_string.length - size]
69
- fraction_string << DECIMAL_POINT
70
- fraction_string <<
71
- number_string[number_string.length - size, number_string.length]
78
+ BigDecimal.new(fraction_string)
72
79
  end
73
- BigDecimal.new(fraction_string)
74
80
  rescue Errors::DecodingError => e
75
81
  raise Errors::DecodingError, e.message, e.backtrace
76
82
  end
@@ -270,9 +270,7 @@ module Cassandra
270
270
  def time_out!
271
271
  unless future.completed?
272
272
  @timed_out = true
273
- # rubocop:disable Style/SignalException
274
273
  fail(Errors::TimeoutError.new('Timed out'))
275
- # rubocop:enable Style/SignalException
276
274
  end
277
275
  end
278
276
 
@@ -17,5 +17,5 @@
17
17
  #++
18
18
 
19
19
  module Cassandra
20
- VERSION = '3.2.1'.freeze
20
+ VERSION = '3.2.2'.freeze
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Hultberg
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-01-04 00:00:00.000000000 Z
13
+ date: 2018-01-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ione