Elffuss BraidHub

kikocis/java-driver public

Expose host state in public API.
Changeseta5bd5b316c2fe824562cdd7b10485289255906cb59181ee5ad5bcaeb4dd6f262
Authorolim7t <omichallat+github@gmail.com> · 2015-04-17 14:39 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-04-17 14:39 +02:00
Parentsacbf45c5758c

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/Host.java +13 −0
@@ -191,6 +191,19 @@
191191 return state == State.UP || state == State.SUSPECT;
192192 }
193193
194+ /**
195+ * Returns a description of the host's state, as seen by the driver.
196+ * <p>
197+ * This is exposed for debugging purposes only; the format of this string might
198+ * change between driver versions, so clients should not make any assumptions
199+ * about it.
200+ *
201+ * @return a description of the host's state.
202+ */
203+ public String getState() {
204+ return state.name();
205+ }
206+
194207 /**
195208 * Returns a {@code ListenableFuture} representing the completion of the first
196209 * reconnection attempt after a node has been suspected.