public class HostMonitorConnectionContextV1 extends HostMonitorConnectionContext
connectionToAbortRef, nodeUnhealthy| Constructor and Description |
|---|
HostMonitorConnectionContextV1() |
| Modifier and Type | Method and Description |
|---|---|
void |
abortConnection() |
long |
getExpectedActiveMonitoringStartTimeNano() |
long |
getFailureCount() |
long |
getFailureDetectionCount() |
long |
getFailureDetectionIntervalMillis() |
ResourceLock |
getLock() |
void |
init(java.sql.Connection connectionToAbort,
long failureDetectionTimeMillis,
long failureDetectionIntervalMillis,
long failureDetectionCount,
@Nullable TelemetryCounter abortedConnectionsCounter) |
boolean |
isActiveContext() |
boolean |
isInvalidNodeStartTimeDefined() |
void |
resetInvalidNodeStartTime() |
void |
setConnectionValid(java.lang.String hostName,
boolean connectionValid,
long statusCheckStartNano,
long statusCheckEndNano)
Set whether the connection to the server is still valid based on the monitoring settings set in
the
Connection. |
void |
setFailureCount(long failureCount) |
void |
setInactive()
Mark this context as inactive and release any connection references.
|
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.
|
getConnection, isActive, isNodeUnhealthy, setNodeUnhealthy, shouldAbortpublic void init(java.sql.Connection connectionToAbort,
long failureDetectionTimeMillis,
long failureDetectionIntervalMillis,
long failureDetectionCount,
@Nullable TelemetryCounter abortedConnectionsCounter)
public long getFailureDetectionIntervalMillis()
public long getFailureDetectionCount()
public long getFailureCount()
public long getExpectedActiveMonitoringStartTimeNano()
public void setFailureCount(long failureCount)
public void resetInvalidNodeStartTime()
public boolean isInvalidNodeStartTimeDefined()
public boolean isActiveContext()
public void setInactive()
ConnectionContextsetInactive in interface ConnectionContextsetInactive in class HostMonitorConnectionContextpublic void abortConnection()
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 void setConnectionValid(java.lang.String hostName,
boolean connectionValid,
long statusCheckStartNano,
long statusCheckEndNano)
Connection.
These monitoring settings include:
failureDetectionInterval
failureDetectionTime
failureDetectionCount
hostName - A node name for logging purposes.connectionValid - Boolean indicating whether the server is still responsive.statusCheckStartNano - The time when connection status check started in nanos.statusCheckEndNano - The time when connection status check ended in nanos.public ResourceLock getLock()