pub struct KvCappedFixture { /* private fields */ }Expand description
A SyncFixture whose peer stores each event as one KV value of at most
KV_VALUE_CAP bytes: Turnstile’s peer D, the shape SY-18’s marker names.
§What it declares, and why
A value holds the event’s type, its tags and a 32-byte key as well as its
payload, and [PeerLimits] has a field for the payload alone. So the peer
reserves the envelope at the contract’s floors and declares what is left:
| bytes | |
|---|---|
| value cap | 131,072 |
type, at MAX_EVENT_TYPE_LEN | 255 |
64 tags, at MAX_TAG_LEN each | 16,320 |
| key: origin, position, recorded time | 32 |
declared max_event_bytes | 114,465 |
An event at every floor at once fills a value exactly, and is accepted. The
declaration clears VT-21’s 65,536-byte floor with 48,929 bytes to spare, and
sits in the peer set’s spread as: floor 65,536 = [MemorySyncPeer] < this
peer 114,465 < the Neon store’s 131,072 < 1 MiB for SQLite, Postgres and
Cloudflare.
§What it refuses
A push holding any event whose value would exceed the cap is refused whole,
before anything is stored, with KvPeerError::ValueTooLarge, class
[FailureClass::Park]. It never truncates. A push over max_batch_bytes
is refused by the store behind the cap, class [FailureClass::Split].
Implementations§
Trait Implementations§
Source§impl Clone for KvCappedFixture
impl Clone for KvCappedFixture
Source§impl Debug for KvCappedFixture
impl Debug for KvCappedFixture
Source§impl Default for KvCappedFixture
impl Default for KvCappedFixture
Source§impl SyncFixture for KvCappedFixture
impl SyncFixture for KvCappedFixture
Source§const REOPEN: Capability
const REOPEN: Capability
Declined, by incapacity, as the reference fixture’s is.
Source§const COMPACTION: Capability = Capability::SUPPORTED
const COMPACTION: Capability = Capability::SUPPORTED
The capped peer compacts as the reference peer behind it does: a cap on values says nothing about retention.
Source§async fn refusals(&self, peer: &Self::Peer) -> RefusalsOf<Self::Peer>
async fn refusals(&self, peer: &Self::Peer) -> RefusalsOf<Self::Peer>
The oversized push, declared Split, and the Turnstile seat map,
declared Park: 340,000 bytes is under the batch limit and over a
value, so it is the value cap that refuses it.
Source§type Peer = KvCappedPeer
type Peer = KvCappedPeer
Source§async fn compact_recorded_before(
&self,
peer: &Self::Peer,
cutoff: RecordedAt,
) -> Result<(), Violation>
async fn compact_recorded_before( &self, peer: &Self::Peer, cutoff: RecordedAt, ) -> Result<(), Violation>
peer forget the longest prefix of its log, in its forwarding
order, in which every event was recorded before cutoff, as the
fixture’s adapter compacts on a retention window (SY-32). Read more