SinkProvider

A Sink of the streams a service publishes: what opens the Sinks of one destination, a warehouse's tables say. Wow's ClickHouse Sink (clickhouse) is a provider as a community one is: the host finds them on the classpath (ServiceLoader, from the module's META-INF/services/me.ahoo.wow.spi.sink.SinkProvider) and among the application's beans, a bean taking the place of a provider of its type on the classpath, as it finds a me.ahoo.wow.spi.store.StoreProvider, and runs one sink subscription per published stream over what it opens.

A provider is stateless: open gives each configured sink its own StreamSinks, over the settings SinkConfig.options holds and the application's SinkConfig.resources (the service's Manifest among them).

Properties

Link copied to clipboard

Every setting it reads from SinkConfig.options, each read through its option, for the host to bind and check (wow.<type>.<key>). A ProviderOption.Scope.PER_STORE option is one the host gives the sink itself, not set under wow.<type> (the ClickHouse Sink's per-aggregate aggregates.*).

Link copied to clipboard

What a sink of this type needs, in the words of a startup failure that says it is missing.

Link copied to clipboard
abstract val type: String

The type a sink's configuration names: lowercase, unique among the providers of a node.

Functions

Link copied to clipboard
abstract fun available(config: SinkConfig): Boolean

Whether config configures a sink of this type: the settings it cannot do without are set, and not disabled.

Link copied to clipboard
abstract fun open(config: SinkConfig): StreamSinks

Opens the sinks config configures.