public class MonitoringRdsHostListProvider extends RdsHostListProvider implements BlockingHostListProvider, CanReleaseResources
RdsHostListProvider.ClusterSuggestedResult| Modifier and Type | Field and Description |
|---|---|
protected static long |
CACHE_CLEANUP_NANO |
static AwsWrapperProperty |
CLUSTER_TOPOLOGY_HIGH_REFRESH_RATE_MS |
protected long |
highRefreshRateNano |
protected static long |
MONITOR_EXPIRATION_NANO |
protected static SlidingExpirationCacheWithCleanupThread<java.lang.String,ClusterTopologyMonitor> |
monitors |
protected PluginService |
pluginService |
protected static long |
TOPOLOGY_CACHE_EXPIRATION_NANO |
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, topologyCache, topologyQuery| Constructor and Description |
|---|
MonitoringRdsHostListProvider(java.util.Properties properties,
java.lang.String originalUrl,
HostListProviderService hostListProviderService,
java.lang.String topologyQuery,
java.lang.String nodeIdQuery,
java.lang.String isReaderQuery,
java.lang.String writerTopologyQuery,
PluginService pluginService) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear topology cache for the current cluster.
|
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.
|
clearAll, createHost, createHost, forceRefresh, forceRefresh, getCachedTopology, getClusterId, getHostEndpoint, getHostRole, getRdsUrlType, getSuggestedClusterId, getTopology, identifyConnection, logCache, 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 static final long CACHE_CLEANUP_NANO
protected static final long MONITOR_EXPIRATION_NANO
protected static final long TOPOLOGY_CACHE_EXPIRATION_NANO
protected static final SlidingExpirationCacheWithCleanupThread<java.lang.String,ClusterTopologyMonitor> monitors
protected final PluginService pluginService
protected final long highRefreshRateNano
protected final java.lang.String writerTopologyQuery
public MonitoringRdsHostListProvider(java.util.Properties properties,
java.lang.String originalUrl,
HostListProviderService hostListProviderService,
java.lang.String topologyQuery,
java.lang.String nodeIdQuery,
java.lang.String isReaderQuery,
java.lang.String writerTopologyQuery,
PluginService pluginService)
public void clear()
clear in class RdsHostListProviderpublic static void clearCache()
protected void init()
throws java.sql.SQLException
init in class RdsHostListProviderjava.sql.SQLExceptionprotected ClusterTopologyMonitor initMonitor()
protected 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)
clusterIdChanged in class RdsHostListProviderpublic 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.SQLExceptionjava.util.concurrent.TimeoutExceptionpublic 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