@Experimental public class LagAwareStrategy extends Object implements HealthCheckStrategy
This strategy uses the /v1/bdbs/<database_id>/availability REST API to verify whether the database is available to
perform read and write operations and can respond to queries from client applications.
When LagAwareStrategy.Config.isExtendedCheckEnabled() is true, performs a lag-aware availability check using the
extend_check=lag query parameter.
The lag tolerance threshold can be configured via LagAwareStrategy.Config.getAvailabilityLagTolerance() (default: 100ms).
| Modifier and Type | Class and Description |
|---|---|
static class |
LagAwareStrategy.Config |
| Constructor and Description |
|---|
LagAwareStrategy(LagAwareStrategy.Config config) |
LagAwareStrategy(LagAwareStrategy.Config config,
HttpClient httpClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close any resources used by the health check strategy.
|
HealthStatus |
doHealthCheck(RedisURI endpoint)
Perform the health check for the given endpoint.
|
int |
getDelayInBetweenProbes()
Get the delay (in milliseconds) between retries for failed health checks.
|
int |
getInterval()
Get the interval (in milliseconds) between health checks.
|
int |
getNumProbes()
Get the number of probes for health checks to repeat.
|
ProbingPolicy |
getPolicy()
Get the policy for health checks.
|
int |
getTimeout()
Get the timeout (in milliseconds) for a health check.
|
public LagAwareStrategy(LagAwareStrategy.Config config)
public LagAwareStrategy(LagAwareStrategy.Config config, HttpClient httpClient)
public int getInterval()
HealthCheckStrategygetInterval in interface HealthCheckStrategypublic int getTimeout()
HealthCheckStrategygetTimeout in interface HealthCheckStrategypublic int getNumProbes()
HealthCheckStrategygetNumProbes in interface HealthCheckStrategypublic ProbingPolicy getPolicy()
HealthCheckStrategygetPolicy in interface HealthCheckStrategypublic int getDelayInBetweenProbes()
HealthCheckStrategygetDelayInBetweenProbes in interface HealthCheckStrategypublic HealthStatus doHealthCheck(RedisURI endpoint)
HealthCheckStrategydoHealthCheck in interface HealthCheckStrategyendpoint - the endpoint to checkpublic void close()
HealthCheckStrategyclose in interface HealthCheckStrategyclose in interface Closeableclose in interface AutoCloseableCopyright © 2026 lettuce.io. All rights reserved.