You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/README.md
+11-11
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,21 @@
2
2
3
3
## Connecting and Discovering Nodes
4
4
5
-
Ruby driver will connect to 127.0.0.1 if no `:hosts` given to `Cassandra.connect`. It will automatically discover all peers and add them to cluster metadata.
5
+
Ruby driver will connect to 127.0.0.1 if no `:hosts` given to `Cassandra.cluster`. It will automatically discover all peers and add them to cluster metadata.
You can also specify a list of seed nodes to connect to. The set of IP addresses we pass to the `Cassandra.connect` is simply an initial set of contact points. After the driver connects to one of these nodes, it will automatically discover the rest of the nodes in the cluster, so you don’t need to list every node in your cluster.
17
+
You can also specify a list of seed nodes to connect to. The set of IP addresses we pass to the `Cassandra.cluster` is simply an initial set of contact points. After the driver connects to one of these nodes, it will automatically discover the rest of the nodes in the cluster, so you don’t need to list every node in your cluster.
18
18
19
-
[Read more in the api docs](http://datastax.github.io/ruby-driver/api/#connect-class_method)
19
+
[Read more in the api docs](http://datastax.github.io/ruby-driver/api/#cluster-class_method)
20
20
21
21
## Executing Queries
22
22
@@ -204,10 +204,10 @@ end
204
204
You can specify the default consistency to use when you create a new `Cluster`:
205
205
206
206
```ruby
207
-
client =Cassandra.connect(consistency::all)
207
+
client =Cassandra.cluster(consistency::all)
208
208
```
209
209
210
-
[Read more about default consistency](http://datastax.github.io/ruby-driver/api/#connect-class_method)
210
+
[Read more about default consistency](http://datastax.github.io/ruby-driver/api/#cluster-class_method)
211
211
212
212
Consistency can also be passed to `Session#execute` and `Session#execute_async`
213
213
@@ -232,18 +232,18 @@ Consistency is ignored for `USE`, `TRUNCATE`, `CREATE` and `ALTER` statements, a
232
232
233
233
## Compression
234
234
235
-
The CQL protocol supports frame compression, which can give you a performance boost if your requests or responses are big. To enable it you can specify compression to use in `Cassandra.connect`.
235
+
The CQL protocol supports frame compression, which can give you a performance boost if your requests or responses are big. To enable it you can specify compression to use in `Cassandra.cluster`.
236
236
237
237
Cassandra currently supports two compression algorithms: Snappy and LZ4. ruby driver supports both, but in order to use them you will have to install the [snappy](http://rubygems.org/gems/snappy) or [lz4-ruby](http://rubygems.org/gems/lz4-ruby) gems separately. Once it's installed you can enable compression like this:
238
238
239
239
```ruby
240
-
cluster =Cassandra.connect(compression::snappy)
240
+
cluster =Cassandra.cluster(compression::snappy)
241
241
```
242
242
243
243
or
244
244
245
245
```ruby
246
-
cluster =Cassandra.connect(compression::lz4)
246
+
cluster =Cassandra.cluster(compression::lz4)
247
247
```
248
248
249
249
Which one should you choose? On paper the LZ4 algorithm is more efficient and the one Cassandra defaults to for SSTable compression. They both achieve roughly the same compression ratio, but LZ4 does it quicker.
@@ -255,7 +255,7 @@ You can pass a standard Ruby logger to the client to get some more information a
Most of the logging will be when the driver connects and discovers new nodes, when connections fail and so on. The logging is designed to not cause much overhead and only relatively rare events are logged (e.g. normal requests are not logged).
@@ -306,7 +306,7 @@ A Cluster instance allows to configure different important aspects of the way co
0 commit comments