kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 92def205f1cf72c4d489442a195875dd7f229f4d1ec45ac5fa1a6a1bdcbf86dd |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-11-13 11:16 +01:00 |
| Committer | Alexandre Dutra <alexandre.dutra@datastax.com> · 2015-11-13 11:16 +01:00 |
| Parents | 81ec312eada8 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +17 −11
| @@ -435,10 +435,14 @@ | ||
| 435 | 435 | * <p> |
| 436 | 436 | * Registering the same listener multiple times is a no-op. |
| 437 | 437 | * <p> |
| 438 | - * Note that while {@link LoadBalancingPolicy} implements | |
| 439 | - * {@code Host.StateListener}, the configured load balancing does not | |
| 440 | - * need to (and should not) be registered through this method to | |
| 441 | - * received host related events. | |
| 438 | + * This method should be used to register additional listeners | |
| 439 | + * on an already-initialized cluster. | |
| 440 | + * To add listeners to a cluster object prior to its initialization, | |
| 441 | + * use {@link Builder#withInitialListeners(Collection)}. | |
| 442 | + * Calling this method on a non-initialized cluster | |
| 443 | + * will result in the listener being | |
| 444 | + * {@link com.datastax.driver.core.Host.StateListener#onRegister(Cluster) notified} | |
| 445 | + * twice of cluster registration: once inside this method, and once at cluster initialization. | |
| 442 | 446 | * |
| 443 | 447 | * @param listener the new {@link Host.StateListener} to register. |
| 444 | 448 | * @return this {@code Cluster} object; |
| @@ -453,7 +457,7 @@ | ||
| 453 | 457 | /** |
| 454 | 458 | * Unregisters the provided listener from being notified on hosts events. |
| 455 | 459 | * <p> |
| 456 | - * This method is a no-op if {@code listener} hadn't previously be | |
| 460 | + * This method is a no-op if {@code listener} hasn't previously been | |
| 457 | 461 | * registered against this Cluster. |
| 458 | 462 | * |
| 459 | 463 | * @param listener the {@link Host.StateListener} to unregister. |
| @@ -472,13 +476,15 @@ | ||
| 472 | 476 | * <p> |
| 473 | 477 | * Registering the same listener multiple times is a no-op. |
| 474 | 478 | * <p> |
| 475 | - * Be wary that the registered tracker {@code update} method will be call | |
| 479 | + * Beware that the registered tracker's | |
| 480 | + * {@link LatencyTracker#update(Host, Statement, Exception, long) update} | |
| 481 | + * method will be called | |
| 476 | 482 | * very frequently (at the end of every query to a Cassandra host) and |
| 477 | 483 | * should thus not be costly. |
| 478 | 484 | * <p> |
| 479 | - * The main use case for a {@code LatencyTracker} is so | |
| 480 | - * {@link LoadBalancingPolicy} can implement latency awareness | |
| 481 | - * Typically, {@link LatencyAwarePolicy} registers it's own internal | |
| 485 | + * The main use case for a {@link LatencyTracker} is to allow | |
| 486 | + * load balancing policies to implement latency awareness. | |
| 487 | + * For example, {@link LatencyAwarePolicy} registers it's own internal | |
| 482 | 488 | * {@code LatencyTracker} (automatically, you don't have to call this |
| 483 | 489 | * method directly). |
| 484 | 490 | * |
| @@ -496,7 +502,7 @@ | ||
| 496 | 502 | * Unregisters the provided latency tracking from being updated |
| 497 | 503 | * with host read latencies. |
| 498 | 504 | * <p> |
| 499 | - * This method is a no-op if {@code tracker} hadn't previously be | |
| 505 | + * This method is a no-op if {@code tracker} hasn't previously been | |
| 500 | 506 | * registered against this Cluster. |
| 501 | 507 | * |
| 502 | 508 | * @param tracker the {@link LatencyTracker} to unregister. |
| @@ -528,7 +534,7 @@ | ||
| 528 | 534 | * Unregisters the provided schema change listener from being updated |
| 529 | 535 | * with schema change events. |
| 530 | 536 | * <p> |
| 531 | - * This method is a no-op if {@code listener} hadn't previously be | |
| 537 | + * This method is a no-op if {@code listener} hasn't previously been | |
| 532 | 538 | * registered against this Cluster. |
| 533 | 539 | * |
| 534 | 540 | * @param listener the {@link SchemaChangeListener} to unregister. |