public class MonitorServiceImpl extends java.lang.Object implements MonitorService
| 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 MonitorInitializer |
monitorInitializer |
protected static SlidingExpirationCacheWithCleanupThread<java.lang.String,Monitor> |
monitors |
protected PluginService |
pluginService |
protected TelemetryFactory |
telemetryFactory |
| Constructor and Description |
|---|
MonitorServiceImpl(@NonNull PluginService pluginService) |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache() |
protected Monitor |
getMonitor(HostSpec hostSpec,
java.util.Properties properties,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount)
Get or create a
MonitorImpl for a server. |
void |
releaseResources() |
MonitorConnectionContext |
startMonitoring(java.sql.Connection connectionToAbort,
HostSpec hostSpec,
java.util.Properties properties,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount) |
void |
stopMonitoring(@NonNull MonitorConnectionContext context,
@NonNull java.sql.Connection connectionToAbort)
Stop monitoring for a connection represented by the given
MonitorConnectionContext. |
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,Monitor> monitors
protected final PluginService pluginService
protected final MonitorInitializer monitorInitializer
protected final TelemetryFactory telemetryFactory
protected final TelemetryCounter abortedConnectionsCounter
public MonitorServiceImpl(@NonNull PluginService pluginService)
public static void clearCache()
public MonitorConnectionContext startMonitoring(java.sql.Connection connectionToAbort, HostSpec hostSpec, java.util.Properties properties, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount)
startMonitoring in interface MonitorServicepublic void stopMonitoring(@NonNull MonitorConnectionContext context, @NonNull java.sql.Connection connectionToAbort)
MonitorServiceMonitorConnectionContext.
Removes the context from the MonitorImpl.stopMonitoring in interface MonitorServicecontext - The MonitorConnectionContext representing a connection.public void releaseResources()
releaseResources in interface MonitorServiceprotected Monitor getMonitor(HostSpec hostSpec, java.util.Properties properties, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount)
MonitorImpl for a server.hostSpec - Information such as hostname of the server.properties - The user configuration for the current connection.MonitorImpl object associated with a specific server.