[][src]Crate pagecache

pagecache is a lock-free pagecache and log for building high-performance databases.

Re-exports

pub use self::logger::Log;
pub use self::logger::LogRead;

Modules

atomic

Atomic types

logger

Working with Log

Structs

Atomic

An atomic pointer that can be safely shared between threads.

Backoff

Performs exponential backoff in spin loops.

CachePadded

Pads and aligns a value to the length of a cache line.

Collector

An epoch-based garbage collector.

CompareAndSetError

The error returned on failed compare-and-set operation.

Config

A finalized ConfigBuilder that can be use multiple times to open a Tree or Log.

ConfigBuilder

Top-level configuration for the system.

Guard

A guard that keeps the current thread pinned.

LocalHandle

A handle to a garbage collector.

Lru

A simple Lru cache.

M

A metric collector for all pagecache users running in this process.

Meta

A simple map that can be used to store metadata for the pagecache tenant.

Node

A node in the lock-free Stack.

NullMaterializer

A materializer for things that have nothing to materialize or recover, like a standalone Log.

Owned

An owned heap-allocated object.

PageCache

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.

PageTable

A simple lock-free radix tree.

Reservation

A pending log reservation which can be aborted or completed. NB the holder should quickly call complete or abort 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.

StackIter

An iterator over nodes in a lock-free stack.

Tx

A handle to an ongoing pagecache transaction. Ensures that any state which is removed from a shared in-memory data structure is not destroyed until all possible readers have concluded.

VecSet

A set built on top of Vec and binary search, for use when calling nth to iterate over a set is too expensive, and the set size is expected to be ~10 or less most of the time.

Enums

CacheEntry

Points to either a memory location or a disk location to page-in data from.

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.

PageGet

The result of a get call in the PageCache.

SegmentMode

The log may be configured to write data in several different ways, depending on the constraints of the system using it.

Traits

Materializer

A user of a PageCache needs to provide a Materializer which handles the merging of page fragments.

Functions

debug_delay

This function is useful for inducing random jitter into our atomic operations, shaking out more possible interleavings quickly. It gets fully elliminated by the compiler in non-test code.

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 Atomics.

Type Definitions

BlobPointer

A pointer to an blob blob.

CasResult

A compare and swap result. If the CAS is successful, the new PagePtr will be returned as Ok. If the CAS is not successful, the Err will contain a tuple of the current PagePtr and the old value that could not be set atomically.

FastMap1

A fast map that is not resistant to collision attacks. Works on one byte at a time.

FastMap4

A fast map that is not resistant to collision attacks. Works on 4 bytes at a time.

FastMap8

A fast map that is not resistant to collision attacks. Works on 8 bytes at a time.

FastSet1

A fast set that is not resistant to collision attacks. Works on one byte at a time.

FastSet4

A fast set that is not resistant to collision attacks. Works on 4 bytes at a time.

FastSet8

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.

MergeOperator

Allows arbitrary logic to be injected into mere operations of the PageCache.

PageId

A page identifier.

Result

The top-level result type for dealing with the PageCache.

SegmentId

An offset for a storage file segment.