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

    Constructors
    Constructor
    Description
    CosIdHealthIndicator(org.springframework.beans.factory.ObjectProvider<me.ahoo.cosid.runtime.CosIdRuntime> runtime)
    Creates the indicator on the system clock.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.boot.health.contributor.Health
     
    void
    onSlotAcquired(me.ahoo.cosid.lease.SlotLease lease, String reason)
     
    void
    onSlotLost(me.ahoo.cosid.lease.SlotLease lease)
     
    void
    onSlotRenewed(me.ahoo.cosid.lease.SlotLease lease)
     
    void
    onSlotRenewFailed(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, wait

    Methods inherited from interface me.ahoo.cosid.observe.GeneratorListener

    onBatchResized, onClockRegression, onClockSkew, onDuplicateOwnerKey, onRangeReserved, onRefillFailed, onSequenceExhausted, onSlotReleased, onStoreTimeout, onWindowExceeded

    Methods 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:
      health in interface org.springframework.boot.health.contributor.HealthIndicator
    • onSlotAcquired

      public void onSlotAcquired(me.ahoo.cosid.lease.SlotLease lease, String reason)
      Specified by:
      onSlotAcquired in interface me.ahoo.cosid.observe.GeneratorListener
    • onSlotRenewed

      public void onSlotRenewed(me.ahoo.cosid.lease.SlotLease lease)
      Specified by:
      onSlotRenewed in interface me.ahoo.cosid.observe.GeneratorListener
    • onSlotRenewFailed

      public void onSlotRenewFailed(me.ahoo.cosid.lease.SlotLease lease, Throwable error)
      Specified by:
      onSlotRenewFailed in interface me.ahoo.cosid.observe.GeneratorListener
    • onSlotLost

      public void onSlotLost(me.ahoo.cosid.lease.SlotLease lease)
      Specified by:
      onSlotLost in interface me.ahoo.cosid.observe.GeneratorListener