| Modifier and Type | Field and Description |
|---|---|
protected static java.util.concurrent.Executor |
ABORT_EXECUTOR |
protected static java.lang.String |
MONITORING_PROPERTY_PREFIX |
protected static long |
THREAD_SLEEP_NANO |
| Constructor and Description |
|---|
Monitor(IConnectionProvider connectionProvider,
HostInfo hostInfo,
PropertySet propertySet,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount,
Log logger)
Store the monitoring configuration for a connection.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDispose() |
void |
clearContexts() |
void |
close() |
void |
newContextRun() |
void |
run() |
void |
startMonitoring(MonitorConnectionContext context) |
protected static final java.lang.String MONITORING_PROPERTY_PREFIX
protected static final long THREAD_SLEEP_NANO
protected static final java.util.concurrent.Executor ABORT_EXECUTOR
public Monitor(IConnectionProvider connectionProvider, HostInfo hostInfo, PropertySet propertySet, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount, Log logger)
connectionProvider - A provider for creating new connections.hostInfo - The HostInfo of the server this Monitor instance is
monitoring.propertySet - The PropertySet containing additional monitoring configuration.failureDetectionTimeMillis - Grace period after which node monitoring starts.failureDetectionIntervalMillis - Interval between each failed connection check.failureDetectionCount - Number of failed connection checks before considering
database node as unhealthy.logger - A Log implementation.public boolean canDispose()
canDispose in interface IMonitorpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic void startMonitoring(MonitorConnectionContext context)
startMonitoring in interface IMonitorpublic void clearContexts()
public void newContextRun()
public void run()
run in interface java.lang.Runnable