pub struct ColumnarProjection { /* private fields */ }Expand description
The columnar analytics projection for one append-only collection.
Implementations§
Source§impl ColumnarProjection
impl ColumnarProjection
Sourcepub fn new(schema: ProjectionSchema, key: [u8; 32]) -> Self
pub fn new(schema: ProjectionSchema, key: [u8; 32]) -> Self
Create a projection over schema, sealing segments under key.
pub fn manifest(&self) -> &ProjectionManifest
Sourcepub fn drop_projection(&mut self)
pub fn drop_projection(&mut self)
Drop every materialized segment. Repair is always “regenerate”: after a
drop, the next emit_at_checkpoint rebuilds the projection from the row
log, and reads keep working meanwhile (served entirely by the row tail).
Sourcepub fn rebuild_from_truth(
&mut self,
collection: &AppendOnlyCollection,
checkpoint_lsn: u64,
budget: TranscodeBudget,
) -> Result<EmitOutcome, ProjectionError>
pub fn rebuild_from_truth( &mut self, collection: &AppendOnlyCollection, checkpoint_lsn: u64, budget: TranscodeBudget, ) -> Result<EmitOutcome, ProjectionError>
Rebuild the derived projection from the row log. This is the repair
primitive for missing or corrupt projection artifacts: truth stays in
AppendOnlyCollection, so repair is drop-and-regenerate.
Sourcepub fn emit_at_checkpoint(
&mut self,
collection: &AppendOnlyCollection,
checkpoint_lsn: u64,
budget: TranscodeBudget,
) -> Result<EmitOutcome, ProjectionError>
pub fn emit_at_checkpoint( &mut self, collection: &AppendOnlyCollection, checkpoint_lsn: u64, budget: TranscodeBudget, ) -> Result<EmitOutcome, ProjectionError>
Emit columnar segments for the un-materialized tail up to checkpoint_lsn,
bounded by budget. Never fails for lack of budget: it transcodes a
prefix and defers the rest. This is the only producer of columnar
segments (ADR 0069 §2).
Sourcepub fn analytical_scan(
&self,
collection: &AppendOnlyCollection,
pinned_lsn: u64,
) -> Result<Vec<Row>, ProjectionError>
pub fn analytical_scan( &self, collection: &AppendOnlyCollection, pinned_lsn: u64, ) -> Result<Vec<Row>, ProjectionError>
The LSN-pinned analytical scan (ADR 0069 §4). Under a single pinned LSN:
decode columnar segments up to the last materialized LSN, then
concatenate the un-materialized tail through the row read path. The
result is identical, row-for-row and in order, to
AppendOnlyCollection::row_scan at the same pinned_lsn — one
consistency class, always fresh; AS OF is just a historical pin.
Sourcepub fn repairing_analytical_scan(
&mut self,
collection: &AppendOnlyCollection,
pinned_lsn: u64,
budget: TranscodeBudget,
) -> Result<Vec<Row>, ProjectionError>
pub fn repairing_analytical_scan( &mut self, collection: &AppendOnlyCollection, pinned_lsn: u64, budget: TranscodeBudget, ) -> Result<Vec<Row>, ProjectionError>
Analytical scan with projection repair. Missing derived segment bytes or checksum/envelope/frame failures never make the query depend on a bad projection: the projection is dropped, rebuilt from the row log, and scanned again under the same LSN pin.
Trait Implementations§
Source§impl Clone for ColumnarProjection
impl Clone for ColumnarProjection
Source§fn clone(&self) -> ColumnarProjection
fn clone(&self) -> ColumnarProjection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ColumnarProjection
impl RefUnwindSafe for ColumnarProjection
impl Send for ColumnarProjection
impl Sync for ColumnarProjection
impl Unpin for ColumnarProjection
impl UnsafeUnpin for ColumnarProjection
impl UnwindSafe for ColumnarProjection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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