Class QNodeLifecycle
java.lang.Object
com.kingsrook.qqq.backend.core.cluster.QNodeLifecycle
This node's lifecycle in a cluster: a node that is draining reports not-ready
(so the load balancer stops sending it requests), stops claiming new work,
and lets in-flight work finish before it stops (spec section D).
Anything that should react (the registry in qbit-cluster, job claimers) adds
a listener; readiness probes call isDraining().
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringWhy this node is draining (null when it is not).static booleanWhether this node is draining.static voidAdd a listener called when draining starts (immediately, if it already has).static voidReset (tests only).static voidstartDraining(String reason) Start draining (idempotent).
-
Method Details
-
isDraining
public static boolean isDraining()Whether this node is draining. -
getDrainReason
Why this node is draining (null when it is not). -
startDraining
Start draining (idempotent). Listeners run once, on the first call. -
onDrain
-
resetForTests
public static void resetForTests()Reset (tests only).
-