public class MonitorConnectionContext
extends java.lang.Object
| Constructor and Description |
|---|
MonitorConnectionContext(JdbcConnection connectionToAbort,
java.util.Set<java.lang.String> nodeKeys,
Log log,
int failureDetectionTimeMillis,
int failureDetectionIntervalMillis,
int failureDetectionCount)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getFailureCount() |
int |
getFailureDetectionCount() |
int |
getFailureDetectionIntervalMillis() |
int |
getFailureDetectionTimeMillis() |
long |
getInvalidNodeStartTimeNano() |
void |
invalidate() |
boolean |
isActiveContext() |
boolean |
isNodeUnhealthy() |
void |
updateConnectionStatus(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(JdbcConnection connectionToAbort, java.util.Set<java.lang.String> nodeKeys, Log log, int failureDetectionTimeMillis, int failureDetectionIntervalMillis, int failureDetectionCount)
connectionToAbort - A reference to the connection associated with this context
that will be aborted in case of server failure.nodeKeys - All valid references to the server.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 int getFailureCount()
public long getInvalidNodeStartTimeNano()
public boolean isNodeUnhealthy()
public boolean isActiveContext()
public void invalidate()
public void updateConnectionStatus(long statusCheckStartNano,
long statusCheckEndNano,
boolean isValid)
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.