Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
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
- newtype IndexOrdinary = IndexOrdinary (Vector SerialisedKey)
- toLastKeys :: IndexOrdinary -> Vector SerialisedKey
- search :: SerialisedKey -> IndexOrdinary -> PageSpan
- sizeInPages :: IndexOrdinary -> NumPages
- headerLBS :: LazyByteString
- finalLBS :: NumEntries -> IndexOrdinary -> LazyByteString
- fromSBS :: ShortByteString -> Either String (NumEntries, IndexOrdinary)
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.
Constructors
IndexOrdinary (Vector SerialisedKey) |
Instances
Show IndexOrdinary Source # | |
Defined in Database.LSMTree.Internal.Index.Ordinary Methods showsPrec :: Int -> IndexOrdinary -> ShowS # show :: IndexOrdinary -> String # showList :: [IndexOrdinary] -> ShowS # | |
NFData IndexOrdinary Source # | |
Defined in Database.LSMTree.Internal.Index.Ordinary Methods rnf :: IndexOrdinary -> () # | |
Eq IndexOrdinary Source # | |
Defined in Database.LSMTree.Internal.Index.Ordinary Methods (==) :: IndexOrdinary -> IndexOrdinary -> Bool # (/=) :: IndexOrdinary -> IndexOrdinary -> Bool # |
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.