Class JdbcPingClusterHealthImpl
- All Implemented Interfaces:
ClusterHealth
ClusterHealth implementation that makes use of KEYCLOAK_JDBC_PING2.
Since each node is registered in the database, it is possible to detect if a partition is happening.
The method KEYCLOAK_JDBC_PING2.healthStatus() contains the algorithm description. If it returns
KEYCLOAK_JDBC_PING2.HealthStatus.ERROR, the healthy state does not change and relies on the Quarkus/Agroal readiness health
check. But, if KEYCLOAK_JDBC_PING2.HealthStatus.NO_COORDINATOR is returned, the state will be changed to unhealthy. The should be
a temporary situation as at least one coordinator must be present in the database table.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(KEYCLOAK_JDBC_PING2 discovery, Executor executor) voidinject(org.infinispan.remoting.transport.Transport transport, org.infinispan.util.concurrent.BlockingManager blockingManager) booleanIt checks the cluster health returningtrueif this node can continue processing requests.booleanDetermine if the cluster health check is supported.voidTriggers a cluster health check.
-
Constructor Details
-
JdbcPingClusterHealthImpl
public JdbcPingClusterHealthImpl()
-
-
Method Details
-
inject
public void inject(org.infinispan.remoting.transport.Transport transport, org.infinispan.util.concurrent.BlockingManager blockingManager) -
init
-
isHealthy
public boolean isHealthy()Description copied from interface:ClusterHealthIt checks the cluster health returningtrueif this node can continue processing requests.If the network and cluster are stable, this method must return
true.If a network partition is detected, the return value depends on whether this node belongs to the winning partition. It must return
trueif it belongs to the winning partition orfalseif it does not. Deciding the winning partition is at the implementation discretion.- Specified by:
isHealthyin interfaceClusterHealth- Returns:
trueif the cluster is healthy and this node can continue processing requests,falseotherwise.
-
triggerClusterHealthCheck
public void triggerClusterHealthCheck()Description copied from interface:ClusterHealthTriggers a cluster health check.This method should only trigger the health check logic without blocking or waiting for its outcome.
- Specified by:
triggerClusterHealthCheckin interfaceClusterHealth
-
isSupported
public boolean isSupported()Description copied from interface:ClusterHealthDetermine if the cluster health check is supported.- Specified by:
isSupportedin interfaceClusterHealth- Returns:
- false if the current transport setup doesn't provide enough information.
-