FateSink

Receives the bytes a FateLogWriter produces.

The three entry kinds are separate methods because a sink that serves late-joining readers must replay the header and every schema entry before it sends a message entry. Channel indices are positional, so a reader that missed a schema entry can't decode messages for that channel. A sink that doesn't care, like StreamSink, treats all three the same.

Each array passed in is one complete entry, exactly sized, ready to send as is.

Implementations must tolerate calls from any thread.

Inheritors

Functions

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract fun flush()

Pushes anything buffered onward.

Link copied to clipboard
abstract fun header(bytes: ByteArray)

The 4-byte magic and version that open a log.

Link copied to clipboard
abstract fun messageEntry(bytes: ByteArray)

A complete message entry (kind 1). It carries one value for an already declared channel.

Link copied to clipboard
abstract fun schemaEntry(bytes: ByteArray)

A complete schema entry (kind 0). It declares the channel at the next index.