Package-level declarations

Types

Link copied to clipboard

Whether the stores that serve each type's events model can keep its history's access attributes current: an events query decides by them, and an attribute a store cannot keep current would authorize by what the aggregate no longer has, and leave a stream appended without attributes outside every access policy. A type whose model is not served is not checked: nothing reads its history's attributes.

Link copied to clipboard

The access schema of an aggregate type: what its streams' attributes are derived as, the declared ones by name, each with the kind of its stored values and whether it holds many (department:string,teams:string[]), empty for none, then the revision of how they are derived when it is raised (AggregateModel.accessRevision): department:string;revision=2, revision=2 with no declared attribute. The built-in owner and space are of every schema. A walk is claimed for each schema (AccessWalking), so a raised revision walks the history again, though the attributes are declared as they were.

Link copied to clipboard

Rewrites the snapshot of an aggregate from its whole log (EventStreamRecords from version 1), already replayed as its state: the access walk's share of the snapshots, which carry the attributes of the state they hold.

Link copied to clipboard
class AccessStamping(context: String, models: Collection<AggregateModel<*>>, kernel: Kernel, stampsOf: (AggregateType) -> AccessStamps?, options: AccessStampOptions = AccessStampOptions(), val walking: AccessWalking? = null, observer: Observer = Observer.NONE, time: TimeSource = TimeSource.Monotonic)

The built-in subscription NAME of one bounded context: it keeps the access attributes of each aggregate's history its current ones. The kernel stamps each commit with the attributes after it (AccessValues.ofStream); when a commit changed them (its attributes differ from those of the stream before it), this subscription stamps them over every earlier stream of the aggregate (AccessStamps.stamp), as of the commit's version, in stamps of at most AccessStampOptions.stampBatch streams. So an events query authorizes an aggregate's whole history by what it is now, within the subscription's lag.

Link copied to clipboard
class AccessStampOptions @InternalWowApi constructor(val stampBatch: Int = DEFAULT_STAMP_BATCH, val capacity: Int = DEFAULT_CAPACITY, val walkBatch: Int = DEFAULT_WALK_BATCH, val walkRate: Int = DEFAULT_WALK_RATE, val walkShare: Double = DEFAULT_WALK_SHARE, val interval: Duration = DEFAULT_INTERVAL, val leaseTtl: Duration = DEFAULT_TTL, val memberTtl: Duration = DEFAULT_TTL)

How a context stamps the histories (AccessStamping, AccessWalking): at most stampBatch streams in one stamp, so one long history is written in statements of a bounded size, each by the version key; the last stamped attributes of at most capacity aggregates, which spare the follower a read of the previous stream; and the walks, walkBatch aggregates a page at most, at most walkRate a second and at most walkShare of the time, run every interval under a lease of leaseTtl, each node a member of its access schema of each type for memberTtl after its last heartbeat, heartbeated every third of it from when it is ready to join until it stops. The host configures them (wow.access.*).

Link copied to clipboard
class AccessWalking(val context: String, group: String, node: String, models: Collection<AggregateModel<*>>, kernel: Kernel, logOf: (AggregateType) -> EventLog?, leases: LeaseStore, options: AccessStampOptions = AccessStampOptions(), snapshots: AccessSnapshots = AccessSnapshots.NONE, address: () -> String = { node }, observer: Observer = Observer.NONE, gate: ReplayGate = ReplayGate.OPEN, time: TimeSource = TimeSource.Monotonic, val skips: MaintenanceSkips? = null)

The access walks of one bounded context, on every node, every AccessStampOptions.interval: each aggregate type's history stamped with the attributes of its aggregates' current states, where no commit stamped it with the type's current access schema (AccessSchema): a log an earlier version wrote, an import, an attribute the model declares since, an access revision it raised since (a changed derivation of the same attributes).

Link copied to clipboard
sealed interface EventsSource

Where the events model of an aggregate type is served from: what reads its history's access attributes, which only a store that keeps them current may serve (#7157).

Link copied to clipboard

The EventsSource of each aggregate type; null for a type whose events model is not served.

Link copied to clipboard
class Stamped(val version: Int, val access: Map<String, Any?>)

The attributes of an aggregate's history as of version: what a stamp wrote, or a stream carries.

Functions

Link copied to clipboard

Writes stamps together (AccessStamps.stampAll), in writes of at most batch streams each: a stamp of more is cut into chunks of batch, each written whole in one write. Returns the streams stamped.