Struct re_chunk_store::ChunkStoreDiff
source · pub struct ChunkStoreDiff {
pub kind: ChunkStoreDiffKind,
pub chunk: Arc<Chunk>,
pub compacted: Option<(BTreeMap<ChunkId, Arc<Chunk>>, ChunkId)>,
}
Expand description
Describes an atomic change in the Rerun ChunkStore
: a chunk has been added or deleted.
From a query model standpoint, the ChunkStore
always operates one chunk at a time:
- The contents of a chunk (i.e. its columns) are immutable past insertion, by virtue of
[
ChunkId
]s being unique and non-reusable. - Similarly, garbage collection always removes all the data associated with a chunk in one go: there cannot be orphaned columns. When a chunk is gone, all data associated with it is gone too.
Refer to field-level documentation for more information.
Fields§
§kind: ChunkStoreDiffKind
Addition or deletion?
The store’s internals are opaque and don’t necessarily reflect the query model (e.g. there might be data in the store that cannot by reached by any query).
A ChunkStoreDiff
answers a logical question: “does there exist a query path which can return
data from that chunk?”.
An event of kind deletion only tells you that, from this point on, no query can return data from that chunk. That doesn’t necessarily mean that the data is actually gone, i.e. don’t make assumptions of e.g. the size in bytes of the store based on these events. They are in “query-model space” and are not an accurate representation of what happens in storage space.
chunk: Arc<Chunk>
The chunk that was added or removed.
If the addition of a chunk to the store triggered a compaction, that chunk pre-compaction is what will be exposed here. This allows subscribers to only process data that is new, as opposed to having to reprocess old rows that appear to have been removed and then reinserted due to compaction.
To keep track of what chunks were merged with what chunks, use the ChunkStoreDiff::compacted
field below.
compacted: Option<(BTreeMap<ChunkId, Arc<Chunk>>, ChunkId)>
Reports which [Chunk
]s were merged into a new [ChunkId
] (srcs, dst) during a compaction.
This is only specified if an addition to the store triggered a compaction.
When that happens, it is guaranteed that ChunkStoreDiff::chunk
will be present in the
set of source chunks below, since it was compacted on arrival.
A corollary to that is that the destination [ChunkId
] must have never been seen before.
Implementations§
Trait Implementations§
source§impl Clone for ChunkStoreDiff
impl Clone for ChunkStoreDiff
source§fn clone(&self) -> ChunkStoreDiff
fn clone(&self) -> ChunkStoreDiff
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChunkStoreDiff
impl Debug for ChunkStoreDiff
source§impl PartialEq for ChunkStoreDiff
impl PartialEq for ChunkStoreDiff
impl Eq for ChunkStoreDiff
Auto Trait Implementations§
impl Freeze for ChunkStoreDiff
impl !RefUnwindSafe for ChunkStoreDiff
impl Send for ChunkStoreDiff
impl Sync for ChunkStoreDiff
impl Unpin for ChunkStoreDiff
impl !UnwindSafe for ChunkStoreDiff
Blanket Implementations§
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more