Struct mz_persist::indexed::encoding::BlobTraceBatchPart
source · pub struct BlobTraceBatchPart<T> {
pub desc: Description<T>,
pub index: u64,
pub updates: BlobTraceUpdates,
}
Expand description
The structure serialized and stored as a value in crate::location::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.
TODO: disallow empty trace batch parts in the future so there is one unique way to represent an empty trace batch.
Fields§
§desc: Description<T>
Which updates are included in this batch.
There may be other parts for the batch that also contain updates within the specified [lower, upper) range.
index: u64
Index of this part in the list of parts that form the batch.
updates: BlobTraceUpdates
The updates themselves.
Implementations§
source§impl<T: Timestamp + Codec64> BlobTraceBatchPart<T>
impl<T: Timestamp + Codec64> BlobTraceBatchPart<T>
sourcepub fn validate(&self) -> Result<(), Error>
pub fn validate(&self) -> Result<(), Error>
Asserts the documented invariants, returning an error if any are violated.
sourcepub fn encode<B>(
&self,
buf: &mut B,
metrics: &ColumnarMetrics,
cfg: &EncodingConfig,
)
pub fn encode<B>( &self, buf: &mut B, metrics: &ColumnarMetrics, cfg: &EncodingConfig, )
Encodes an BlobTraceBatchPart into the Parquet format.
sourcepub fn decode(
buf: &SegmentedBytes,
metrics: &ColumnarMetrics,
) -> Result<Self, Error>
pub fn decode( buf: &SegmentedBytes, metrics: &ColumnarMetrics, ) -> Result<Self, Error>
Decodes a BlobTraceBatchPart from the Parquet format.
Trait Implementations§
source§impl<T: Clone> Clone for BlobTraceBatchPart<T>
impl<T: Clone> Clone for BlobTraceBatchPart<T>
source§fn clone(&self) -> BlobTraceBatchPart<T>
fn clone(&self) -> BlobTraceBatchPart<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Debug> Debug for BlobTraceBatchPart<T>
impl<T: Debug> Debug for BlobTraceBatchPart<T>
source§impl<T: PartialEq> PartialEq for BlobTraceBatchPart<T>
impl<T: PartialEq> PartialEq for BlobTraceBatchPart<T>
impl<T> StructuralPartialEq for BlobTraceBatchPart<T>
Auto Trait Implementations§
impl<T> Freeze for BlobTraceBatchPart<T>where
T: Freeze,
impl<T> !RefUnwindSafe for BlobTraceBatchPart<T>
impl<T> Send for BlobTraceBatchPart<T>where
T: Send,
impl<T> Sync for BlobTraceBatchPart<T>where
T: Sync,
impl<T> Unpin for BlobTraceBatchPart<T>where
T: Unpin,
impl<T> !UnwindSafe for BlobTraceBatchPart<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.