kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 6d192516fadabb55f082bf1d7018ace725a5a7e42a52e613ac6463e29a27fbbd |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2016-04-26 19:13 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-04-26 19:18 +02:00 |
| Parents | 136e41559246 |
2 files changed
modified changelog/README.md +1 −0
| @@ -18,6 +18,7 @@ | ||
| 18 | 18 | - [improvement] JAVA-1133: Add OSGi headers to cassandra-driver-extras. |
| 19 | 19 | - [bug] JAVA-1137: Incorrect string returned by DataType.asFunctionParameterString() for collections and tuples. |
| 20 | 20 | - [bug] JAVA-1046: (Dynamic)CompositeTypes need to be parsed as string literal, not blob. |
| 21 | +- [improvement] JAVA-1164: Clarify documentation on Host.listenAddress and broadcastAddress. | |
| 21 | 22 | |
| 22 | 23 | Merged from 2.1 branch: |
| 23 | 24 |
modified driver-core/src/main/java/com/datastax/driver/core/Host.java +13 −10
| @@ -164,18 +164,20 @@ | ||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
| 167 | - * Returns the node broadcast address, that is, the IP by which it should be contacted by other peers in the cluster. | |
| 167 | + * Returns the node broadcast address (that is, the IP by which it should be contacted by other peers in the | |
| 168 | + * cluster), if known. | |
| 168 | 169 | * <p/> |
| 169 | 170 | * This corresponds to the {@code broadcast_address} cassandra.yaml file setting and |
| 170 | 171 | * is by default the same as {@link #getListenAddress()}, unless specified |
| 171 | 172 | * otherwise in cassandra.yaml. |
| 172 | 173 | * <em>This is NOT the address clients should use to contact this node</em>. |
| 173 | 174 | * <p/> |
| 174 | - * Note that, depending on the Cassandra version the node is currently in, | |
| 175 | - * it might not be possible to determine the node's broadcast address, in which | |
| 176 | - * case this method will return {@code null}. | |
| 175 | + * This information is always available for peer hosts. For the control host, it's only available if CASSANDRA-9436 | |
| 176 | + * is fixed on the server side (Cassandra versions >= 2.0.16, 2.1.6, 2.2.0 rc1). For older versions, note that if | |
| 177 | + * the driver loses the control connection and reconnects to a different control host, the old control host becomes | |
| 178 | + * a peer, and therefore its broadcast address is updated. | |
| 177 | 179 | * |
| 178 | - * @return the node broadcast address. | |
| 180 | + * @return the node broadcast address, if known. Otherwise {@code null}. | |
| 179 | 181 | * @see <a href="https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html">The cassandra.yaml configuration file</a> |
| 180 | 182 | */ |
| 181 | 183 | public InetAddress getBroadcastAddress() { |
| @@ -183,16 +185,17 @@ | ||
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | /** |
| 186 | - * Returns the node listen address, that is, the IP the node uses to contact other peers in the cluster. | |
| 188 | + * Returns the node listen address (that is, the IP the node uses to contact other peers in the cluster), if known. | |
| 187 | 189 | * <p/> |
| 188 | 190 | * This corresponds to the {@code listen_address} cassandra.yaml file setting. |
| 189 | 191 | * <em>This is NOT the address clients should use to contact this node</em>. |
| 190 | 192 | * <p/> |
| 191 | - * Note that, depending on the Cassandra version the node is currently in, | |
| 192 | - * it might not be possible to determine the node's listen address, in which | |
| 193 | - * case this method will return {@code null}. | |
| 193 | + * This information is available for the control host if CASSANDRA-9603 is fixed on the server side (Cassandra | |
| 194 | + * versions >= 2.0.17, 2.1.8, 2.2.0 rc2). It's currently not available for peer hosts. Note that the current driver | |
| 195 | + * code already tries to read a {@code listen_address} column in {@code system.peers}; when a future Cassandra | |
| 196 | + * version adds it, it will be picked by the driver without any further change needed. | |
| 194 | 197 | * |
| 195 | - * @return the node listen address. | |
| 198 | + * @return the node listen address, if known. Otherwise {@code null}. | |
| 196 | 199 | * @see <a href="https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html">The cassandra.yaml configuration file</a> |
| 197 | 200 | */ |
| 198 | 201 | public InetAddress getListenAddress() { |