Package-level declarations

Types

Link copied to clipboard

Snapshot writes a later durable write to the same store covers: a facet of a Store (Store.facet) whose snapshots can then be written without waiting for their own durability.

Link copied to clipboard
class Opened<out P : Any> @InternalWowApi constructor(val port: P, val schema: () -> Unit?)

A port a Store opened, with what creates its schema where it is missing (schema; null when the port has none, as a store in memory), which the store runs when the node starts (Store.createSchemas).

Link copied to clipboard
abstract class Store(val config: StoreConfig) : AutoCloseable

One store instance of the node, wow.stores.<name>, as its StoreProvider opened it: it opens each context's log, snapshots and timers on their first use, and the checkpoints, leases, failure ledger and reservations the contexts whose stores it holds share, and remembers what creates their schemas (createSchemas).

Link copied to clipboard
class StoreConfig @InternalWowApi constructor(val name: String, val type: String, val ddl: Ddl = Ddl.AUTO, val options: Map<String, String> = emptyMap(), val polling: TailPolling = TailPolling.DEFAULT, val service: String = "", val resources: StoreResources = StoreResources.NONE, val development: Boolean = false, val clock: Clock = Clock.systemUTC())

What a StoreProvider opens one store instance from: the store's name and type, how it manages the framework's schema (ddl, wow.stores.<name>.ddl over wow.ddl), its own settings (options), how the tails of its logs poll (polling, wow.log.poll-interval), the service whose failure ledger it keeps (the key of its entries), the application's resources, whether the node runs for development, where a store may accept a deployment it refuses for production (a standalone MongoDB server, say), and the clock its ports read the time from: the leases' and the reservations' expiry, the store's one time source, so a test fixes it in one place.

Link copied to clipboard
interface StorePool

The connections a store draws from, as its pool says them: a facet of a Store (Store.facet) whose pool can say them (HikariCP's, the MongoDB driver's, the Elasticsearch client's), so that the node bounds the store's queries by its pool and reads its write pressure from it. A store whose pool says nothing has none: its queries take the default bound and its write pressure is its append latency alone.

Link copied to clipboard

A backend of the node's stores: what opens a store instance of one type, wow.stores.<name>.type, or the one store wow.backend names. The built-in PostgreSQL (postgres) and MongoDB (mongo) backends are providers as a community backend is; the host finds them on the classpath (ServiceLoader, from the backend module's META-INF/services/me.ahoo.wow.spi.store.StoreProvider) and among the application's beans, a bean taking the place of a provider of its type on the classpath.

Link copied to clipboard

The application's objects a store is opened over (a DataSource, a MongoClient): in the Spring Boot host, its beans.

Link copied to clipboard

How hard one store's writes are pressed, for what shares the store with them to give way: the node measures its appends' latency where it records their calls, and the store's pool says how many callers wait for a connection (StorePool.waitingForConnection). Each sample closes one period and opens the next.

Link copied to clipboard
class WritePressureSample(val appends: Int, val appendP90: Duration?, val baseline: Duration?, val waitingForConnection: Int)

One period of a store's WritePressure: the appends it measured, their 90th percentile latency appendP90 (null when too few were measured to say), the baseline of that latency over the earlier periods (null until one sets it), and how many callers were waitingForConnection when it ended.

Functions

Link copied to clipboard
inline fun <reified F : Any> Store.facet(): F?

The facet of type F this store has (Store.facet), null when it has none.