Package-level declarations

Types

Link copied to clipboard
class ApplyParkedRetrySpec @InternalWowApi constructor(val subscription: String, val context: String, val aggregate: String, val tenantId: String, val id: String, val maxRetries: Int? = null, val initialBackoff: String? = null, val claimTtl: String? = null, val failedAt: Long? = null) : LedgerCommand

Applies a retry spec to the entry (Ledger.APPLY_PARKED_RETRY_SPEC, 9.x ApplyRetrySpec): at most maxRetries automatic retries, the first initialBackoff after the failure, each claiming the entry for claimTtl (durations). A member left out keeps the value the entry is retried by now.

Link copied to clipboard
object Ledger

The failure ledger across services: each service keeps its own ledger, atomic with its checkpoints, and publishes its changes to the ops context, which aggregates them; an operator's action goes back to the owning service.

Link copied to clipboard
class LedgerAggregate @InternalWowApi constructor(val context: String, val name: String, val tenantId: String, val id: String)

A parked aggregate as the ledger's commands name it: the aggregate name of context, its tenantId and id (the shape of an entry on the operator routes, /wow/ops/parked).

Link copied to clipboard
sealed interface LedgerCommand

A system command of the ledger: an operator's action on subscription's entry of the parked aggregate id of tenantId, of the aggregate type aggregate of context. Its fields are plain values, so any operations tool, not only Wow's own, writes its JSON: {"subscription": ..., "context": ..., "aggregate": ..., "tenantId": ..., "id": ...}. A caller sends it as the system command its name says (Ledger.COMMANDS), which a service's call permits must list explicitly (wow.ledger.*).

Link copied to clipboard
class LedgerEntry @InternalWowApi constructor(val service: String, val context: String, val subscription: String, val aggregate: LedgerAggregate, val fromVersion: Int, val fromPosition: Long? = null, val skipOnly: Boolean = false, val reason: String, val failedAt: Long, val retries: Int = 0, val lastRetryAt: Long? = null, val retrySpec: LedgerRetrySpec, val recoverable: String = UNKNOWN, val request: String? = null, val status: String, val nextRetryAt: Long? = null, val recordedAt: Long)

subscription of service parks aggregate, as its ledger holds it now (FailureLedger's entry with the retry spec it is retried by); the entry's command topic is context's, the context of the subscription.

Link copied to clipboard

An operator's request on a parked entry, left in the ledger by a node that does not own the entry's partition: the owner claims it for a while (the ledger's ParkedAmendment.ClaimRequest) and runs it, and the request stays on the entry until what it asks is done.

Link copied to clipboard
class LedgerResolution @InternalWowApi constructor(val service: String, val context: String, val subscription: String, val aggregate: LedgerAggregate, val failedAt: Long? = null, val outcome: String, val resolvedAt: Long)

subscription of service no longer parks aggregate, as of resolvedAt (epoch milliseconds): the parking that failed at failedAt (null when the service did not know it) came to outcome: RETRIED (handled again), SKIPPED, RESOLVED (gone from the ledger, by an automatic retry or another node's action) or NOT_PARKED (an operator's action found nothing parked).

Link copied to clipboard
class LedgerRetrySpec @InternalWowApi constructor(val maxRetries: Int, val initialBackoff: String, val claimTtl: String, val applied: Boolean = false)

The retry spec a parked entry is retried by: at most maxRetries automatic retries, the first initialBackoff after the failure, each claiming the entry for claimTtl (durations); applied when an operator applied it, rather than the subscription's.

Link copied to clipboard
class MarkParkedRecoverable @InternalWowApi constructor(val subscription: String, val context: String, val aggregate: String, val tenantId: String, val id: String, val recoverable: Recoverable, val failedAt: Long? = null) : LedgerCommand

Marks the entry recoverable (Ledger.MARK_PARKED_RECOVERABLE, 9.x MarkRecoverable). On the wire the value is spelled recoverable, unrecoverable or unknown (me.ahoo.wow.api.wire.WireNames); any other spelling is refused.

Link copied to clipboard

What an operator marked a parked entry (9.x RecoverableType); only UNRECOVERABLE stops its automatic retries.

Link copied to clipboard
class RetryParked @InternalWowApi constructor(val subscription: String, val context: String, val aggregate: String, val tenantId: String, val id: String, val failedAt: Long? = null) : LedgerCommand

Handles the parked aggregate again from where it is parked (Ledger.RETRY_PARKED).

Link copied to clipboard
class SkipParked @InternalWowApi constructor(val subscription: String, val context: String, val aggregate: String, val tenantId: String, val id: String, val failedAt: Long) : LedgerCommand

Resolves the entry without handling what was parked (Ledger.SKIP_PARKED).