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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BlobMeta
impl UnwindSafe for BlobMeta
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
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