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 strWhich 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: usizeDistinct 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: usizeDistinct 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: BinaryBuilderImplementations§
Source§impl AttrsBuilder
impl AttrsBuilder
pub fn new(label: &'static str) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn has_headroom(&self, n: usize) -> bool
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.
Sourcepub fn heap_bytes(&self) -> usize
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.
Sourcepub fn append_all(&mut self, parent_id: u32, kvs: &[KeyValue]) -> Result<()>
pub fn append_all(&mut self, parent_id: u32, kvs: &[KeyValue]) -> Result<()>
Append every attribute of kvs as rows pointing at parent_id.
pub fn append( &mut self, parent_id: u32, key: &str, value: Option<&AnyValue>, ) -> Result<()>
Sourcepub fn finish(&self) -> Result<RecordBatch>
pub fn finish(&self) -> Result<RecordBatch>
See DictColumn::finish for why this does not consume the builder.
Auto Trait Implementations§
impl Freeze for AttrsBuilder
impl RefUnwindSafe for AttrsBuilder
impl Send for AttrsBuilder
impl Sync for AttrsBuilder
impl Unpin for AttrsBuilder
impl UnsafeUnpin for AttrsBuilder
impl UnwindSafe for AttrsBuilder
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].