lsm-tree-0.1.0.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.LSMTree.Internal.Index.Ordinary

Description

A general-purpose fence pointer index.

Keys used with an ordinary index must be smaller than 64 KiB.

Synopsis

Documentation

newtype IndexOrdinary Source #

A general-purpose fence pointer index.

An index is represented by a vector that maps the number of each page to the key stored last in this page or, if the page is an overflow page, to the key of the corresponding key–value pair. The vector must have the following properties:

  • It is non-empty.
  • Its elements are non-decreasing.

This restriction follows from the fact that a run must contain keys in ascending order and must comprise at least one page for search to be able to return a valid page span.

search :: SerialisedKey -> IndexOrdinary -> PageSpan Source #

For a specification of this operation, see the documentation of its type-agnostic version.

sizeInPages :: IndexOrdinary -> NumPages Source #

For a specification of this operation, see the documentation of its type-agnostic version.

headerLBS :: LazyByteString Source #

For a specification of this operation, see the documentation of its type-agnostic version.

finalLBS :: NumEntries -> IndexOrdinary -> LazyByteString Source #

For a specification of this operation, see the documentation of its type-agnostic version.

fromSBS :: ShortByteString -> Either String (NumEntries, IndexOrdinary) Source #

For a specification of this operation, see the documentation of its type-agnostic version.