public class MonitorConnectionContext
extends java.lang.Object
| Constructor and Description |
|---|
MonitorConnectionContext(java.sql.Connection connectionToAbort,
java.util.Set<java.lang.String> hostAliases,
long failureDetectionTimeMillis,
long failureDetectionIntervalMillis,
long failureDetectionCount)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getFailureCount() |
long |
getFailureDetectionCount() |
long |
getFailureDetectionIntervalMillis() |
long |
getFailureDetectionTimeMillis() |
long |
getInvalidNodeStartTime() |
void |
invalidate() |
boolean |
isActiveContext() |
boolean |
isNodeUnhealthy() |
void |
updateConnectionStatus(long statusCheckStartTime,
long currentTime,
boolean isValid)
Update whether the connection is still valid if the total elapsed time has passed the grace
period.
|
public MonitorConnectionContext(java.sql.Connection connectionToAbort,
java.util.Set<java.lang.String> hostAliases,
long failureDetectionTimeMillis,
long failureDetectionIntervalMillis,
long failureDetectionCount)
connectionToAbort - A reference to the connection associated with this context that will
be aborted in case of server failure.hostAliases - All valid references to the server.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 getFailureDetectionTimeMillis()
public long getFailureDetectionIntervalMillis()
public long getFailureDetectionCount()
public long getFailureCount()
public long getInvalidNodeStartTime()
public boolean isNodeUnhealthy()
public boolean isActiveContext()
public void invalidate()
public void updateConnectionStatus(long statusCheckStartTime,
long currentTime,
boolean isValid)
statusCheckStartTime - The time when connection status check started in nanos.currentTime - The time when connection status check ended in nanos.isValid - Whether the connection is valid.