pub struct PerCoreWalEntry {
pub epoch: u64,
pub sequence: u64,
pub core_id: u16,
pub timestamp_ns: i64,
pub operation: WalOperation,
}Expand description
Per-core WAL entry with epoch for cross-core ordering.
Entries are ordered by (epoch, timestamp_ns) for deterministic recovery.
The 32-byte compact layout is designed for cache efficiency.
Fields§
§epoch: u64Global epoch (for ordering during recovery).
sequence: u64Core-local sequence number (monotonically increasing per core).
core_id: u16Core ID that wrote this entry.
timestamp_ns: i64Timestamp in nanoseconds since Unix epoch.
operation: WalOperationThe actual operation.
Implementations§
Source§impl PerCoreWalEntry
impl PerCoreWalEntry
Sourcepub fn put(
core_id: u16,
epoch: u64,
sequence: u64,
key: Vec<u8>,
value: Vec<u8>,
timestamp_ns: i64,
) -> Self
pub fn put( core_id: u16, epoch: u64, sequence: u64, key: Vec<u8>, value: Vec<u8>, timestamp_ns: i64, ) -> Self
Sourcepub fn delete(
core_id: u16,
epoch: u64,
sequence: u64,
key: Vec<u8>,
timestamp_ns: i64,
) -> Self
pub fn delete( core_id: u16, epoch: u64, sequence: u64, key: Vec<u8>, timestamp_ns: i64, ) -> Self
Sourcepub fn checkpoint(
core_id: u16,
epoch: u64,
sequence: u64,
checkpoint_id: u64,
timestamp_ns: i64,
) -> Self
pub fn checkpoint( core_id: u16, epoch: u64, sequence: u64, checkpoint_id: u64, timestamp_ns: i64, ) -> Self
Sourcepub fn commit(
core_id: u16,
epoch: u64,
sequence: u64,
offsets: HashMap<String, u64>,
watermark: Option<i64>,
timestamp_ns: i64,
) -> Self
pub fn commit( core_id: u16, epoch: u64, sequence: u64, offsets: HashMap<String, u64>, watermark: Option<i64>, timestamp_ns: i64, ) -> Self
Sourcepub fn is_checkpoint(&self) -> bool
pub fn is_checkpoint(&self) -> bool
Returns true if this is a Checkpoint operation.
Sourcepub fn is_state_operation(&self) -> bool
pub fn is_state_operation(&self) -> bool
Returns true if this is a state-modifying operation (Put or Delete).
Trait Implementations§
Source§impl Archive for PerCoreWalEntry
impl Archive for PerCoreWalEntry
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§impl Clone for PerCoreWalEntry
impl Clone for PerCoreWalEntry
Source§fn clone(&self) -> PerCoreWalEntry
fn clone(&self) -> PerCoreWalEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PerCoreWalEntry
impl Debug for PerCoreWalEntry
Source§impl<__D: Fallible + ?Sized> Deserialize<PerCoreWalEntry, __D> for Archived<PerCoreWalEntry>where
u64: Archive,
<u64 as Archive>::Archived: Deserialize<u64, __D>,
u16: Archive,
<u16 as Archive>::Archived: Deserialize<u16, __D>,
i64: Archive,
<i64 as Archive>::Archived: Deserialize<i64, __D>,
WalOperation: Archive,
<WalOperation as Archive>::Archived: Deserialize<WalOperation, __D>,
impl<__D: Fallible + ?Sized> Deserialize<PerCoreWalEntry, __D> for Archived<PerCoreWalEntry>where
u64: Archive,
<u64 as Archive>::Archived: Deserialize<u64, __D>,
u16: Archive,
<u16 as Archive>::Archived: Deserialize<u16, __D>,
i64: Archive,
<i64 as Archive>::Archived: Deserialize<i64, __D>,
WalOperation: Archive,
<WalOperation as Archive>::Archived: Deserialize<WalOperation, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<PerCoreWalEntry, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<PerCoreWalEntry, <__D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl Ord for PerCoreWalEntry
impl Ord for PerCoreWalEntry
Source§impl PartialEq for PerCoreWalEntry
impl PartialEq for PerCoreWalEntry
Source§impl PartialOrd for PerCoreWalEntry
impl PartialOrd for PerCoreWalEntry
Source§impl<__S: Fallible + ?Sized> Serialize<__S> for PerCoreWalEntry
impl<__S: Fallible + ?Sized> Serialize<__S> for PerCoreWalEntry
impl Eq for PerCoreWalEntry
impl StructuralPartialEq for PerCoreWalEntry
Auto Trait Implementations§
impl Freeze for PerCoreWalEntry
impl RefUnwindSafe for PerCoreWalEntry
impl Send for PerCoreWalEntry
impl Sync for PerCoreWalEntry
impl Unpin for PerCoreWalEntry
impl UnsafeUnpin for PerCoreWalEntry
impl UnwindSafe for PerCoreWalEntry
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read more§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
Compare self to
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>
Converts
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>
Converts
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Scope for T
impl<T> Scope for T
§impl<T, S> SerializeUnsized<S> for Twhere
T: Serialize<S>,
S: Fallible + Writer + ?Sized,
impl<T, S> SerializeUnsized<S> for Twhere
T: Serialize<S>,
S: Fallible + Writer + ?Sized,
§fn serialize_unsized(
&self,
serializer: &mut S,
) -> Result<usize, <S as Fallible>::Error>
fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>
Writes the object and returns the position of the archived type.