public class MonitoringRdsHostListProvider extends RdsHostListProvider implements BlockingHostListProvider, CanReleaseResources
RdsHostListProvider.ClusterSuggestedResult, RdsHostListProvider.FetchTopologyResult| Modifier and Type | Field and Description |
|---|---|
static AwsWrapperProperty |
CLUSTER_TOPOLOGY_HIGH_REFRESH_RATE_MS |
protected long |
highRefreshRateNano |
protected PluginService |
pluginService |
protected FullServicesContainer |
servicesContainer |
protected java.lang.String |
writerTopologyQuery |
CLUSTER_ID, CLUSTER_INSTANCE_HOST_PATTERN, CLUSTER_TOPOLOGY_REFRESH_RATE_MS, clusterId, clusterInstanceTemplate, connectionUrlParser, defaultTopologyQueryTimeoutMs, hostList, hostListProviderService, initialHostList, initialHostSpec, isInitialized, isPrimaryClusterId, isReaderQuery, lock, networkTimeoutExecutor, nodeIdQuery, originalUrl, primaryClusterIdCache, properties, rdsHelper, rdsUrlType, refreshRateNano, suggestedClusterIdRefreshRateNano, suggestedPrimaryClusterIdCache, topologyQuery| Constructor and Description |
|---|
MonitoringRdsHostListProvider(java.util.Properties properties,
java.lang.String originalUrl,
FullServicesContainer servicesContainer,
java.lang.String topologyQuery,
java.lang.String nodeIdQuery,
java.lang.String isReaderQuery,
java.lang.String writerTopologyQuery) |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache() |
protected void |
clusterIdChanged(java.lang.String oldClusterId) |
java.util.List<HostSpec> |
forceRefresh(boolean shouldVerifyWriter,
long timeoutMs)
Force a host list provider to update its topology information.
|
protected void |
init() |
protected ClusterTopologyMonitor |
initMonitor() |
protected java.util.List<HostSpec> |
queryForTopology(java.sql.Connection conn)
Obtain a cluster topology from database.
|
void |
releaseResources()
An object that implements this interface should release all acquired resources assuming it may
be disposed at any time.
|
clear, clearAll, createHost, createHost, forceRefresh, forceRefresh, getClusterId, getHostEndpoint, getHostRole, getRdsUrlType, getStoredTopology, getSuggestedClusterId, getTopology, identifyConnection, refresh, refresh, suggestPrimaryClusterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforceRefresh, forceRefresh, getClusterId, getHostRole, identifyConnection, refresh, refreshpublic static final AwsWrapperProperty CLUSTER_TOPOLOGY_HIGH_REFRESH_RATE_MS
protected final FullServicesContainer servicesContainer
protected final PluginService pluginService
protected final long highRefreshRateNano
protected final java.lang.String writerTopologyQuery
public MonitoringRdsHostListProvider(java.util.Properties properties,
java.lang.String originalUrl,
FullServicesContainer servicesContainer,
java.lang.String topologyQuery,
java.lang.String nodeIdQuery,
java.lang.String isReaderQuery,
java.lang.String writerTopologyQuery)
public static void clearCache()
protected void init()
throws java.sql.SQLException
init in class RdsHostListProviderjava.sql.SQLExceptionprotected ClusterTopologyMonitor initMonitor() throws java.sql.SQLException
java.sql.SQLExceptionprotected java.util.List<HostSpec> queryForTopology(java.sql.Connection conn) throws java.sql.SQLException
RdsHostListProviderqueryForTopology in class RdsHostListProviderconn - A connection to database to fetch the latest topology.HostSpec objects representing the topologyjava.sql.SQLException - if errors occurred while retrieving the topology.protected void clusterIdChanged(java.lang.String oldClusterId)
throws java.sql.SQLException
clusterIdChanged in class RdsHostListProviderjava.sql.SQLExceptionpublic java.util.List<HostSpec> forceRefresh(boolean shouldVerifyWriter, long timeoutMs) throws java.sql.SQLException, java.util.concurrent.TimeoutException
BlockingHostListProviderforceRefresh in interface BlockingHostListProvidershouldVerifyWriter - a flag indicating that the provider should verify the writer before
returning the updated topology.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 topology update takes longer time than expectedpublic void releaseResources()
CanReleaseResourcesCalling this method does NOT mean that an object is disposing and there won't be any further calls. An object should keep its functional state after calling this method.
releaseResources in interface CanReleaseResources