From f790bb7c77f0718dba33ed520cf80bd9aa040543 Mon Sep 17 00:00:00 2001 From: Achilleas Anagnostopoulos Date: Sat, 6 Dec 2014 09:33:45 +0200 Subject: [PATCH] Updated links to source files --- README.md | 66 +++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index eb9ccf2..ab366c3 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ In all other cases, the driver performs *automatic inline expansion* of each bou ### UUIDs -The [Uuid](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/uuid.dart) class provides a wrapper around UUIDs and provides factory constructors for generating simple and time-based UUIDs. +The [Uuid](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/uuid.dart) class provides a wrapper around UUIDs and provides factory constructors for generating simple and time-based UUIDs. ```dart Uuid simpleUuid = new Uuid.simple(); @@ -146,7 +146,7 @@ The driver supports UDTs with arbitrary nesting. The driver will parse UDTs as ` ### Tuples -Whenever you need to use a ```tuple``` type in your queries or read it from a query result you need to use the driver-provided [Tuple](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/tuple.dart) class. +Whenever you need to use a ```tuple``` type in your queries or read it from a query result you need to use the driver-provided [Tuple](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/tuple.dart) class. This class is essentially a decorated ```List```. You can instanciate a ```Tuple``` object from any ```Iterable``` using the ```fromIterable``` named constructor. Here is an example: @@ -160,7 +160,7 @@ Custom types are user-defined server-side Java classes that extend the types sup By *default*, custom types are parsed and returned as a [Uint8List](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-typed_data.Uint8List). The driver however allows you to register a user-defined [Codec](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-convert.Codec) for handling custom type serialization/de-serialization to a *Dart class instance*. -To use this feature, the Dart class that represents the custom type needs to implement thee [CustomType](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/custom_type.dart) interface: +To use this feature, the Dart class that represents the custom type needs to implement thee [CustomType](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/custom_type.dart) interface: ```dart abstract class CustomType { @@ -182,11 +182,11 @@ After this step, the driver will automatically invoke the codec whenever it enco A connection pool is used to keep track of active connections to Cassandra nodes and to provide load-balancing, fault-tolerance and server event subscription to Cassandra clients. -To instanciate a connection pool you need to provide a [PoolConfiguration](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/connection/pool_configuration.dart) object to the pool constructor. The following named parameters may be passed to the PoolConfiguration object constructor to override the default values: +To instanciate a connection pool you need to provide a [PoolConfiguration](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/connection/pool_configuration.dart) object to the pool constructor. The following named parameters may be passed to the PoolConfiguration object constructor to override the default values: |Option name | Default value | Description | |:------------------------|:------------------------|:--------------- -| protocolVersion | ProtocolVersion.V2 | The binary protocol version to use. Its value should be one of the [ProtocolVersion](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/protocol_version.dart) enums +| protocolVersion | ProtocolVersion.V2 | The binary protocol version to use. Its value should be one of the [ProtocolVersion](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/protocol_version.dart) enums | cqlVersion | "3.0.0" | The CQL version to use. To use the new CQL features you should request at least version **"3.1.0"** | connectionsPerHost | 1 | The number of concurrent connections to each host | streamsPerConnection | 128 | The max number of requests that can be multiplexed over each connection. According to the binary protocol specification, each connection can multiplex up to **128** streams in V2 mode and **32768** streams in V3 mode @@ -194,12 +194,12 @@ To instanciate a connection pool you need to provide a [PoolConfiguration](https | reconnectWaitTime | 1500ms | A [Duration](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:core.Duration) object specifying the time to wait between reconnection attempts | streamReservationTimeout| 0ms | A [Duration](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:core.Duration) object specifying the time to wait for a connection stream to become available when all connection streams are in use. In case of a timeout, the driver will try the next available connection | autoDiscoverNodes | true | If this flag is set to ```true```, the connection pool will listen for server topology change events and automatically update the pool when new nodes come online/go offline. If set to ```false```, the pool will only process UP/DOWN events for nodes already in the pool -| authenticator | null | An authentication provider instance implementing the [Authenticator](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/authentication/authenticator.dart) interface or **null** if no authentication is required. For more information see the section on [authentication](#Cassandra-authentication) -| compression | null | The compression algorithm to be used with Cassandra nodes. Its value should be one of the [Compression](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/compression.dart) enums or **null** if no compression should be used. For more information see the section on [compression](#compression) +| authenticator | null | An authentication provider instance implementing the [Authenticator](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/authentication/authenticator.dart) interface or **null** if no authentication is required. For more information see the section on [authentication](#Cassandra-authentication) +| compression | null | The compression algorithm to be used with Cassandra nodes. Its value should be one of the [Compression](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/compression.dart) enums or **null** if no compression should be used. For more information see the section on [compression](#compression) ### Simple connection pool -The driver provides the [SimpleConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/connection/simple_connection_pool.dart) as its default [ConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/connection/connection_pool.dart) implementation. This pool should be adequate for most projects although you can always roll up your [own pool](#custom-connection-pools) if you want. +The driver provides the [SimpleConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/connection/simple_connection_pool.dart) as its default [ConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/connection/connection_pool.dart) implementation. This pool should be adequate for most projects although you can always roll up your [own pool](#custom-connection-pools) if you want. The pool manages a list of ```connectionsPerHost``` open connections and tries to load-balance between them. In addition to that, the pool subscribes to server generated events and can add/remove connections from the pool whenever Cassandra nodes come online/go offline or nodes enter/exit the cluster. @@ -220,17 +220,17 @@ In any case, whenever a connection is selected from the pool, it will be removed ### Custom connection pools To create a custom connection pool you need to extend the -abstract [ConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/connection/connection_pool.dart) class and implement its abstract methods to apply your custom connection selection logic. An instance of your custom connection pool can then be passed to the [client](#the-client) during construction. Here are a few ideas for a custom connection pool: +abstract [ConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/connection/connection_pool.dart) class and implement its abstract methods to apply your custom connection selection logic. An instance of your custom connection pool can then be passed to the [client](#the-client) during construction. Here are a few ideas for a custom connection pool: - A DC-aware connection pool that tries local DC connections first and then falls back to a secondary, tertiary e.t.c connection pool. - A connection pool that discovers Cassandra hosts automatically via an external service (EC2 API queries, etcd) ## Cassandra authentication -The driver provides the built-in [PasswordAuthenticator](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/authentication/password_authenticator.dart) class that allows you to authenticate with Cassandra servers requiring the ```org.apache.Cassandra.auth.PasswordAuthenticator``` provider. To use this provider, you need to instanciate it with your user/pass credentials and pass it to the pool configuration. +The driver provides the built-in [PasswordAuthenticator](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/authentication/password_authenticator.dart) class that allows you to authenticate with Cassandra servers requiring the ```org.apache.Cassandra.auth.PasswordAuthenticator``` provider. To use this provider, you need to instanciate it with your user/pass credentials and pass it to the pool configuration. -If you need to implement any other form of authentication you can roll your own by implementing the [Authenticator](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/authentication/authenticator.dart) interface. +If you need to implement any other form of authentication you can roll your own by implementing the [Authenticator](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/authentication/authenticator.dart) interface. ```dart abstract class Authenticator { @@ -244,7 +244,7 @@ The implementation should define: + a **getter** for retrieving the *fully qualified Cassandra authentication class* that the authenticator handles. This value is used to match the authenticator class requested by Cassandra during the initial handshake. + an **answerChallenge** method that will be invoked each time the remote server sends an authentication challenge. -If the Cassandra cluster requires authentication but none is supplied or an incompatible authenticator instance is specified, then connection attempts will fail with an [AuthenticationException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/exception/authentication.dart) error. +If the Cassandra cluster requires authentication but none is supplied or an incompatible authenticator instance is specified, then connection attempts will fail with an [AuthenticationException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/exception/authentication.dart) error. ## Compression @@ -252,7 +252,7 @@ In order to keep external dependencies to a minimum, the driver does not ship wi The driver however allows provides a mechanism for registering a [Codec\](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:convert.Codec) that implements one of the above compression schemes. This allows you to use a third-party dart package for handling compression if your particular application requires it. -To use this feature you need to invoke the public method ```registerCodec(String, Codec)``` and specify one of the [Compression](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/compression.dart) enum **values** (e.g. ```Compression.LZ4.value```) as the first argument and a class instance implementing ```Codec``` as the second argument. +To use this feature you need to invoke the public method ```registerCodec(String, Codec)``` and specify one of the [Compression](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/compression.dart) enum **values** (e.g. ```Compression.LZ4.value```) as the first argument and a class instance implementing ```Codec``` as the second argument. After the codec is registered you may then enable compression when you define your pool configuration. Keep in mind that the codec needs to be registered **before** the pool configuration is instanciated or an exception will be thrown. @@ -280,17 +280,17 @@ int main() { To create a new client instance you may use one of the two available named constructors: -- ```Client.fromHostList(List hosts, {String defaultKeyspace, PoolConfiguration poolConfig})``` which should be used when a host list is available. You may also specify the default keyspace to be used as well as a specific pool configuration (if no configuration is specified a default one will be used). This method will instanciate a [SimpleConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/connection/simlpe_connection_pool.dart) with the supplied parameters and bind it to the client. +- ```Client.fromHostList(List hosts, {String defaultKeyspace, PoolConfiguration poolConfig})``` which should be used when a host list is available. You may also specify the default keyspace to be used as well as a specific pool configuration (if no configuration is specified a default one will be used). This method will instanciate a [SimpleConnectionPool](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/connection/simlpe_connection_pool.dart) with the supplied parameters and bind it to the client. - ```Client.withPool(ConnectionPool this.connectionPool, {String defaultKeyspace})``` which should be used with an already instanciated connection pool (simple or custom). ### Single and batch queries -To define a single query, the driver provides the [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/query.dart) class. Its constructor accepts a query string that may contain either positional (indicated by the ```?``` character) or named (indicated by ```:``` followed by the parameter name) arguments. Mixing positional and named parameters is not currently supported. The following named parameters may also be passed to the constructor: +To define a single query, the driver provides the [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/query.dart) class. Its constructor accepts a query string that may contain either positional (indicated by the ```?``` character) or named (indicated by ```:``` followed by the parameter name) arguments. Mixing positional and named parameters is not currently supported. The following named parameters may also be passed to the constructor: | Parameter Name | Description |:---------------|:---------------- | bindings | The query string bindings. The parameter value value must be a ```Iterable``` when using positional parameters or a ```Map``` when using named parameters -| consistency | One of the [Consistency](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/consistency.dart) enum values to select the consistency level for this query. Defaults to ```Consistency.QUORUM``` +| consistency | One of the [Consistency](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/consistency.dart) enum values to select the consistency level for this query. Defaults to ```Consistency.QUORUM``` | serialConsistency | One of ```Consistency.SERIAL```, ```Consistency.LOCAL_SERIAL``` or ```Consistency.LOCAL_ONE``` enum values to select the serial consistency value of this call. This value will be ignored when not using ```ProtocolVersion.V3``` | prepared | A boolean flag specifying whether this query should be prepared or not. Defaults to ```false```. For more info see the section on [prepared queries](#prepared-queries) @@ -309,13 +309,13 @@ new cql.Query( ); ``` -If you need to execute a batch query, the driver provides the [BatchQuery](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/batch_query.dart) class. The class constructor accepts the following optional params: +If you need to execute a batch query, the driver provides the [BatchQuery](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/batch_query.dart) class. The class constructor accepts the following optional params: | Parameter Name | Description |:---------------|:---------------- -| consistency | One of the [Consistency](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/consistency.dart) enum values to select the consistency level for the batch query. Defaults to ```Consistency.QUORUM```. +| consistency | One of the [Consistency](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/consistency.dart) enum values to select the consistency level for the batch query. Defaults to ```Consistency.QUORUM```. | serialConsistency | One of ```Consistency.SERIAL```, ```Consistency.LOCAL_SERIAL``` or ```Consistency.LOCAL_ONE``` enum values to select the serial consistency value of this call. This value will be ignored when not using ```ProtocolVersion.V3```. -| batchType | One of the [BatchType](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/batch_type.dart) enum values to select the batch type. Defaults to ```BatchType.LOGGED```. This value will be ignored when not using ```ProtocolVersion.V3```. +| batchType | One of the [BatchType](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/batch_type.dart) enum values to select the batch type. Defaults to ```BatchType.LOGGED```. This value will be ignored when not using ```ProtocolVersion.V3```. The ```BatchQuery``` class provides the ```add( Query query)``` method for appending individual ```Query``` instances to the batch. Keep in mind that when useing batch queries, the ```consistency``` and ```serialConsistency``` settings of the ```BatchQuery``` object override any individual consistency settings specified by the appended ```Query``` objects. Here is an example: @@ -336,22 +336,22 @@ new cql.BatchQuery(consistency: cql.Consistency.TWO) The client provides two methods for executing single queries: ```query()``` and ```execute()```. -To execute a single **select** [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/query.dart), the ```query``` method should be used. It returns back a [Future](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future) that evaluates to an ```Iterable>``` with the result rows. Each row is modeled as a ```Map``` where the key is the column name and the value is the [unserialized](#cassandra-to-dart-type-mapping) column value. +To execute a single **select** [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/query.dart), the ```query``` method should be used. It returns back a [Future](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future) that evaluates to an ```Iterable>``` with the result rows. Each row is modeled as a ```Map``` where the key is the column name and the value is the [unserialized](#cassandra-to-dart-type-mapping) column value. -In all other cases (single queries or batch queries) the ```execute``` method should be used. This method accepts either a [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/query.dart) or [BatchQuery](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/batch_query.dart) as its argument. The method also accepts the optional ```pageSize``` and ```pagingState``` named parameters to enable [pagination](#paginated-queries) for single select queries. It returns back a [Future](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future) that evaluates to one of the following concrete implementations of the [ResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/result_message.dart) class depending on the query type: +In all other cases (single queries or batch queries) the ```execute``` method should be used. This method accepts either a [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/query.dart) or [BatchQuery](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/batch_query.dart) as its argument. The method also accepts the optional ```pageSize``` and ```pagingState``` named parameters to enable [pagination](#paginated-queries) for single select queries. It returns back a [Future](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future) that evaluates to one of the following concrete implementations of the [ResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/result_message.dart) class depending on the query type: |Message type | Returnes when | |:--------------------------|:--------------- -| [VoidResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/void_result_message.dart) | If the query returns no value. (e.g. ```insert``` queries) -| [RowsResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/rows_result_message.dart) | When executing a ```select``` query. -| [SetKeyspaceResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/set_keyspace_result_message.dart) | When a ```set keyspace``` query is executed. -| [SchemaChangeResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/schema_change_result_message.dart) | When an ```alter``` query is executed. +| [VoidResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/void_result_message.dart) | If the query returns no value. (e.g. ```insert``` queries) +| [RowsResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/rows_result_message.dart) | When executing a ```select``` query. +| [SetKeyspaceResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/set_keyspace_result_message.dart) | When a ```set keyspace``` query is executed. +| [SchemaChangeResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/schema_change_result_message.dart) | When an ```alter``` query is executed. ### Paginated queries In some use cases, you may need to perform client-side pagination. One way to achieve this is to encode the pagination parameters (e.g. fromDate - toDate) inside the ```where``` clause of your selection query. Another way to achieve this is to use Cassandra's native pagination support. -To use native pagination you need to invoke the ```execute``` method with your selection query and supply the ```pageSize``` named parameter. After the returned [Future](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future) completes, you receive a [RowsResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/rows_result_message.dart) . You can access the returned rows (a ```List>```) via the ```rows``` getter. The message also contains a [ResultMetadata](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/result_metadata.dart) instance which can be obtained via the ```metadata``` getter. The metadata object contains the ```pagingState``` attribute whose value is generated by Cassandra and serves as a pointer for obtaining the next page of results. +To use native pagination you need to invoke the ```execute``` method with your selection query and supply the ```pageSize``` named parameter. After the returned [Future](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Future) completes, you receive a [RowsResultMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/rows_result_message.dart) . You can access the returned rows (a ```List>```) via the ```rows``` getter. The message also contains a [ResultMetadata](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/result_metadata.dart) instance which can be obtained via the ```metadata``` getter. The metadata object contains the ```pagingState``` attribute whose value is generated by Cassandra and serves as a pointer for obtaining the next page of results. To retrieve the next set of rows you need to invoke once again the ```execute``` method with the same ```pageSize``` value as before and the ```pagingState``` named parameter set to the value obtained by the previous method invocation. Here is an example: @@ -374,7 +374,7 @@ client ### Streaming query results -If you need to iterate through all rows of a large dataset without loading the entire dataset to memory you can use the ```stream``` method. This method accepts a [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/query.dart) object and the named parameter ```pageSize``` (defaults to 100) and returns back a Dart [Stream](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Stream). The stream supports the usual stream-related operations (pause, resume, stop e.t.c) and can be combined with other +If you need to iterate through all rows of a large dataset without loading the entire dataset to memory you can use the ```stream``` method. This method accepts a [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/query.dart) object and the named parameter ```pageSize``` (defaults to 100) and returns back a Dart [Stream](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Stream). The stream supports the usual stream-related operations (pause, resume, stop e.t.c) and can be combined with other Dart streams for additional processing. The underlying StreamController buffers the rows for each page on-demand and emits each row to the stream as a ```Map``` where the key is the column name and the value is the [unserialized](#cassandra-to-dart-type-mapping) column value. Here is an example that streams all rows from a dataset and prints each one to the console: @@ -388,7 +388,7 @@ client.stream( ### Prepared queries -If you are executing the same single [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/query.dart) multiple times you can increase your query throughput by converting it to a prepared query. To do this, set the ```prepared``` named constructor parameter to ```true``` when you instanciate your query object. When executing a prepared query, the driver is aware of the actual Cassandra type of each bound argument and will properly serialize the bound arguments instead of performing _automatic inline expansion_ as with normal queries. +If you are executing the same single [Query](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/query.dart) multiple times you can increase your query throughput by converting it to a prepared query. To do this, set the ```prepared``` named constructor parameter to ```true``` when you instanciate your query object. When executing a prepared query, the driver is aware of the actual Cassandra type of each bound argument and will properly serialize the bound arguments instead of performing _automatic inline expansion_ as with normal queries. Prepared queries are associated with a randomly selected node from the connection pool and they can only be executed via connections to that particular node. If during execution time no connection to the associated node is available, the driver will automatically prepare the query on another random node from the pool and execute it there. @@ -401,7 +401,7 @@ The connection pool registers itself as a listener for events broadcasted by Cas The connection pool uses these events to add new nodes to the pool (if the ```autoDiscoverNodes``` pool configuration option is true) to remove dead nodes from the pool or to attempt to reconnect to offline nodes when they go online. -If your application needs to process these kinds of events, you can use the ```listenForServerEvents``` method of the connection pool. This method accepts a [List](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:core.List) of [EventRegistrationType](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/types/enums/event_registration_type.dart) values and returns back a Dart [Stream](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Stream) that emits [EventMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/protocol/messages/responses/event_message.dart) objects. Here is an example: +If your application needs to process these kinds of events, you can use the ```listenForServerEvents``` method of the connection pool. This method accepts a [List](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:core.List) of [EventRegistrationType](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/types/enums/event_registration_type.dart) values and returns back a Dart [Stream](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:async.Stream) that emits [EventMessage](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/protocol/messages/responses/event_message.dart) objects. Here is an example: ```dart client.connectionPool.listenForServerEvents([ @@ -429,10 +429,10 @@ For more granular error handling you can test for the following exception types: | Exception type | Thrown |:------------------------------|:------------------- -| [NoHealthyConnectionsException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/exception/no_healthy_connections_exception.dart) | When the connection pool contains no healthy connections -| [AuthenticationException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/exception/authentication_exception.dart) | When authentication failed, missing Authentication provider or unsupported Authentication provider -| [CassandraException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/exception/cassandra_exception.dart) | When cassandra reports an exception (invalid query, cannot meet consistency requirement e.t.c) -| [DriverException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/exception/driver_exception.dart) | General driver exception +| [NoHealthyConnectionsException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/exception/no_healthy_connections_exception.dart) | When the connection pool contains no healthy connections +| [AuthenticationException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/exception/authentication_exception.dart) | When authentication failed, missing Authentication provider or unsupported Authentication provider +| [CassandraException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/exception/cassandra_exception.dart) | When cassandra reports an exception (invalid query, cannot meet consistency requirement e.t.c) +| [DriverException](https://github.com/achilleasa/dart_cassandra_cql/blob/master/lib/src/exception/driver_exception.dart) | General driver exception All of the above exceptions include a ```message``` getter for retrieving the exception cause and a ```stackTrace``` getter for accessing the stack trace (if available).