public class HostMonitorServiceImpl extends java.lang.Object implements HostMonitorService
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.concurrent.Executor |
ABORT_EXECUTOR |
protected TelemetryCounter |
abortedConnectionsCounter |
protected static long |
CACHE_CLEANUP_NANO |
static AwsWrapperProperty |
MONITOR_DISPOSAL_TIME_MS |
protected HostMonitorInitializer |
monitorInitializer |
protected static SlidingExpirationCacheWithCleanupThread<java.lang.String,HostMonitor> |
monitors |
protected PluginService |
pluginService |
protected TelemetryFactory |
telemetryFactory |
| Constructor and Description |
|---|
HostMonitorServiceImpl(@NonNull PluginService pluginService) |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeAllMonitors() |
protected HostMonitor |
getMonitor(HostSpec hostSpec,
java.util.Properties properties,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount)
Get or create a
HostMonitorImpl for a server. |
void |
releaseResources() |
HostMonitorConnectionContext |
startMonitoring(java.sql.Connection connectionToAbort,
HostSpec hostSpec,
java.util.Properties properties,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount) |
void |
stopMonitoring(@NonNull HostMonitorConnectionContext context,
@NonNull java.sql.Connection connectionToAbort)
Stop monitoring for a connection represented by the given
HostMonitorConnectionContext. |
public static final AwsWrapperProperty MONITOR_DISPOSAL_TIME_MS
protected static final long CACHE_CLEANUP_NANO
protected static final java.util.concurrent.Executor ABORT_EXECUTOR
protected static final SlidingExpirationCacheWithCleanupThread<java.lang.String,HostMonitor> monitors
protected final PluginService pluginService
protected final HostMonitorInitializer monitorInitializer
protected final TelemetryFactory telemetryFactory
protected final TelemetryCounter abortedConnectionsCounter
public HostMonitorServiceImpl(@NonNull PluginService pluginService)
public static void closeAllMonitors()
public HostMonitorConnectionContext startMonitoring(java.sql.Connection connectionToAbort, HostSpec hostSpec, java.util.Properties properties, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount)
startMonitoring in interface HostMonitorServicepublic void stopMonitoring(@NonNull HostMonitorConnectionContext context, @NonNull java.sql.Connection connectionToAbort)
HostMonitorServiceHostMonitorConnectionContext.
Removes the context from the HostMonitorImpl.stopMonitoring in interface HostMonitorServicecontext - The HostMonitorConnectionContext representing a connection.connectionToAbort - A connection to abort.public void releaseResources()
releaseResources in interface HostMonitorServiceprotected HostMonitor getMonitor(HostSpec hostSpec, java.util.Properties properties, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount)
HostMonitorImpl for a server.hostSpec - Information such as hostname of the server.properties - The user configuration for the current connection.failureDetectionTimeMillis - A failure detection time in millis.failureDetectionIntervalMillis - A failure detection interval in millis.failureDetectionCount - A failure detection count.HostMonitorImpl object associated with a specific server.