Skip to main content

AttrsBuilder

Struct AttrsBuilder 

Source
pub struct AttrsBuilder {
Show 13 fields label: &'static str, parent_id: UInt32Builder, key: StringDictionaryBuilder<UInt16Type>, n_keys: usize, ty: UInt8Builder, str_: StringDictionaryBuilder<UInt32Type>, n_str: usize, str_bytes: usize, int: Int64Builder, double: Float64Builder, bool_: BooleanBuilder, bytes: BinaryBuilder, ser: BinaryBuilder,
}
Expand description

Builder for one attribute table — log, span, event, link, data point, exemplar, resource or scope. They are all the same nine columns.

Fields§

§label: &'static str

Which table this is, for error messages. "log_attrs.key" beats "attrs.key" when three of them are open at once.

§parent_id: UInt32Builder§key: StringDictionaryBuilder<UInt16Type>§n_keys: usize

Distinct entries in key. Tracked here because the dictionary builder does not expose it, and the seal decision has to be made before an append rather than after one has already failed.

§ty: UInt8Builder§str_: StringDictionaryBuilder<UInt32Type>

See schema::ATTRS for why this one column is dictionary-encoded. The width is u32, so unlike key it has no cap and no seal-early check.

§n_str: usize

Distinct values in str_, and the bytes they hold. Same reason as n_keys: the builder exposes neither, and with a dictionary the heap is what survives deduplication rather than what was appended — counting the appends would seal a block of one repeated 32 KB prompt hundreds of times too early.

§str_bytes: usize§int: Int64Builder§double: Float64Builder§bool_: BooleanBuilder§bytes: BinaryBuilder§ser: BinaryBuilder

Implementations§

Source§

impl AttrsBuilder

Source

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

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn has_headroom(&self, n: usize) -> bool

Whether n more attribute rows are guaranteed not to overflow the key dictionary. Assumes every one of them is a new key, because the cheap check has to be the conservative one.

Source

pub fn heap_bytes(&self) -> usize

Bytes held in the variable-width value heaps. Fixed-width columns are estimated from the row count; these cannot be, because one row can be a 32 KB GenAI prompt.

Source

pub fn append_all(&mut self, parent_id: u32, kvs: &[KeyValue]) -> Result<()>

Append every attribute of kvs as rows pointing at parent_id.

Source

pub fn append( &mut self, parent_id: u32, key: &str, value: Option<&AnyValue>, ) -> Result<()>

Source

pub fn finish(&self) -> Result<RecordBatch>

See DictColumn::finish for why this does not consume the builder.

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