public class HostMonitorConnectionContext
extends java.lang.Object
| Constructor and Description |
|---|
HostMonitorConnectionContext(HostMonitor monitor,
java.sql.Connection connectionToAbort,
long failureDetectionTimeMillis,
long failureDetectionIntervalMillis,
long failureDetectionCount,
TelemetryCounter abortedConnectionsCounter)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getExpectedActiveMonitoringStartTimeNano() |
long |
getFailureCount() |
long |
getFailureDetectionCount() |
long |
getFailureDetectionIntervalMillis() |
java.util.concurrent.locks.ReentrantLock |
getLock() |
HostMonitor |
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 HostMonitorConnectionContext(HostMonitor monitor, java.sql.Connection connectionToAbort, long failureDetectionTimeMillis, long failureDetectionIntervalMillis, long failureDetectionCount, TelemetryCounter abortedConnectionsCounter)
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.abortedConnectionsCounter - Aborted connection telemetry counter.public long getFailureDetectionIntervalMillis()
public long getFailureDetectionCount()
public long getFailureCount()
public long getExpectedActiveMonitoringStartTimeNano()
public HostMonitor 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.public java.util.concurrent.locks.ReentrantLock getLock()