pub struct Sealed {
pub tables: Vec<(&'static str, RecordBatch)>,
pub sidecars: Vec<(&'static str, Vec<u8>)>,
pub min_ts: i64,
pub max_ts: i64,
pub num_rows: usize,
}Expand description
A block’s worth of rows, sealed and ready for crate::block::publish.
The table names are the file stems inside the published directory
(logs.arrow, log_attrs.arrow, …), so they are part of the on-disk format
and not a display detail.
Fields§
§tables: Vec<(&'static str, RecordBatch)>§sidecars: Vec<(&'static str, Vec<u8>)>Opaque files published alongside the tables, by name.
Indexes over what a block contains, for the questions the block name
cannot answer — see crate::bloom. The read path treats a missing
sidecar as “no information”, so an old block or a signal that publishes
none costs nothing but a scan.
min_ts: i64Oldest and newest row. These become the block’s directory name, which is how the read path prunes without opening a file.
max_ts: i64§num_rows: usizeRows in the root table. Reported, not derived from tables, because
“how many spans” is not “how many rows in the biggest table”.
Implementations§
Source§impl Sealed
impl Sealed
Sourcepub fn new(
num_rows: usize,
tables: Vec<(&'static str, RecordBatch)>,
min_ts: i64,
max_ts: i64,
) -> Sealed
pub fn new( num_rows: usize, tables: Vec<(&'static str, RecordBatch)>, min_ts: i64, max_ts: i64, ) -> Sealed
Assemble a sealed block, deriving the sidecars that every signal gets.
The attribute filter and the zone map are built here rather than in each
signal’s seal for one reason: a signal that forgets to build one is
merely slow, but a signal that grows a new attribute table and forgets to
include it publishes an index that omits real values, and the read path
then skips blocks that hold matching rows. Deriving them from the tables,
once, makes that class of mistake unavailable — and the zone map needs it
even more than the filter does, since a key missing from it is read as
“this block has no such value” rather than as a false negative in a
probabilistic structure.
Also where the empty-block timestamp sentinels are normalized, which was
three copies of the same pair of ifs, and where the range is clamped
non-negative. That clamp is the second half of logs::nanos — not a
link, because it is pub(crate) and rustdoc will not resolve one:
the encoders keep an out-of-range OTLP timestamp from ever becoming a
negative one, and this is the single funnel all three of them seal
through, so it is the cheapest place to guarantee that
crate::block::publish and block::scan cannot disagree. They would:
dir_name formats a negative with a leading - and parse_dir_name
splits on -, so a block with a negative min_ts is published, acked
as durable, and then invisible to every query and to retention forever.
Sourcepub fn with(
sidecars: Sidecars,
num_rows: usize,
tables: Vec<(&'static str, RecordBatch)>,
min_ts: i64,
max_ts: i64,
) -> Sealed
pub fn with( sidecars: Sidecars, num_rows: usize, tables: Vec<(&'static str, RecordBatch)>, min_ts: i64, max_ts: i64, ) -> Sealed
As Sealed::new, but Sidecars::Skip leaves them out.
Only SignalBuilder::snapshot skips them, and only because they are
the expensive half of a seal — attrs::index and zone::index walk
every attribute row, which the encode bench measures at roughly three
times the cost of appending that row in the first place. A snapshot has
no directory to publish them into and is always scanned, so building
them would be pure waste repeated on every idle tick.
Sourcepub fn with_sidecar(self, name: &'static str, bytes: Option<Vec<u8>>) -> Sealed
pub fn with_sidecar(self, name: &'static str, bytes: Option<Vec<u8>>) -> Sealed
Attach a signal-specific sidecar. None writes nothing, which the reader
reads as “no information about this block” — which is also how
Sidecars::Skip gets away with omitting all of them.
pub fn table(&self, name: &str) -> Option<&RecordBatch>
Auto Trait Implementations§
impl !RefUnwindSafe for Sealed
impl !UnwindSafe for Sealed
impl Freeze for Sealed
impl Send for Sealed
impl Sync for Sealed
impl Unpin for Sealed
impl UnsafeUnpin for Sealed
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].