public class MonitorConnectionContext
extends java.lang.Object
| Constructor and Description |
|---|
MonitorConnectionContext(Monitor monitor,
java.sql.Connection connectionToAbort,
long failureDetectionTimeMillis,
long failureDetectionIntervalMillis,
long failureDetectionCount)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getExpectedActiveMonitoringStartTimeNano() |
long |
getFailureCount() |
long |
getFailureDetectionCount() |
long |
getFailureDetectionIntervalMillis() |
Monitor |
getMonitor() |
boolean |
isActiveContext() |
boolean |
isNodeUnhealthy() |
void |
setInactive() |
void |
updateConnectionStatus(java.lang.String hostName,
long statusCheckStartTimeNano,
long statusCheckEndTimeNano,
boolean isValid)
Update whether the connection is still valid if the total elapsed time has passed the grace
period.
|
public MonitorConnectionContext(Monitor monitor, java.sql.Connection connectionToAbort, long failureDetectionTimeMillis, long failureDetectionIntervalMillis, long 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.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 long getFailureDetectionIntervalMillis()
public long getFailureDetectionCount()
public long getFailureCount()
public long getExpectedActiveMonitoringStartTimeNano()
public Monitor getMonitor()
public boolean isNodeUnhealthy()
public boolean isActiveContext()
public void setInactive()
public void updateConnectionStatus(java.lang.String hostName,
long statusCheckStartTimeNano,
long statusCheckEndTimeNano,
boolean isValid)
hostName - A node name for logging purposes.statusCheckStartTimeNano - The time when connection status check started in nanos.statusCheckEndTimeNano - The time when connection status check ended in nanos.isValid - Whether the connection is valid.