public class MonitorConnectionContext
extends java.lang.Object
| Constructor and Description |
|---|
MonitorConnectionContext(IMonitor monitor,
JdbcConnection connectionToAbort,
Log log,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getExpectedActiveMonitoringStartTimeNano() |
int |
getFailureDetectionCount() |
int |
getFailureDetectionIntervalMillis() |
int |
getFailureDetectionTimeMillis() |
IMonitor |
getMonitor() |
boolean |
isActiveContext() |
boolean |
isNodeUnhealthy() |
void |
setInactive() |
void |
updateConnectionStatus(java.lang.String nodeName,
long statusCheckStartNano,
long statusCheckEndNano,
boolean isValid)
Update whether the connection is still valid if the total elapsed time has passed the
grace period.
|
public MonitorConnectionContext(IMonitor monitor, JdbcConnection connectionToAbort, Log log, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount)
monitor - A reference to a monitor object.connectionToAbort - A reference to the connection associated with this context
that will be aborted in case of server failure.log - A Log implementation.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.public int getFailureDetectionTimeMillis()
public int getFailureDetectionIntervalMillis()
public int getFailureDetectionCount()
public long getExpectedActiveMonitoringStartTimeNano()
public IMonitor getMonitor()
public boolean isNodeUnhealthy()
public boolean isActiveContext()
public void setInactive()
public void updateConnectionStatus(java.lang.String nodeName,
long statusCheckStartNano,
long statusCheckEndNano,
boolean isValid)
nodeName - A node name for logging purposes.statusCheckStartNano - The time when connection status check started in nanoseconds.statusCheckEndNano - The time when connection status check ended in nanoseconds.isValid - Whether the connection is valid.