Elffuss BraidHub

kikocis/java-driver public

JAVA-1164: Clarify documentation on Host.listenAddress and broadcastAddress.
Changeset6d192516fadabb55f082bf1d7018ace725a5a7e42a52e613ac6463e29a27fbbd
Authorolim7t <omichallat+github@gmail.com> · 2016-04-26 19:13 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2016-04-26 19:18 +02:00
Parents136e41559246

Browse the files at this changeset

2 files changed

modified changelog/README.md +1 −0
@@ -18,6 +18,7 @@
1818 - [improvement] JAVA-1133: Add OSGi headers to cassandra-driver-extras.
1919 - [bug] JAVA-1137: Incorrect string returned by DataType.asFunctionParameterString() for collections and tuples.
2020 - [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.
2122
2223 Merged from 2.1 branch:
2324
modified driver-core/src/main/java/com/datastax/driver/core/Host.java +13 −10
@@ -164,18 +164,20 @@
164164 }
165165
166166 /**
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.
168169 * <p/>
169170 * This corresponds to the {@code broadcast_address} cassandra.yaml file setting and
170171 * is by default the same as {@link #getListenAddress()}, unless specified
171172 * otherwise in cassandra.yaml.
172173 * <em>This is NOT the address clients should use to contact this node</em>.
173174 * <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.
177179 *
178- * @return the node broadcast address.
180+ * @return the node broadcast address, if known. Otherwise {@code null}.
179181 * @see <a href="https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html">The cassandra.yaml configuration file</a>
180182 */
181183 public InetAddress getBroadcastAddress() {
@@ -183,16 +185,17 @@
183185 }
184186
185187 /**
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.
187189 * <p/>
188190 * This corresponds to the {@code listen_address} cassandra.yaml file setting.
189191 * <em>This is NOT the address clients should use to contact this node</em>.
190192 * <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.
194197 *
195- * @return the node listen address.
198+ * @return the node listen address, if known. Otherwise {@code null}.
196199 * @see <a href="https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html">The cassandra.yaml configuration file</a>
197200 */
198201 public InetAddress getListenAddress() {