Class SpannerHealthIndicator

java.lang.Object
org.springframework.boot.actuate.health.AbstractHealthIndicator
com.google.cloud.spring.autoconfigure.spanner.health.SpannerHealthIndicator
All Implemented Interfaces:
org.springframework.boot.actuate.health.HealthContributor, org.springframework.boot.actuate.health.HealthIndicator

public class SpannerHealthIndicator extends org.springframework.boot.actuate.health.AbstractHealthIndicator
Default implementation of HealthIndicator for Spanner. Validates if connection is successful by executing query from the spannerTemplate using SpannerTemplate.executeQuery(Statement, SpannerQueryOptions).

If there is no error, this health indicator will signal "up".

Since:
2.0.6
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpannerHealthIndicator(SpannerTemplate spannerTemplate, String validationQuery)
    SpannerHealthIndicator constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doHealthCheck(org.springframework.boot.actuate.health.Health.Builder builder)
     

    Methods inherited from class org.springframework.boot.actuate.health.AbstractHealthIndicator

    health

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.springframework.boot.actuate.health.HealthIndicator

    getHealth
  • Constructor Details

    • SpannerHealthIndicator

      public SpannerHealthIndicator(SpannerTemplate spannerTemplate, String validationQuery)
      SpannerHealthIndicator constructor.
      Parameters:
      spannerTemplate - spannerTemplate to execute query
      validationQuery - query to execute
  • Method Details

    • doHealthCheck

      protected void doHealthCheck(org.springframework.boot.actuate.health.Health.Builder builder) throws Exception
      Specified by:
      doHealthCheck in class org.springframework.boot.actuate.health.AbstractHealthIndicator
      Throws:
      Exception