kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 612056fe2567ef58dfd9837c96a981108a220021ffbcf5dd0a60565f936d87ea |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-28 10:29 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-01-04 18:04 +01:00 |
| Parents | bf1b4ac3f151 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/Session.java +25 −25
| @@ -26,15 +26,15 @@ | ||
| 26 | 26 | * <p/> |
| 27 | 27 | * Each session maintains multiple connections to the cluster nodes, |
| 28 | 28 | * provides policies to choose which node to use for each query (round-robin on |
| 29 | - * all nodes of the cluster by default), and handles retries for failed query (when | |
| 29 | + * all nodes of the cluster by default), and handles retries for failed queries (when | |
| 30 | 30 | * it makes sense), etc... |
| 31 | 31 | * <p/> |
| 32 | 32 | * Session instances are thread-safe and usually a single instance is enough |
| 33 | 33 | * per application. As a given session can only be "logged" into one keyspace at |
| 34 | - * a time (where the "logged" keyspace is the one used by query if the query doesn't | |
| 35 | - * explicitely use a fully qualified table name), it can make sense to create one | |
| 36 | - * session per keyspace used. This is however not necessary to query multiple keyspaces | |
| 37 | - * since it is always possible to use a single session with fully qualified table name | |
| 34 | + * a time (where the "logged" keyspace is the one used by queries that don't | |
| 35 | + * explicitly use a fully qualified table name), it can make sense to create one | |
| 36 | + * session per keyspace used. This is however not necessary when querying multiple keyspaces | |
| 37 | + * since it is always possible to use a single session with fully qualified table names | |
| 38 | 38 | * in queries. |
| 39 | 39 | */ |
| 40 | 40 | public interface Session extends Closeable { |
| @@ -54,18 +54,18 @@ | ||
| 54 | 54 | * Force the initialization of this Session instance if it hasn't been |
| 55 | 55 | * initialized yet. |
| 56 | 56 | * <p/> |
| 57 | - * Please note first that most use won't need to call this method | |
| 58 | - * explicitly. If you use the {@link Cluster#connect} method {@code Cluster} | |
| 57 | + * Please note first that most users won't need to call this method | |
| 58 | + * explicitly. If you use the {@link Cluster#connect} method | |
| 59 | 59 | * to create your Session, the returned session will be already |
| 60 | 60 | * initialized. Even if you create a non-initialized session through |
| 61 | 61 | * {@link Cluster#newSession}, that session will get automatically |
| 62 | - * initialized the first time that session is used for querying. This method | |
| 62 | + * initialized the first time it is used for querying. This method | |
| 63 | 63 | * is thus only useful if you use {@link Cluster#newSession} and want to |
| 64 | 64 | * explicitly force initialization without querying. |
| 65 | 65 | * <p/> |
| 66 | 66 | * Session initialization consists in connecting the Session to the known |
| 67 | 67 | * Cassandra hosts (at least those that should not be ignored due to |
| 68 | - * the {@code LoadBalancingPolicy} in place). | |
| 68 | + * the {@link com.datastax.driver.core.policies.LoadBalancingPolicy LoadBalancingPolicy} in place). | |
| 69 | 69 | * <p/> |
| 70 | 70 | * If the Cluster instance this Session depends on is not itself |
| 71 | 71 | * initialized, it will be initialized by this method. |
| @@ -74,10 +74,10 @@ | ||
| 74 | 74 | * |
| 75 | 75 | * @return this {@code Session} object. |
| 76 | 76 | * @throws NoHostAvailableException if this initialization triggers the |
| 77 | - * Cluster initialization and no host amongst the contact points can be | |
| 77 | + * {@link Cluster} initialization and no host amongst the contact points can be | |
| 78 | 78 | * reached. |
| 79 | 79 | * @throws AuthenticationException if this initialization triggers the |
| 80 | - * Cluster initialization and an authentication error occurs while contacting | |
| 80 | + * {@link Cluster} initialization and an authentication error occurs while contacting | |
| 81 | 81 | * the initial contact points. |
| 82 | 82 | */ |
| 83 | 83 | Session init(); |
| @@ -138,7 +138,7 @@ | ||
| 138 | 138 | * database. However, for SELECT queries, it does not guarantee that the |
| 139 | 139 | * result has been received in full. But it does guarantee that some |
| 140 | 140 | * response has been received from the database, and in particular |
| 141 | - * guarantee that if the request is invalid, an exception will be thrown | |
| 141 | + * guarantees that if the request is invalid, an exception will be thrown | |
| 142 | 142 | * by this method. |
| 143 | 143 | * |
| 144 | 144 | * @param statement the CQL query to execute (that can be any {@link Statement}). |
| @@ -192,11 +192,11 @@ | ||
| 192 | 192 | * submitted to a live node. Any exception pertaining to the failure of the |
| 193 | 193 | * query will be thrown when accessing the {@link ResultSetFuture}. |
| 194 | 194 | * <p/> |
| 195 | - * Note that for queries that doesn't return a result (INSERT, UPDATE and | |
| 196 | - * DELETE), you will need to access the ResultSetFuture (that is call one of | |
| 197 | - * its get method to make sure the query was successful. | |
| 195 | + * Note that for queries that don't return a result (INSERT, UPDATE and | |
| 196 | + * DELETE), you will need to access the ResultSetFuture (that is, call one of | |
| 197 | + * its {@code get} methods to make sure the query was successful. | |
| 198 | 198 | * |
| 199 | - * @param statement the CQL query to execute (that can be either any {@code Statement}. | |
| 199 | + * @param statement the CQL query to execute (that can be any {@code Statement}). | |
| 200 | 200 | * @return a future on the result of the query. |
| 201 | 201 | * @throws UnsupportedFeatureException if the protocol version 1 is in use and |
| 202 | 202 | * a feature not supported has been used. Features that are not supported by |
| @@ -287,7 +287,7 @@ | ||
| 287 | 287 | * Initiates a shutdown of this session instance. |
| 288 | 288 | * <p/> |
| 289 | 289 | * This method is asynchronous and return a future on the completion |
| 290 | - * of the shutdown process. As soon a the session is shutdown, no | |
| 290 | + * of the shutdown process. As soon as the session is shutdown, no | |
| 291 | 291 | * new request will be accepted, but already submitted queries are |
| 292 | 292 | * allowed to complete. This method closes all connections of this |
| 293 | 293 | * session and reclaims all resources used by it. |
| @@ -328,7 +328,7 @@ | ||
| 328 | 328 | /** |
| 329 | 329 | * Whether this Session instance has been closed. |
| 330 | 330 | * <p/> |
| 331 | - * Note that this method returns true as soon as one closing this Session | |
| 331 | + * Note that this method returns true as soon as the closing of this Session | |
| 332 | 332 | * has started but it does not guarantee that the closing is done. If you |
| 333 | 333 | * want to guarantee that the closing is done, you can call {@code close()} |
| 334 | 334 | * and wait until it returns (or call the get method on {@code closeAsync()} |
| @@ -362,7 +362,7 @@ | ||
| 362 | 362 | * The state of a Session. |
| 363 | 363 | * <p/> |
| 364 | 364 | * This mostly exposes information on the connections maintained by a Session: |
| 365 | - * which host it is connected to, how many connection is has for each host, etc... | |
| 365 | + * which host it is connected to, how many connections it has for each host, etc... | |
| 366 | 366 | */ |
| 367 | 367 | interface State { |
| 368 | 368 | /** |
| @@ -377,9 +377,9 @@ | ||
| 377 | 377 | * this State has been grabbed). |
| 378 | 378 | * <p/> |
| 379 | 379 | * Please note that this method really returns the hosts for which the session currently |
| 380 | - * holds a connection pool. A such, it's unlikely but not impossible for a host to be listed | |
| 380 | + * holds a connection pool. As such, it's unlikely but not impossible for a host to be listed | |
| 381 | 381 | * in the output of this method but to have {@code getOpenConnections} return 0, if the |
| 382 | - * pool itself is created but not connections have been successfully opened yet. | |
| 382 | + * pool itself is created but no connections have been successfully opened yet. | |
| 383 | 383 | * |
| 384 | 384 | * @return an immutable collection of the hosts to which the session is connected. |
| 385 | 385 | */ |
| @@ -412,11 +412,11 @@ | ||
| 412 | 412 | int getTrashedConnections(Host host); |
| 413 | 413 | |
| 414 | 414 | /** |
| 415 | - * The number of queries that are currently being executed though a given host. | |
| 415 | + * The number of queries that are currently being executed through a given host. | |
| 416 | 416 | * <p/> |
| 417 | - * This correspond to the number of queries that have been sent (by the session this | |
| 418 | - * is a State of) to the Cassandra Host on one of its connection but haven't yet returned. | |
| 419 | - * In that sense this provide a sort of measure of how busy the connections to that node | |
| 417 | + * This corresponds to the number of queries that have been sent (by the session this | |
| 418 | + * is a State of) to the Cassandra Host on one of its connections but haven't yet returned. | |
| 419 | + * In that sense this provides a sort of measure of how busy the connections to that node | |
| 420 | 420 | * are (at the time the {@code State} was grabbed at least). |
| 421 | 421 | * |
| 422 | 422 | * @param host the host to get in-flight queries for. |