pub struct ChunkKey {
pub sstable: u64,
pub chunk_index: u64,
pub aux: u64,
}Expand description
Authoritative cache key: an SSTable identity hash and a chunk discriminator.
chunk_index carries whichever authoritative offset the wiring site uses —
a real chunk index (windowed scan, BTI target chunk) or an index-resolved
block_offset (BIG point read). Sites keep separate key namespaces by folding
a site salt into sstable (design D4), so numerically-overlapping values from
different sites never collide.
Fields§
§sstable: u64Stable hash of the SSTable’s file_path (+ generation), optionally XORed
with a per-site namespace salt.
chunk_index: u64Authoritative chunk index or index-resolved offset within sstable.
aux: u64Extra discriminant for a size-dependent range read. The chunk-index sites
(BTI, windowed scan) decompress a whole compression chunk whose bytes are
fully determined by chunk_index, so they use aux = 0. The BIG
point-read path (get_cached_data) reads an index-resolved
(block_offset, size) byte range whose decompressed content depends on
BOTH the offset AND the length: two reads at the same block_offset with
different size decompress different input and MUST NOT alias. aux
carries size for that path so the key is complete (roborev #1567), and
because (u64 offset, u32 size) cannot be packed into one u64 without
loss, aux is a first-class key field, not folded into chunk_index.
Implementations§
Trait Implementations§
impl Copy for ChunkKey
impl Eq for ChunkKey
impl StructuralPartialEq for ChunkKey
Auto Trait Implementations§
impl Freeze for ChunkKey
impl RefUnwindSafe for ChunkKey
impl Send for ChunkKey
impl Sync for ChunkKey
impl Unpin for ChunkKey
impl UnsafeUnpin for ChunkKey
impl UnwindSafe for ChunkKey
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.