pub struct DictColumn {
label: &'static str,
b: StringDictionaryBuilder<UInt16Type>,
n: usize,
}Expand description
A Dictionary<UInt16, Utf8> column that knows how full it is.
StringDictionaryBuilder does not expose its cardinality and returns the
overflow as an error from append, which is too late: the seal decision has
to be made before the append, because a builder cannot be rolled back. Every
enumerable string column in the engine — severity text, span name, event
name, metric name and unit — needs exactly this, so it is one type.
Fields§
§label: &'static str§b: StringDictionaryBuilder<UInt16Type>§n: usizeImplementations§
Source§impl DictColumn
impl DictColumn
pub fn new(label: &'static str) -> Self
Sourcepub fn has_headroom(&self, n: usize) -> bool
pub fn has_headroom(&self, n: usize) -> bool
Whether n more distinct values fit. Callers pass the total number of
values they are about to append, because deduplicating them first would
cost more than the occasional block sealed a little early.
Sourcepub fn append(&mut self, v: &str) -> Result<()>
pub fn append(&mut self, v: &str) -> Result<()>
Empty becomes null rather than a dictionary entry. proto3 cannot
distinguish an unset string from an empty one, so every span without a
trace_state would otherwise burn a slot and a validity bit to say so.
Sourcepub fn finish(&self) -> ArrayRef
pub fn finish(&self) -> ArrayRef
Materialise the column without consuming the builder.
finish_cloned, not finish, throughout the seal path: the same code
serves both the real seal — whose caller replaces the whole builder
afterwards anyway — and the open-block snapshot the read path queries
(section 4), which must leave the builder accumulating. The cost is one
buffer copy per column instead of a move, which at the 32 MiB block
target is a few milliseconds once per block.
Auto Trait Implementations§
impl Freeze for DictColumn
impl RefUnwindSafe for DictColumn
impl Send for DictColumn
impl Sync for DictColumn
impl Unpin for DictColumn
impl UnsafeUnpin for DictColumn
impl UnwindSafe for DictColumn
Blanket Implementations§
impl<T> Allocation for T
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].