Package-level declarations

Types

Link copied to clipboard
data class Activation(val node: String, val at: Long?, val by: String, val reason: String?, val activated: Boolean)

The activation of a node started on standby (ServiceNode.activate): the node, when it was activated (at, epoch milliseconds; null for a node that never was), by whom and why (reason). activated is false when the node was not on standby, so the call changed nothing.

Link copied to clipboard
data class AdmissionPlugins(val authorizer: CommandAuthorizer? = null, val transformers: List<CommandTransformer> = emptyList(), val validators: List<CommandValidator> = emptyList(), val ids: IdGenerators = IdGenerators.DEFAULT, val tenants: TenantPolicy = TenantPolicy.CALLERS, val policies: WritePolicies = WritePolicies.NONE)

The admission plug-ins of a node's me.ahoo.wow.runtime.admission.CommandGateway, and the tenants of its aggregate types. ids are the node's id generators: admission's command and aggregate ids, the wait ids, and the ids its decide functions and sagas take. authorizer is null when the application gives none (me.ahoo.wow.runtime.admission.CommandGateway.authorizes). policies are the access policies the node's kernel holds each command to, before and after deciding.

Link copied to clipboard
fun interface BackendFactory

Opens the ContextBackends of each bounded context the node hosts; the host closes what it opened.

Link copied to clipboard
class ContextBackends @InternalWowApi constructor(val log: EventLog, val checkpoints: CheckpointStore, val leases: LeaseStore, val ledger: FailureLedger, val snapshots: SnapshotTargets? = null, val reservations: ReservationStore? = null, val timers: TimerStore? = null, val store: String = DEFAULT_STORE, val groups: List<LogGroupBackends> = emptyList(), val stores: PlacedStores = PlacedStores.NONE, val snapshotTails: SnapshotTailReaders = SnapshotTailReaders.NONE)

The stores of one bounded context on a node (a log, its partitions and leases are per context). The log's partition count is the context's. Without snapshots the context has no snapshot subscription, and its default wait is COMMITTED; without reservations its commands cannot reserve keys; without timers its commands and sagas cannot schedule commands: a schedule is committed but never sent.

Link copied to clipboard

The parts of one bounded context on a node: the log it appends through (log, the partition append queue over the backend's log), its kernel and executor, the built-in snapshots and reservations subscriptions when the context has their stores, the subscriptions runtime of its lease group, this node's ownership of the group's partitions, its wait coordinator, and the endpoint that executes the commands other nodes forward to it.

Link copied to clipboard

The scheduled commands of one log group of a context on a node: the built-in timers subscription writes the timers its aggregates schedule, and the runner sends them, through the node's TimerLoop, from the partitions the node owns.

Link copied to clipboard
class LogGroupBackends @InternalWowApi constructor(val store: String, val types: Set<AggregateType>, val log: EventLog, val checkpoints: CheckpointStore, val ledger: FailureLedger, val timers: TimerStore? = null, val reservations: ReservationStore? = null)

One log group of a context other than its default one: the aggregate types whose log is log, on the store instance store; the checkpoints, parked entries and timers of the subscriptions reading it are in checkpoints, ledger and timers, on the same store, and so are its types' reservations (an aggregate type's reservations follow its log; a group without its own uses the context's).

Link copied to clipboard

One log group of a context on a node: the aggregate types whose log is log, on the store named store; the runtime of the context's subscriptions over that log, its checkpoints and parked entries in the group's store; and the group's timers, when its store has a timer store. Every group runs the same subscriptions, in the partitions the node owns.

Link copied to clipboard

One sample of a node, taken at (System.nanoTime()): the heads of the partitions of its log groups, by group and partition, and the parked entries of each subscription, by its group and name; a read that failed is missing. previous is the sample before it, for what grows.

Link copied to clipboard
class NodeSampler(val node: ServiceNode, val interval: Duration = DEFAULT_INTERVAL, val maxParked: Int = DEFAULT_MAX_PARKED, readTimeout: Duration = DEFAULT_READ_TIMEOUT, context: CoroutineContext = Dispatchers.Default, nanos: () -> Long = System::nanoTime) : AutoCloseable

One sampler of what a node reports that is read rather than heard, every interval: the head of each partition of each log group the node has positions in, and how many entries each subscription has parked, by its group and name (ParkedSubscription: each context has its own snapshot), counted up to maxParked. Both its health and its gauges read the one sample (latest), so the ledgers are read once per interval, whoever reports them.

Link copied to clipboard
data class ParkedKey(val subscription: SubscriptionId, val ref: AggregateRef)

Where a listing of parked entries stands: an entry of subscription parking ref.

Link copied to clipboard

What an operator does with the parked entries of a node's subscriptions: list and read them, retry or skip one, mark one recoverable or not (9.x MarkRecoverable), apply a retry spec to one (9.x ApplyRetrySpec). The host serves it over HTTP; any node of the service answers for every entry.

Link copied to clipboard
data class ParkedPage(val entries: List<ParkedView>, val next: ParkedKey?)

One page of ParkedOps.list: its entries, and the key the next page starts after (null at the end).

Link copied to clipboard

A subscription whose entries park, by the log or lease group it runs in and its name.

Link copied to clipboard
data class ParkedView(val entry: ParkedAggregate, val spec: ParkedRetrySpec, val group: String)

A parked entry as an operator sees it, with the spec it is retried by and the log or lease group it runs in.

Link copied to clipboard
data class PartitionView(val partition: Int, val position: Long, val runs: Boolean = false, val head: Long? = null, val paused: PausedPartition? = null, val throttled: ThrottledPartition? = null)

Where a subscription stands in partition: every entry up to position is complete. In a partition this node runs, position is its live watermark, head the head the last sample read (null when it read none), and the partition may be paused on a systemic failure or throttled by backpressure; in another, position is its saved checkpoint, which the node that runs it moves.

Link copied to clipboard
class PlacedStores @InternalWowApi constructor(val writePath: Set<Store>, val others: Set<Store> = emptySet())

The store instances a context's ports were opened on: those its writePath needs (each store holding one of its logs, each type's primary snapshot store), whose outage makes the node not ready, and the others (additional snapshot stores, query and search stores), whose outage the node's health shows without taking it out of service.

Link copied to clipboard
enum class Routing : Enum<Routing>

Where a node runs a command.

Link copied to clipboard
class ServiceNode @InternalWowApi constructor(val service: String, val node: String, address: String?, models: Collection<AggregateModel<*>>, val manifest: Manifest, backends: BackendFactory, channel: ClusterChannel, remoteSignals: SignalSender = SignalSender.NONE, val options: ServiceNodeOptions = ServiceNodeOptions(), admission: AdmissionPlugins = AdmissionPlugins(), subscriptions: SubscriptionFactory = SubscriptionFactory.NONE, listener: (ServiceNode.Step) -> Unit = {}, codec: EventCodec = EventCodec(), val contracts: ContractDirectory = ContractDirectory(manifest), topics: SourceTopics? = null, parkedNotifier: ParkedNotifier = ParkedNotifier.NONE, clock: Clock = Clock.systemUTC(), observer: Observer = Observer.NONE, caller: CommandCaller? = null, failureClassifiers: List<FailureClassifier> = emptyList(), queries: ContextQueries = ContextQueries.NONE, replayGate: ReplayGate = ReplayGate.OPEN, deadlines: WaitDeadlines = WaitDeadlines.SHARDED)

One node of a service, assembled without a host: what a host (Spring Boot, a test, a sample) wires to its ports.

Link copied to clipboard
class ServiceNodeOptions @InternalWowApi constructor(val cluster: ClusterOptions = ClusterOptions(), val routing: Routing = Routing.PARTITIONED, val wait: WaitOptions = WaitOptions(), val subscription: SubscriptionOptions = SubscriptionOptions(), val appendQueue: AppendQueueOptions = AppendQueueOptions(), val executor: ExecutorOptions = ExecutorOptions(), val stateCache: StateCacheOptions = StateCacheOptions(), val sharedStates: SharedStateOptions = SharedStateOptions(), val timers: TimerOptions = TimerOptions(), val schedules: Map<String, JobOptions> = emptyMap(), val topicRouted: Set<AggregateType> = emptySet(), val ledger: LedgerPublishing? = null, val snapshots: SnapshotOptions = SnapshotOptions(), val handoff: HandoffOptions = HandoffOptions(), val access: AccessStampOptions = AccessStampOptions())

The tuning of a ServiceNode (names the host's keys for them).

Link copied to clipboard
class SnapshotTailReaders @InternalWowApi constructor(default: SnapshotTailReader?, placed: Map<AggregateType, SnapshotTailReader?> = emptyMap())

The one-round-trip reads of a context's snapshots with their tails (Store.snapshotTails): the default one, of the aggregate types the layout places nowhere in particular, when their log store holds their primary snapshots, and the one of each type placed elsewhere, null when its log and primary snapshots are on different stores.

Link copied to clipboard
data class SourcedSubscription(val subscription: Subscription, val types: Set<AggregateType>)

A subscription that reads the published streams of types, aggregates of another context: its filter is of that context, and it handles the records read from each type's topic.

Link copied to clipboard
class SourceTopics @InternalWowApi constructor(val source: PartitionedSource, val prefix: String = "", val producer: TopicProducer? = null, val intake: Boolean = false, val admin: TopicAdmin? = null, val ddl: Ddl = Ddl.NONE, val partitionRefresh: Duration = DEFAULT_PARTITION_REFRESH)

The topics of a node's broker, each named after prefix, the prefix every service on the broker writes under:

Link copied to clipboard

The application's subscriptions of one bounded context (projections, reactors, sagas), beside the built-in wow.snapshot and wow.reservation ones. Called once per context while the node is assembled, with the context's parts, so a saga can forward through its coordinator; the subscriptions are registered when the node starts. The annotated processors' come from me.ahoo.wow.runtime.binding.SubscriptionBindings.

Link copied to clipboard
data class SubscriptionsView(val node: String, val subscriptions: List<SubscriptionView>, val orphans: List<OrphanCheckpoints>)

The node's subscriptions, ordered by group and then by subscription, and the orphans of its groups, ordered the same way (ServiceNode.subscriptionsView).

Link copied to clipboard
data class SubscriptionView(val id: SubscriptionId, val group: String, val source: SubscriptionView.Source, val parked: Int?, val partitions: List<PartitionView>)

The subscription id, run in group over its source, with parked entries (counted up to the sampler's limit; null when not counted) and where it stands in its partitions.

Link copied to clipboard
data class TopicRequirement(val topic: String, val partitions: Int, val exact: Boolean, val purpose: String)

A topic one of a node's contexts owns: its name, the partitions it is created with, whether a topic of another count is refused (exact, a command topic), and what it is for, as a failed check says. An exact topic has as many partitions as a log, so its count must be a valid one (Partitioner.requirePartitions).

Properties

Link copied to clipboard

The partitions the node's subscriptions have paused on a systemic failure, the built-in ones, the intakes' and those of other contexts' topics included: what the health model reads.

Link copied to clipboard

The partitions the node's subscriptions throttle on backpressure now, the built-in ones, the intakes' and those of other contexts' topics included.

Functions

Link copied to clipboard

What an operator reads of the node's subscriptions, the built-in ones included, each by the group it runs in, and of the checkpoints its groups hold under names they no longer have: