Skip to main content

DictColumn

Struct DictColumn 

Source
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: usize

Implementations§

Source§

impl DictColumn

Source

pub fn new(label: &'static str) -> Self

Source

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.

Source

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.

Source

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§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more