Struct persist::indexed::encoding::BlobMeta[][src]

pub struct BlobMeta {
    pub seqno: SeqNo,
    pub id_mapping: Vec<StreamRegistration>,
    pub graveyard: Vec<StreamRegistration>,
    pub arrangements: Vec<ArrangementMeta>,
}
Expand description

The structure serialized and stored as a value in crate::storage::Blob storage for metadata keys.

Invariants:

  • All strings in id_mapping are unique.
  • All ids in id_mapping are unique.
  • All strings in graveyard are unique.
  • All ids in graveyard are unique.
  • None of the strings in graveyard are present in any of the (string, id) tuples in id_mapping.
  • None of the ids in graveyard are present in any of the (string, id) tuples in id_mapping.
  • The same set of ids are present in id_mapping, unsealeds, and traces.
  • For each id, the ts_lower in the unsealed is <= the ts_upper in the corresponding trace. (This is less than equals and not strictly equals because truncating the unnecessary elements out of unsealed is fallible, and is allowed to lag behind the migration of new data into trace)
  • id_mapping.len() + graveyard.len() is == next_stream_id.
  • All of the keys for trace and unsealed batches are unique across all persisted streams.

Fields

seqno: SeqNo

Which mutations are included in the represented state.

Persist is a state machine, with all mutating requests modeled as input state changes sequenced into a log. Periodically those state changes are applied and the resulting state is written out to blob storage. This field indicates which prefix of the log (0..=self.seqno) has been included in the state represented by this BlobMeta. SeqNo(0) represents the initial empty state, the first mutation is SeqNo(1).

Invariant: For each UnsealedMeta in unsealeds, this is >= the last batch’s upper. If they are not equal, there is logically an empty batch between [last batch’s upper, self.seqno).

id_mapping: Vec<StreamRegistration>

Internal stream id indexed by external stream name.

Invariant: Each stream name and stream id are in here at most once.

graveyard: Vec<StreamRegistration>

Set of deleted streams, indexed by external stream name.

arrangements: Vec<ArrangementMeta>

Arrangements indexed by stream id.

Invariant: Each stream id is in here at most once.

Implementations

Asserts Self’s documented invariants, returning an error if any are violated.

The next Id to issue for a stream being added to id_mapping.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Upcasts this ProgressEventTimestamp to Any. Read more

Returns the name of the concrete type of this object. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more