Class CassandraHealthIndicator

java.lang.Object
io.micronaut.management.health.indicator.AbstractHealthIndicator<Map<String,Object>>
io.micronaut.cassandra.health.CassandraHealthIndicator
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.management.health.indicator.HealthIndicator

@Requires(property="endpoints.health.cassandra.enabled",notEquals="false") @Requires(beans={io.micronaut.management.endpoint.health.HealthEndpoint.class,com.datastax.oss.driver.api.core.CqlSession.class}) @Introspected @Singleton public class CassandraHealthIndicator extends io.micronaut.management.health.indicator.AbstractHealthIndicator<Map<String,Object>>
A HealthIndicator for Cassandra, handling multiple configurations.

If any node of any CqlSession bean – that is not closed – is NodeState.UP, then health status is HealthStatus.UP, otherwise HealthStatus.DOWN.

Since:
2.2.0
Author:
Ilkin Ashrafli, Dean Wette
  • Field Summary

    Fields inherited from class io.micronaut.management.health.indicator.AbstractHealthIndicator

    executorService, healthStatus

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    CassandraHealthIndicator(com.datastax.oss.driver.api.core.CqlSession cqlSession)
    Deprecated, for removal: This API element is subject to removal in a future version.
    changed to support multiple configurations (i.e.
    CassandraHealthIndicator(List<com.datastax.oss.driver.api.core.CqlSession> cqlSessions)
    Constructs this health indicator using all configured CqlSession beans.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Map<String,Object>
     
    protected String
     

    Methods inherited from class io.micronaut.management.health.indicator.AbstractHealthIndicator

    getHealthResult, getResult, setExecutorService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Constructor Details

    • CassandraHealthIndicator

      @Deprecated(since="6.1.0", forRemoval=true) public CassandraHealthIndicator(com.datastax.oss.driver.api.core.CqlSession cqlSession)
      Deprecated, for removal: This API element is subject to removal in a future version.
      changed to support multiple configurations (i.e. collections of CqlSession beans)
      Default constructor.
      Parameters:
      cqlSession - The cassandra CqlSession to query for details
    • CassandraHealthIndicator

      @Inject public CassandraHealthIndicator(List<com.datastax.oss.driver.api.core.CqlSession> cqlSessions)
      Constructs this health indicator using all configured CqlSession beans.
      Parameters:
      cqlSessions - The list of cassandra CqlSession to query for details
  • Method Details

    • getHealthInformation

      protected Map<String,Object> getHealthInformation()
      Specified by:
      getHealthInformation in class io.micronaut.management.health.indicator.AbstractHealthIndicator<Map<String,Object>>
    • getName

      protected String getName()
      Specified by:
      getName in class io.micronaut.management.health.indicator.AbstractHealthIndicator<Map<String,Object>>