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

pub struct BlobTraceBatch {
    pub desc: Description<u64>,
    pub updates: Vec<ColumnarRecords>,
}
Expand description

The structure serialized and stored as a value in crate::storage::Blob storage for data keys corresponding to trace data.

This batch represents the data that was originally written at some time in [lower, upper) (more precisely !< lower and < upper). The individual record times may have later been advanced by compaction to something <= since. This means the ability to reconstruct the state of the collection at times < since has been lost. However, there may still be records present in the batch whose times are < since. Users iterating through updates must take care to advance records with times < since to since in order to correctly answer queries at times >= since.

Invariants:

  • The [lower, upper) interval of times in desc is non-empty.
  • The timestamp of each update is >= to desc.lower().
  • The timestamp of each update is < desc.upper() iff desc.upper() > desc.since(). Otherwise the timestamp of each update is <= desc.since().
  • The values in updates are sorted by (key, value, time).
  • The values in updates are “consolidated”, i.e. (key, value, time) is unique.
  • All entries have a non-zero diff.
  • (Intentionally no invariant around update non-emptiness because we might need empty batches to make the timestamps line up.)

TODO: This probably wants to be a different level of abstraction, so we can put multiple small batches in a single blob but also break a very large batch over multiple blobs. We also may want to break the latter into chunks for checksum and encryption?

Fields

desc: Description<u64>

Which updates are included in this batch.

updates: Vec<ColumnarRecords>

The updates themselves.

Implementations

Asserts the documented invariants, returning an error if any are violated.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Name of the codec. Read more

Encode a key or value for permanent storage. Read more

Decode a key or value previous encoded with this codec’s Codec::encode. Read more

Formats the value using the given formatter. Read more

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

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