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>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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