cassandra-driver 2.1.6 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +52 -30
- data/lib/cassandra/cluster/control_connection.rb +25 -4
- data/lib/cassandra/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTM4YTFlNmRiY2E1YzkxY2U2MDAzNWEyZWU0ZGQzOTY0MzE3NTI1Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTBkYmEyMTI2YWUyODcyODY5MDMxZTNhYTQyOWY2OTI2NzRiMWY0OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDgzNWY0Y2IwNmIyMGM2ZTE5NTMwMjA1MTA5OGUyYTRhNTZkZWQzMmJiNjU1
|
10
|
+
NDBiODBiN2Y2NGRjNmQ0N2EwZDhjYjM4Y2I0ZjhhMzJmYjRmOTc3OTFlNzBh
|
11
|
+
NmY3ZTM4ZDViMDE2NjNmOWE4MjM5N2UxZTU0YjI0MGU0ZDNlY2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDM1N2E1YWM1NjNhYWU5MjQ1NzEzMmRmN2ZiMzk1ZDc0YWNiYWI4NGE0YTBi
|
14
|
+
ZjdmNWJhODEyNmM0MDhiMzgxNWY5NmFiZjllZmIzZWEwYjdmZGJiNTU0YjY1
|
15
|
+
MjZkNTI0OWNmOTk3ZDU2Njg1NWMwMzk2MWY2MTQ1MGY3NjdjMzM=
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Datastax Ruby Driver for Apache Cassandra
|
2
2
|
|
3
|
-
*If you're reading this on GitHub, please note that this is the readme for the development version and that some
|
3
|
+
*If you're reading this on GitHub, please note that this is the readme for the development version and that some
|
4
|
+
features described here might not yet have been released. You can view the documentation for the latest released
|
5
|
+
version [here](http://docs.datastax.com/en/developer/ruby-driver/latest).*
|
4
6
|
|
5
7
|
[![Build Status](https://travis-ci.org/datastax/ruby-driver.svg?branch=master)](https://travis-ci.org/datastax/ruby-driver)
|
6
8
|
|
@@ -8,22 +10,22 @@ A Ruby client driver for Apache Cassandra. This driver works exclusively with
|
|
8
10
|
the Cassandra Query Language version 3 (CQL3) and Cassandra's native protocol.
|
9
11
|
|
10
12
|
- Code: https://github.com/datastax/ruby-driver
|
11
|
-
- Docs: http://datastax.
|
13
|
+
- Docs: http://docs.datastax.com/en/developer/ruby-driver
|
12
14
|
- Jira: https://datastax-oss.atlassian.net/browse/RUBY
|
13
15
|
- Mailing List: https://groups.google.com/a/lists.datastax.com/forum/#!forum/ruby-driver-user
|
14
16
|
- IRC: #datastax-drivers on [irc.freenode.net](http://freenode.net>)
|
15
|
-
- Twitter: Follow the latest news about DataStax Drivers - [@
|
17
|
+
- Twitter: Follow the latest news about DataStax Drivers - [@stamhankar999](http://twitter.com/stamhankar999), [@avalanche123](http://twitter.com/avalanche123), [@al3xandru](https://twitter.com/al3xandru)
|
16
18
|
|
17
19
|
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:
|
18
20
|
|
19
|
-
* [Asynchronous execution](http://datastax.
|
20
|
-
* One-off, [prepared](http://datastax.
|
21
|
-
* Automatic peer discovery and cluster metadata with [support for change notifications](http://datastax.
|
22
|
-
* Various [load-balancing](http://datastax.
|
23
|
-
* [SSL encryption](http://datastax.
|
24
|
-
* [Flexible and robust error handling](http://datastax.
|
25
|
-
* [Per-request execution information and tracing](http://datastax.
|
26
|
-
* [Configurable address resolution](http://datastax.
|
21
|
+
* [Asynchronous execution](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/asynchronous_io/)
|
22
|
+
* One-off, [prepared](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/basics/prepared_statements/) and [batch statements](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/basics/batch_statements/)
|
23
|
+
* Automatic peer discovery and cluster metadata with [support for change notifications](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/state_listeners/)
|
24
|
+
* Various [load-balancing](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/load_balancing/), [retry](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/retry_policies/) and [reconnection](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/reconnection/) policies with [ability to write your own](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/load_balancing/implementing_a_policy/)
|
25
|
+
* [SSL encryption](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/security/ssl_encryption/)
|
26
|
+
* [Flexible and robust error handling](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/error_handling/)
|
27
|
+
* [Per-request execution information and tracing](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/debugging/)
|
28
|
+
* [Configurable address resolution](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/address_resolution/)
|
27
29
|
|
28
30
|
[Check out the slides from Ruby Driver Explained](https://speakerdeck.com/avalanche123/ruby-driver-explained) for a detailed overview of the Ruby Driver architecture.
|
29
31
|
|
@@ -32,12 +34,12 @@ This driver is based on [the cql-rb gem](https://github.com/iconara/cql-rb) by [
|
|
32
34
|
This driver works exclusively with the Cassandra Query Language v3 (CQL3) and Cassandra's native protocol. The current version works with:
|
33
35
|
|
34
36
|
* Apache Cassandra versions 1.2, 2.0 and 2.1
|
35
|
-
* DataStax Enterprise 3.1
|
36
|
-
* Ruby (MRI)
|
37
|
+
* DataStax Enterprise 3.1-4.8
|
38
|
+
* Ruby (MRI) 2.2, 2.3
|
37
39
|
* JRuby 1.7
|
38
|
-
* Rubinius 2.2
|
39
40
|
|
40
|
-
__Note__: JRuby 1.6 is not officially supported, although 1.6.8 should work.
|
41
|
+
__Note__: JRuby 1.6 is not officially supported, although 1.6.8 should work. Rubinius is not supported.
|
42
|
+
MRI 1.9.3, 2.0, 2.1, and JRuby 9k are not officially supported, but they should work.
|
41
43
|
|
42
44
|
## Quick start
|
43
45
|
|
@@ -66,9 +68,9 @@ __Note__: The host you specify is just a seed node, the driver will automaticall
|
|
66
68
|
|
67
69
|
Read more:
|
68
70
|
|
69
|
-
* [`Cassandra.cluster` options](http://datastax.
|
70
|
-
* [`Session#execute_async` options](http://datastax.
|
71
|
-
* [Usage documentation](http://datastax.
|
71
|
+
* [`Cassandra.cluster` options](http://docs.datastax.com/en/developer/ruby-driver/2.1/api/#cluster-class_method)
|
72
|
+
* [`Session#execute_async` options](http://docs.datastax.com/en/developer/ruby-driver/2.1/api/session/#execute_async-instance_method)
|
73
|
+
* [Usage documentation](http://docs.datastax.com/en/developer/ruby-driver/2.1/features)
|
72
74
|
|
73
75
|
## Installation
|
74
76
|
|
@@ -84,30 +86,51 @@ Install via Gemfile
|
|
84
86
|
gem 'cassandra-driver'
|
85
87
|
```
|
86
88
|
|
87
|
-
__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://datastax.
|
89
|
+
__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/2.1/features/#compression)
|
88
90
|
|
89
91
|
|
90
92
|
## Upgrading from cql-rb
|
91
93
|
|
92
|
-
Some of the new features added to the driver have unfortunately led to changes in the original cql-rb API.
|
94
|
+
Some of the new features added to the driver have unfortunately led to changes in the original cql-rb API.
|
95
|
+
In the examples directory, you can find [an example of how to wrap the ruby driver to achieve almost complete
|
96
|
+
interface parity with cql-rb](https://github.com/datastax/ruby-driver/blob/v2.1.7/examples/cql-rb-wrapper.rb)
|
97
|
+
to assist you with gradual upgrade.
|
93
98
|
|
94
|
-
## What's new in v2.1
|
99
|
+
## What's new in v2.1
|
100
|
+
See the [changelog](https://github.com/datastax/ruby-driver/blob/master/CHANGELOG.md) for details on patch releases.
|
95
101
|
|
96
102
|
Features:
|
97
103
|
|
98
104
|
* Apache Cassandra native protocol v3
|
99
|
-
* [User-defined types](http://datastax.
|
100
|
-
* [Schema metadata includes user-defined types](http://datastax.
|
101
|
-
* [Named arguments](http://datastax.
|
102
|
-
* [Public types api for type definition and introspection](http://datastax.
|
105
|
+
* [User-defined types](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/basics/user_defined_types/) and [tuples](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/basics/datatypes/#using-tuples)
|
106
|
+
* [Schema metadata includes user-defined types](http://docs.datastax.com/en/developer/ruby-driver/2.1/api/keyspace/#type-instance_method)
|
107
|
+
* [Named arguments](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/basics/prepared_statements/#an-insert-statement-is-prepared-with-named-parameters)
|
108
|
+
* [Public types api for type definition and introspection](http://docs.datastax.com/en/developer/ruby-driver/2.1/api/types/)
|
109
|
+
* Add support for disabling nagle algorithm (tcp nodelay), enabled by default.
|
110
|
+
* Add support for client-side timestamps, disabled by default.
|
111
|
+
* Add support for serial consistency in batch requests.
|
112
|
+
* Add support for `type_hints` to override type-guessing for non-prepared statements.
|
113
|
+
|
103
114
|
|
104
115
|
Breaking Changes:
|
105
116
|
|
106
117
|
* Splat style positional arguments support, deprecated in 2.0.0, has been dropped
|
118
|
+
* Setting `:synchronize_schema` to `true` will no longer perform the initial
|
119
|
+
fetching if schema metadata.
|
107
120
|
|
108
121
|
Bug Fixes:
|
109
122
|
|
110
123
|
* [[RUBY-93](https://datastax-oss.atlassian.net/browse/RUBY-93)] Reconnection can overflow the stack
|
124
|
+
* [[RUBY-95](https://datastax-oss.atlassian.net/browse/RUBY-95)] Speed up generation of large token maps
|
125
|
+
* [[RUBY-97](https://datastax-oss.atlassian.net/browse/RUBY-97)] Allow disabling of the initial population of schema metadata
|
126
|
+
* [[RUBY-98](https://datastax-oss.atlassian.net/browse/RUBY-98)] Use of undefined class variable in `Table#create_partition_key`
|
127
|
+
* [[RUBY-102](https://datastax-oss.atlassian.net/browse/RUBY-102)] Allow custom types in schema metadata
|
128
|
+
* [[RUBY-103](https://datastax-oss.atlassian.net/browse/RUBY-103)] Don't regenerate schema metadata for the same replication strategies and options
|
129
|
+
* [[RUBY-116](https://datastax-oss.atlassian.net/browse/RUBY-116)] fix thread leak on connection error
|
130
|
+
* [[RUBY-119](https://datastax-oss.atlassian.net/browse/RUBY-119)] Use `require 'datastax/cassandra'` to avoid namespace conflicts
|
131
|
+
* [[RUBY-128](https://datastax-oss.atlassian.net/browse/RUBY-128)] Fix decoding of large values in maps, sets and lists.
|
132
|
+
* [[RUBY-202](https://datastax-oss.atlassian.net/browse/RUBY-202)] Allow password authenticator to be used for LDAP authentication.
|
133
|
+
* [[RUBY-255](https://datastax-oss.atlassian.net/browse/RUBY-255)] ControlConnection.peer_ip ignores peers that are missing critical information in system.peers.
|
111
134
|
|
112
135
|
## Code examples
|
113
136
|
|
@@ -146,11 +169,10 @@ Prereleases will be stable, in the sense that they will have finished and proper
|
|
146
169
|
|
147
170
|
## Known bugs & limitations
|
148
171
|
|
149
|
-
* JRuby 1.6 is not officially supported, although 1.6.8 should work, if you're stuck in JRuby 1.6.8 try and see if it works for you.
|
150
172
|
* Because the driver reactor is using `IO.select`, the maximum number of tcp connections allowed is 1024.
|
151
173
|
* Because the driver uses `IO#write_nonblock`, Windows is not supported.
|
152
174
|
|
153
|
-
Please [refer to the usage documentation for more information on common pitfalls](http://datastax.
|
175
|
+
Please [refer to the usage documentation for more information on common pitfalls](http://docs.datastax.com/en/developer/ruby-driver/2.1/features/)
|
154
176
|
|
155
177
|
## Contributing
|
156
178
|
|
@@ -160,12 +182,12 @@ For contributing read [CONTRIBUTING.md](https://github.com/datastax/ruby-driver/
|
|
160
182
|
|
161
183
|
This driver is based on the original work of [Theo Hultberg](https://github.com/iconara) on [cql-rb](https://github.com/iconara/cql-rb/) and adds a series of advanced features that are common across all other DataStax drivers for Apache Cassandra.
|
162
184
|
|
163
|
-
The development effort to provide an up to date, high performance, fully featured Ruby Driver for Apache Cassandra will continue on this project, while [cql-rb](https://github.com/iconara/cql-rb/)
|
185
|
+
The development effort to provide an up to date, high performance, fully featured Ruby Driver for Apache Cassandra will continue on this project, while [cql-rb](https://github.com/iconara/cql-rb/) has been discontinued.
|
164
186
|
|
165
187
|
|
166
188
|
## Copyright
|
167
189
|
|
168
|
-
Copyright 2013-
|
190
|
+
Copyright 2013-2016 DataStax, Inc.
|
169
191
|
|
170
192
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
171
193
|
|
@@ -173,4 +195,4 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
173
195
|
|
174
196
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
175
197
|
|
176
|
-
[1]: http://datastax.
|
198
|
+
[1]: http://docs.datastax.com/en/developer/ruby-driver/2.1/api
|
@@ -514,7 +514,7 @@ module Cassandra
|
|
514
514
|
|
515
515
|
peers.shuffle!
|
516
516
|
peers.each do |data|
|
517
|
-
ip = peer_ip(data)
|
517
|
+
ip = peer_ip(data, connection.host)
|
518
518
|
next unless ip
|
519
519
|
ips << ip
|
520
520
|
@registry.host_found(ip, data)
|
@@ -699,9 +699,30 @@ Control connection failed and is unlikely to recover.
|
|
699
699
|
@connector.connect(host)
|
700
700
|
end
|
701
701
|
|
702
|
-
def peer_ip(data)
|
703
|
-
|
704
|
-
|
702
|
+
def peer_ip(data, host_address)
|
703
|
+
peer = data['peer']
|
704
|
+
|
705
|
+
return nil unless peer && data['host_id'] && data['data_center'] && data['rack'] && data['tokens']
|
706
|
+
|
707
|
+
rpc_address = data['rpc_address']
|
708
|
+
|
709
|
+
if rpc_address.nil?
|
710
|
+
@logger.info("The system.peers row for '#{data['peer']}' has no rpc_address. This is likely " +
|
711
|
+
'a gossip or snitch issue. This host will be ignored.')
|
712
|
+
return nil
|
713
|
+
end
|
714
|
+
|
715
|
+
if peer == host_address || rpc_address == host_address
|
716
|
+
# Some DSE versions were inserting a line for the local node in peers (with mostly null values).
|
717
|
+
# This has been fixed, but if we detect that's the case, ignore it as it's not really a big deal.
|
718
|
+
|
719
|
+
@logger.debug("System.peers on node #{host_address} has a line for itself. This is not normal but is a " +
|
720
|
+
'known problem of some DSE versions. Ignoring the entry.')
|
721
|
+
return nil
|
722
|
+
end
|
723
|
+
|
724
|
+
ip = rpc_address
|
725
|
+
ip = peer if ip == '0.0.0.0'
|
705
726
|
|
706
727
|
@address_resolver.resolve(ip)
|
707
728
|
end
|
data/lib/cassandra/version.rb
CHANGED
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: 2.1.
|
4
|
+
version: 2.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Hultberg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ione
|