| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | GHC2021 | 
Database.LSMTree.Internal.Index.CompactAcc
Description
Incremental construction of a compact index yields chunks of the primary array that can be serialised incrementally.
Incremental construction is an ST computation that can be started using
 new, returning an IndexCompactAcc structure that accumulates internal
 state. appending new pages to the IndexCompactAcc might yield Chunks.
 Incremental construction can be finalised with unsafeEnd, which yields both
 a Chunk (possibly) and the IndexCompact.
Synopsis
- data IndexCompactAcc s = IndexCompactAcc {
- icaPrimary :: !(STRef s (NonEmpty (MVector s Word64)))
 - icaClashes :: !(STRef s (NonEmpty (MVector s Bit)))
 - icaTieBreaker :: !(STRef s (Map (Unsliced SerialisedKey) PageNo))
 - icaLargerThanPage :: !(STRef s (NonEmpty (MVector s Bit)))
 - icaMaxChunkSize :: !Int
 - icaCurrentPageNumber :: !(STRef s Int)
 - icaLastMaxPrimbits :: !(STRef s (SMaybe Word64))
 - icaLastMinKey :: !(STRef s (SMaybe SerialisedKey))
 
 - new :: Int -> ST s (IndexCompactAcc s)
 - newWithDefaults :: ST s (IndexCompactAcc s)
 - appendSingle :: forall s. (SerialisedKey, SerialisedKey) -> IndexCompactAcc s -> ST s (Maybe Chunk)
 - appendMulti :: forall s. (SerialisedKey, Word32) -> IndexCompactAcc s -> ST s [Chunk]
 - unsafeEnd :: IndexCompactAcc s -> ST s (Maybe Chunk, IndexCompact)
 - data SMaybe a
 - smaybe :: b -> (a -> b) -> SMaybe a -> b
 - unsafeWriteRange :: Unbox a => MVector s a -> Bound Int -> Bound Int -> a -> ST s ()
 - vectorLowerBound :: Bound Int -> Int
 - mvectorUpperBound :: MVector v a => v s a -> Bound Int -> Int
 
Construction
data IndexCompactAcc s Source #
A mutable version of IndexCompact. See incremental
 construction.
Constructors
| IndexCompactAcc | |
Fields 
  | |
new :: Int -> ST s (IndexCompactAcc s) Source #
 creates a new mutable index with a maximum chunk size of
 new maxcsizemaxcsize.
PRECONDITION: maxcsize > 0
Note: after initialisation, maxcsize can no longer be changed.
newWithDefaults :: ST s (IndexCompactAcc s) Source #
For a specification of this operation, see the documentation of its type-agnostic version.
appendSingle :: forall s. (SerialisedKey, SerialisedKey) -> IndexCompactAcc s -> ST s (Maybe Chunk) Source #
For a specification of this operation, see the documentation of its type-agnostic version.
appendMulti :: forall s. (SerialisedKey, Word32) -> IndexCompactAcc s -> ST s [Chunk] Source #
For a specification of this operation, see the documentation of its type-agnostic version.
unsafeEnd :: IndexCompactAcc s -> ST s (Maybe Chunk, IndexCompact) Source #
For a specification of this operation, see the documentation of its type-agnostic version.