Package-level declarations

Types

Link copied to clipboard
sealed interface AppendResult

What one Bolt.append did.

Link copied to clipboard
data class Archived<Op>(val offset: Long, val endOffset: Long, val arrivedAt: Instant, val insertDots: Set<Dot>, val key: String?, val ops: List<Op>) : ReplayEvent<Op>

One archived frame.

Link copied to clipboard
data class ArchiveHealth(val framesWritten: Long = 0, val opsArchived: Long = 0, val opsDeduplicated: Long = 0, val appendsFailed: Long = 0, val recentFailures: List<AppendResult.Failed> = emptyList(), val durability: DurabilityState = DurabilityState.AsPromised)

What a BoltDecorator has managed to archive, and — more importantly — what it has not.

Link copied to clipboard
interface Bolt<Op>

A write-only archive for an op-log CRDT: operations flow in and never out.

Link copied to clipboard
class BoltArchiveFormat<Id : Any, V, Op : Any>(classifier: OpLogCrdt<Id, V, Op>, vSerializer: KSerializer<V>)

How one op-log CRDT's operations are classified and encoded into an archive.

Link copied to clipboard
sealed interface BoltAvailability

Whether a Bolt can be written to on this runtime.

Link copied to clipboard
class BoltDecorator<Id : Any, V, Op : Any>(bolt: Bolt<Op>, format: BoltArchiveFormat<Id, V, Op>, removalWindow: Int = DEFAULT_REMOVAL_WINDOW, frontierWindow: Int = DEFAULT_FRONTIER_WINDOW)

Feeds a Bolt the operations a CRDT owner applied, and suppresses the ones it has already archived.

Link copied to clipboard

Thrown when archive bytes are not a bolt archive this build can read.

Link copied to clipboard
data object CleanTail : ReplayEvent<Nothing>

The replay reached the end of the archive with every frame in scope intact.

Link copied to clipboard
sealed interface DurabilityState

Whether a Bolt is meeting the durability level it promised.

Link copied to clipboard
class InMemoryBolt<Id : Any, V, Op : Any>(format: BoltArchiveFormat<Id, V, Op>, clock: Clock, segmentFrameBytes: Long = DEFAULT_SEGMENT_FRAME_BYTES, capacityBytes: Long = Long.MAX_VALUE) : Bolt<Op>

A Bolt whose segments live in memory — the reference implementation, and the one every target has, including the browser.

Link copied to clipboard
sealed interface ReplayEvent<out Op>

One element of a Bolt.replay stream: a frame, or the terminal verdict on how the stream ended.

Link copied to clipboard
sealed interface ReplayScope

Which frames a Bolt.replay should yield.

Link copied to clipboard
data class Truncated(val atOffset: Long, val reason: TruncationReason) : ReplayEvent<Nothing>

The replay stopped early: the archive is damaged, or was still being written, at atOffset.

Link copied to clipboard

Why a replay stopped early, in a Truncated verdict.

Properties

Link copied to clipboard
const val BOLT_FORMAT_VERSION: Int = 1

The archive format version written into every segment header.

Functions

Link copied to clipboard
fun <Op> Flow<ReplayEvent<Op>>.frames(): Flow<Archived<Op>>

Just the frames, discarding the terminal verdict.