Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Database.LSMTree.Internal.MergingTree.Lookup
Synopsis
- data LookupTree a
- = LookupBatch !a
- | LookupNode !TreeMergeType !(Vector (LookupTree a))
- mkLookupNode :: TreeMergeType -> Vector (LookupTree a) -> LookupTree a
- buildLookupTree :: (PrimMonad m, MonadMVar m, MonadMask m) => ActionRegistry m -> Ref (MergingTree m h) -> m (LookupTree (Vector (Ref (Run m h))))
- releaseLookupTree :: (PrimMonad m, MonadMask m) => ActionRegistry m -> LookupTree (Vector (Ref (Run m h))) -> m ()
- foldLookupTree :: MonadAsync m => ResolveSerialisedValue -> LookupTree (Async m (LookupAcc m h)) -> m (LookupAcc m h)
Documentation
data LookupTree a Source #
A simplified representation of the shape of a MergingTree
.
Constructors
LookupBatch !a | |
LookupNode | Use |
Fields
|
Instances
mkLookupNode :: TreeMergeType -> Vector (LookupTree a) -> LookupTree a Source #
Asserts that the vector is non-empty. Collapses singleton nodes.
buildLookupTree :: (PrimMonad m, MonadMVar m, MonadMask m) => ActionRegistry m -> Ref (MergingTree m h) -> m (LookupTree (Vector (Ref (Run m h)))) Source #
Create a LookupTree
of batches of runs, e.g. to do lookups on. The
entries within each batch are to be combined using MergeLevel
.
Assumes that the merging tree is not isStructurallyEmpty
.
This function duplicates the references to all the tree's runs.
These references later need to be released using releaseLookupTree
.
releaseLookupTree :: (PrimMonad m, MonadMask m) => ActionRegistry m -> LookupTree (Vector (Ref (Run m h))) -> m () Source #
foldLookupTree :: MonadAsync m => ResolveSerialisedValue -> LookupTree (Async m (LookupAcc m h)) -> m (LookupAcc m h) Source #
Combine a tree of accs into a single one, using the TreeMergeType
of
each node.