[−][src]Struct crndm::stm::Log
The Log
type for pool A
It is pair of LogEnum
and Notifier
to keep a log in the Journal
.
A Journal
comprises multiple pages with a fixed number of log slots.
Each slot can be filled by one Log
. The Journal
object uses these logs
to provide data consistency. Logs reside in the persistent region and their
durability is ensured by flushing the cache lines after each log.
The default mechanism of taking logs is copy-on-write which takes a log when
the object is mutably dereferenced. This requires two clflush
es: one for
the log, and one for the update to the original data.
Implementations
impl<A: MemPool> Log<A>
[src]
pub fn set(&mut self, off: u64, len: usize)
[src]
Sets the off
and len
of the log
This function is used for low-level atomic allocation. The algorithm is as follows:
- Take a neutral drop log (
off = u64::MAX
) in a log slot in theJournal
- Prepare allocation using
pre_alloc()
- Add a low-level log for updating the
off
andlen
of the drop log usingset
function - Perform the prepared changes to the allocator
Note that the deallocation of owned objects are handled through RAII.
To reclaim the allocation of any sort on a failure, low-level
DropOnFailure
log is provided with the allocation.
If a crash happens before step 4, all changes are discarded and the drop log remains neutral. If a crash happens in the middle of step 4, the recovery procedure continues performing the changes, including the low-level logs for updating the drop log. Once it has the high-level drop log, the high-level recovery procedure reclaims the allocation as the crash happened inside a transaction.
impl<A: MemPool> Log<A>
[src]
pub fn new(log: LogEnum, notifier: Notifier<A>) -> Self
[src]
Create a new log entry
pub fn take<T: PSafe + ?Sized>(
x: &T,
journal: &Journal<A>,
notifier: Notifier<A>
) -> Ptr<Log<A>, A>
[src]
x: &T,
journal: &Journal<A>,
notifier: Notifier<A>
) -> Ptr<Log<A>, A>
Takes a log of x
into journal
and notifies the owner that log is
taken if notifier
is specified.
pub fn drop_on_commit(
offset: u64,
len: usize,
journal: &Journal<A>
) -> Ptr<Log<A>, A>
[src]
offset: u64,
len: usize,
journal: &Journal<A>
) -> Ptr<Log<A>, A>
Creates a new DropOnCommit
log and writes it on journal
pub fn drop_on_abort(
offset: u64,
len: usize,
journal: &Journal<A>
) -> Ptr<Log<A>, A>
[src]
offset: u64,
len: usize,
journal: &Journal<A>
) -> Ptr<Log<A>, A>
Creates a new DropOnAbort
log and writes it on journal
pub fn drop_on_failure(
offset: u64,
len: usize,
journal: &Journal<A>
) -> Ptr<Log<A>, A>
[src]
offset: u64,
len: usize,
journal: &Journal<A>
) -> Ptr<Log<A>, A>
Creates a new DropOnFailure
log and writes it on journal
pub fn unlock_on_commit(virt_addr: u64, journal: &Journal<A>)
[src]
Creates a new UnlockOnCommit
for locking data in a thread
pub fn clear(&mut self)
[src]
Clears this log and notifies the owner
- If it is a
DataLog
, it reclaims the allocation for the log. - If it is a
UnlockOnCommit
, it unlocks the mutex.
pub fn notify(&mut self, v: u8)
[src]
Notify the owner that the log is taken/cleared according to v
Trait Implementations
impl<A: MemPool> Clone for Log<A>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: MemPool> Copy for Log<A>
[src]
impl<A: MemPool> Debug for Log<A>
[src]
impl<A: MemPool> Default for Log<A>
[src]
Auto Trait Implementations
impl<A> LooseTxInUnsafe for Log<A> where
A: LooseTxInUnsafe,
[src]
A: LooseTxInUnsafe,
impl<A> PSafe for Log<A>
[src]
impl<A> RefUnwindSafe for Log<A> where
A: RefUnwindSafe,
[src]
A: RefUnwindSafe,
impl<A> !Send for Log<A>
[src]
impl<A> !Sync for Log<A>
[src]
impl<A> TxInSafe for Log<A> where
A: TxInSafe,
[src]
A: TxInSafe,
impl<A> !TxOutSafe for Log<A>
[src]
impl<A> Unpin for Log<A> where
A: Unpin,
[src]
A: Unpin,
impl<A> UnwindSafe for Log<A> where
A: UnwindSafe,
[src]
A: UnwindSafe,
impl<A> VSafe for Log<A> where
A: VSafe,
[src]
A: VSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,