Class CacheHealthCheck
java.lang.Object
org.gcube.informationsystem.resourceregistry.health.CacheHealthCheck
- All Implemented Interfaces:
org.gcube.common.health.api.HealthCheck
Readiness of the cache (Redis): the service is degraded when the cache is not reachable, since
the caches and the cluster events fall back to the database and every operation still runs.
The health report is public: its messages are fixed sentences, the details go to the log.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhat the check verifies, shown next to its name in the health report.static final StringThe name of the check in the health report.static final StringThe reason given when the state of the cache cannot be read.static final StringThe reason given when the cache is not reachable. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
NAME
The name of the check in the health report.- See Also:
-
DESCRIPTION
What the check verifies, shown next to its name in the health report.- See Also:
-
UNREACHABLE
The reason given when the cache is not reachable.- See Also:
-
UNKNOWN
The reason given when the state of the cache cannot be read.- See Also:
-
-
Constructor Details
-
CacheHealthCheck
public CacheHealthCheck()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.gcube.common.health.api.HealthCheck
-
getDescription
- Specified by:
getDescriptionin interfaceorg.gcube.common.health.api.HealthCheck
-
check
public org.gcube.common.health.api.response.HealthCheckResponse check()Reads the state of the Redis connection, which a background thread checks and establishes again: it never waits for Redis.- Specified by:
checkin interfaceorg.gcube.common.health.api.HealthCheck- Returns:
upwhen the connection is open,degradedwith the reason otherwise
-