Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give PendingRow its BTreeMap back... or don't? 😶 #8788

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/store/re_chunk/src/batcher.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
collections::BTreeMap,
hash::{Hash as _, Hasher},
sync::Arc,
time::{Duration, Instant},
Expand Down Expand Up @@ -681,12 +682,12 @@ pub struct PendingRow {
/// The component data.
///
/// Each array is a single component, i.e. _not_ a list array.
pub components: IntMap<ComponentDescriptor, ArrayRef>,
pub components: BTreeMap<ComponentDescriptor, ArrayRef>,
}

impl PendingRow {
#[inline]
pub fn new(timepoint: TimePoint, components: IntMap<ComponentDescriptor, ArrayRef>) -> Self {
pub fn new(timepoint: TimePoint, components: BTreeMap<ComponentDescriptor, ArrayRef>) -> Self {
Self {
row_id: RowId::new(),
timepoint,
Expand Down
5 changes: 3 additions & 2 deletions crates/top/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::collections::BTreeMap;
use std::fmt;
use std::io::IsTerminal;
use std::sync::Weak;
Expand Down Expand Up @@ -1188,7 +1189,7 @@ impl RecordingStream {
.map(|array| (comp_batch.descriptor().into_owned(), array))
})
.collect();
let components: IntMap<_, _> = comp_batches?.into_iter().collect();
let components: BTreeMap<_, _> = comp_batches?.into_iter().collect();

// NOTE: The timepoint is irrelevant, the `RecordingStream` will overwrite it using its
// internal clock.
Expand Down Expand Up @@ -1261,7 +1262,7 @@ impl RecordingStream {
.into_iter()
.map(|comp_batch| (comp_batch.descriptor, comp_batch.array))
.collect();
let components: IntMap<_, _> = comp_batches.into_iter().collect();
let components: BTreeMap<_, _> = comp_batches.into_iter().collect();

// NOTE: The timepoint is irrelevant, the `RecordingStream` will overwrite it using its
// internal clock.
Expand Down
7 changes: 5 additions & 2 deletions crates/top/rerun_c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ mod ptr;
mod recording_streams;
mod video;

use std::ffi::{c_char, c_uchar, CString};
use std::{
collections::BTreeMap,
ffi::{c_char, c_uchar, CString},
};

use arrow::array::{ArrayRef as ArrowArrayRef, ListArray as ArrowListArray};
use arrow_utils::arrow_array_from_c_ffi;
Expand Down Expand Up @@ -811,7 +814,7 @@ fn rr_recording_stream_log_impl(

let batches = unsafe { std::slice::from_raw_parts_mut(batches, num_data_cells) };

let mut components = IntMap::default();
let mut components = BTreeMap::default();
{
let component_type_registry = COMPONENT_TYPES.read();

Expand Down
4 changes: 2 additions & 2 deletions rerun_py/src/arrow.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Methods for handling Arrow datamodel log ingest

use std::borrow::Cow;
use std::{borrow::Cow, collections::BTreeMap};

use arrow::{
array::{
Expand Down Expand Up @@ -82,7 +82,7 @@ pub fn build_row_from_components(
// TODO(emilk): move to before we arrow-serialize the data
let row_id = RowId::new();

let mut components = IntMap::default();
let mut components = BTreeMap::default();
for (component_descr, array) in components_per_descr {
let component_descr = descriptor_to_rust(&component_descr)?;
let (list_array, _field) = array_to_rust(&array, &component_descr)?;
Expand Down
Loading