Expand description
pagecache
is a lock-free pagecache and log for building high-performance
databases.
Re-exports§
pub use self::logger::Log;
Modules§
- debug
- Debug helps test concurrent issues with random jitter and other instruments.
- logger
- Working with
Log
- threadpool
- A simple adaptive threadpool that returns a oneshot future.
Structs§
- Atomic
- An atomic pointer that can be safely shared between threads.
- Backoff
- Performs exponential backoff in spin loops.
- Cache
Padded - Pads and aligns a value to the length of a cache line.
- Collector
- An epoch-based garbage collector.
- Compare
AndSet Error - The error returned on failed compare-and-set operation.
- Config
- A finalized
ConfigBuilder
that can be use multiple times to open aTree
orLog
. - Config
Builder - Top-level configuration for the system.
- Guard
- A guard that keeps the current thread pinned.
- Histogram
- A histogram collector that uses zero-configuration logarithmic buckets.
- Lazy
- A lazily initialized value
- Local
Handle - A handle to a garbage collector.
- Lru
- A simple LRU cache.
- Meta
- A simple map that can be used to store metadata for the pagecache tenant.
- Node
- A node in the lock-free
Stack
. - OneShot
- A Future value which may or may not be filled
- OneShot
Filler - The completer side of the Future
- Owned
- An owned heap-allocated object.
- Page
Cache - A lock-free pagecache which supports fragmented pages for dramatically improving write throughput.
- PagePtr
- A pointer to shared lock-free state bound by a pinned epoch’s lifetime.
- Page
Table - A simple lock-free radix tree.
- Recovery
Guard - Ensures that any operations that are written to disk between the creation of this guard and its destruction will be recovered atomically. When this guard is dropped, it marks in an earlier reservation where the stable tip must be in order to perform recovery. If this is beyond where the system successfully wrote before crashing, then the recovery will stop immediately before any of the atomic batch can be partially recovered.
- Reservation
- A pending log reservation which can be aborted or completed.
NB the holder should quickly call
complete
orabort
as taking too long to decide will cause the underlying IO buffer to become blocked. - Shared
- A pointer to an object protected by the epoch GC.
- Stack
- A simple lock-free stack, with the ability to atomically append or entirely swap-out entries.
- Stack
Iter - An iterator over nodes in a lock-free stack.
- VecSet
- A set built on top of
Vec
and binary search, for use when callingnth
to iterate over a set is too expensive, and the set size is expected to be ~10 or less most of the time.
Enums§
- DiskPtr
- A pointer to a location on disk or an off-log blob.
- Error
- An Error type encapsulating various issues that may come up
in both the expected and unexpected operation of a
PageCache
. - LogKind
- The high-level types of stored information about pages and their mutations
- Segment
Mode - The log may be configured to write data in several different ways, depending on the constraints of the system using it.
Statics§
- M
- A metric collector for all pagecache users running in this process.
Traits§
- Materializer
- A user of a
PageCache
needs to provide aMaterializer
which handles the merging of page fragments.
Functions§
- node_
from_ frag_ vec - Turns a vector of elements into a lock-free stack of them, and returns the head of the stack.
- pin
- Pins the current thread.
- unprotected⚠
- Returns a reference to a dummy guard that allows unprotected access to
Atomic
s.
Type Aliases§
- Blob
Pointer - A pointer to an blob blob.
- CasResult
- A compare and swap result. If the CAS is successful,
the new
PagePtr
will be returned asOk
. Otherwise, theErr
will contain a tuple of the currentPagePtr
and the old value that could not be set atomically. - Fast
Map1 - A fast map that is not resistant to collision attacks. Works on one byte at a time.
- Fast
Map4 - A fast map that is not resistant to collision attacks. Works on 4 bytes at a time.
- Fast
Map8 - A fast map that is not resistant to collision attacks. Works on 8 bytes at a time.
- Fast
Set1 - A fast set that is not resistant to collision attacks. Works on one byte at a time.
- Fast
Set4 - A fast set that is not resistant to collision attacks. Works on 4 bytes at a time.
- Fast
Set8 - A fast set that is not resistant to collision attacks. Works on 8 bytes at a time.
- LogId
- A log file offset.
- Lsn
- A logical sequence number.
- PageId
- A page identifier.
- Result
- The top-level result type for dealing with
the
PageCache
. - Segment
Id - An offset for a storage file segment.