public interface HostListProvider
| Modifier and Type | Method and Description |
|---|---|
@Nullable java.util.List<HostSpec> |
forceRefresh()
Force a host list provider to update its topology information.
|
@Nullable java.util.List<HostSpec> |
forceRefresh(boolean verifyTopology,
long timeoutMs)
Force a host list provider to update its topology information.
|
java.lang.String |
getClusterId() |
@Nullable java.util.List<HostSpec> |
getCurrentTopology(java.sql.Connection conn,
HostSpec initialHostSpec)
Get current topology information for the connected database.
|
java.util.List<HostSpec> |
refresh() |
void |
stopMonitor() |
@Nullable java.util.List<HostSpec> getCurrentTopology(java.sql.Connection conn, HostSpec initialHostSpec) throws java.sql.SQLException
StaticHostListProvider. The returned topology should be fresh info returned from a topology
query if `this` is a DynamicHostListProvider,conn - the connection to use to query the database for topology information, if needed.initialHostSpec - the host details of the initial connection.java.sql.SQLException - if an error occurs while attempting to acquire the database topology information.java.util.List<HostSpec> refresh() throws java.sql.SQLException
java.sql.SQLException@Nullable java.util.List<HostSpec> forceRefresh() throws java.sql.SQLException, java.util.concurrent.TimeoutException
forceRefresh(boolean, long) instead.java.sql.SQLException - if there's errors updating topologyjava.util.concurrent.TimeoutException - if topology update takes longer time than expected@Nullable java.util.List<HostSpec> forceRefresh(boolean verifyTopology, long timeoutMs) throws java.sql.SQLException, java.util.concurrent.TimeoutException
verifyTopology - defines whether extra measures should be taken to verify the topology. If false, the method
will return as soon as topology is successfully retrieved from any instance. If true, extra
steps are taken to verify the topology is accurate.timeoutMs - timeout in msec to wait until topology is updated or the writer is verified. If a timeout of
0 is provided, a topology update will be initiated but cached topology will be returned. If a
non-zero timeout is provided and the timeout is hit, a TimeoutException will be thrown.java.sql.SQLException - if there's errors updating topologyjava.util.concurrent.TimeoutException - if the timeout is hitjava.lang.String getClusterId()
throws java.lang.UnsupportedOperationException,
java.sql.SQLException
java.lang.UnsupportedOperationExceptionjava.sql.SQLExceptionvoid stopMonitor()