pub struct MemtableKey {
pub series_key_hash: u64,
pub timestamp: i64,
pub series_canonical: Arc<str>,
/* private fields */
}Expand description
Key used for ordering entries in the memtable’s skip list.
Points are sorted first by series_key_hash (fast grouping), then
by timestamp, then by series_canonical_hash2 (fast integer
comparison), and finally by series_canonical as a rare-case
tie-breaker for the astronomically unlikely double-hash collision.
series_canonical is Arc<str> (interned) to avoid
per-insert heap allocation of duplicate canonical strings.
series_canonical_hash2 (SipHash) provides a fast
integer comparison path — the byte-by-byte string comparison only
fires when both FNV and SipHash collide simultaneously.
Fields§
§series_key_hash: u64FNV-1a hash of the canonical series key (fast routing).
timestamp: i64Nanosecond-precision Unix epoch timestamp.
series_canonical: Arc<str>Interned canonical series key — collision-proof tie-breaker.
Implementations§
Source§impl MemtableKey
impl MemtableKey
Sourcepub fn new(
series_key_hash: u64,
timestamp: i64,
series_canonical: Arc<str>,
) -> Self
pub fn new( series_key_hash: u64, timestamp: i64, series_canonical: Arc<str>, ) -> Self
Create a new memtable key.
Accepts Arc<str> (interned) instead of String.
Sourcepub fn lower_bound(series_key_hash: u64, timestamp: i64) -> Self
pub fn lower_bound(series_key_hash: u64, timestamp: i64) -> Self
Create a lower-bound key for range scans.
Uses u64::MIN for the secondary hash and an empty string so
this key sorts before all real keys with the same (hash, ts).
Sourcepub fn upper_bound(series_key_hash: u64, timestamp: i64) -> Self
pub fn upper_bound(series_key_hash: u64, timestamp: i64) -> Self
Create an upper-bound key for range scans.
Uses u64::MAX for the secondary hash and a max-codepoint string
so this key sorts after all real keys with the same (hash, ts).
Trait Implementations§
Source§impl Clone for MemtableKey
impl Clone for MemtableKey
Source§fn clone(&self) -> MemtableKey
fn clone(&self) -> MemtableKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemtableKey
impl Debug for MemtableKey
impl Eq for MemtableKey
Source§impl Hash for MemtableKey
impl Hash for MemtableKey
Source§impl Ord for MemtableKey
impl Ord for MemtableKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MemtableKey
impl PartialEq for MemtableKey
Source§impl PartialOrd for MemtableKey
impl PartialOrd for MemtableKey
impl StructuralPartialEq for MemtableKey
Auto Trait Implementations§
impl Freeze for MemtableKey
impl RefUnwindSafe for MemtableKey
impl Send for MemtableKey
impl Sync for MemtableKey
impl Unpin for MemtableKey
impl UnsafeUnpin for MemtableKey
impl UnwindSafe for MemtableKey
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> Comparable<K> for Q
impl<Q, K> Comparable<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§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