Class CosIdHealthIndicator
java.lang.Object
me.ahoo.cosid.spring.autoconfigure.CosIdHealthIndicator
- All Implemented Interfaces:
me.ahoo.cosid.observe.GeneratorListener,org.springframework.boot.health.contributor.HealthContributor,org.springframework.boot.health.contributor.HealthIndicator
public class CosIdHealthIndicator
extends Object
implements org.springframework.boot.health.contributor.HealthIndicator, me.ahoo.cosid.observe.GeneratorListener
The health of the machine slots (07 §4.2, api-freeze.md §2.4), replacing the 4.x
MachineIdHealthIndicator:
DOWN when a started machine lost its lease and did not acquire it again, or when the slot binding of a
time-based generator on it is no longer valid; otherwise UP. The details are
machines: {<name>: {namespace, slot, valid, owner, fence, expiresAt, expiresInMillis, ceiling,
windowRemainingMillis, lost, renewFailures, lastRenewError}}, one entry per started machine (default for the
default one; the lease fields only for a leased one). Without a time-based generator no machine starts: the details
are empty and it is UP.-
Field Summary
Fields inherited from interface me.ahoo.cosid.observe.GeneratorListener
NOOP -
Constructor Summary
ConstructorsConstructorDescriptionCosIdHealthIndicator(org.springframework.beans.factory.ObjectProvider<me.ahoo.cosid.runtime.CosIdRuntime> runtime) Creates the indicator on the system clock. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.health.contributor.Healthhealth()voidonSlotAcquired(me.ahoo.cosid.lease.SlotLease lease, String reason) voidonSlotLost(me.ahoo.cosid.lease.SlotLease lease) voidonSlotRenewed(me.ahoo.cosid.lease.SlotLease lease) voidonSlotRenewFailed(me.ahoo.cosid.lease.SlotLease lease, Throwable error) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.ahoo.cosid.observe.GeneratorListener
onBatchResized, onClockRegression, onClockSkew, onDuplicateOwnerKey, onRangeReserved, onRefillFailed, onSequenceExhausted, onSlotReleased, onStoreTimeout, onWindowExceededMethods inherited from interface org.springframework.boot.health.contributor.HealthIndicator
health
-
Constructor Details
-
CosIdHealthIndicator
public CosIdHealthIndicator(org.springframework.beans.factory.ObjectProvider<me.ahoo.cosid.runtime.CosIdRuntime> runtime) Creates the indicator on the system clock.- Parameters:
runtime- the runtime, once it started
-
-
Method Details
-
health
public org.springframework.boot.health.contributor.Health health()- Specified by:
healthin interfaceorg.springframework.boot.health.contributor.HealthIndicator
-
onSlotAcquired
- Specified by:
onSlotAcquiredin interfaceme.ahoo.cosid.observe.GeneratorListener
-
onSlotRenewed
public void onSlotRenewed(me.ahoo.cosid.lease.SlotLease lease) - Specified by:
onSlotRenewedin interfaceme.ahoo.cosid.observe.GeneratorListener
-
onSlotRenewFailed
- Specified by:
onSlotRenewFailedin interfaceme.ahoo.cosid.observe.GeneratorListener
-
onSlotLost
public void onSlotLost(me.ahoo.cosid.lease.SlotLease lease) - Specified by:
onSlotLostin interfaceme.ahoo.cosid.observe.GeneratorListener
-