Class CacheHealthCheck

java.lang.Object
org.gcube.informationsystem.resourceregistry.health.CacheHealthCheck
All Implemented Interfaces:
org.gcube.common.health.api.HealthCheck

public class CacheHealthCheck extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    What the check verifies, shown next to its name in the health report.
    static final String
    The name of the check in the health report.
    static final String
    The reason given when the state of the cache cannot be read.
    static final String
    The reason given when the cache is not reachable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.gcube.common.health.api.response.HealthCheckResponse
    Reads the state of the Redis connection, which a background thread checks and establishes again: it never waits for Redis.
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NAME

      public static final String NAME
      The name of the check in the health report.
      See Also:
    • DESCRIPTION

      public static final String DESCRIPTION
      What the check verifies, shown next to its name in the health report.
      See Also:
    • UNREACHABLE

      public static final String UNREACHABLE
      The reason given when the cache is not reachable.
      See Also:
    • UNKNOWN

      public static final String UNKNOWN
      The reason given when the state of the cache cannot be read.
      See Also:
  • Constructor Details

    • CacheHealthCheck

      public CacheHealthCheck()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.gcube.common.health.api.HealthCheck
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.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:
      check in interface org.gcube.common.health.api.HealthCheck
      Returns:
      up when the connection is open, degraded with the reason otherwise