Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Database.LSMTree.Internal.MergingTree.Lookup
Synopsis
- data LookupTree a
- = LookupBatch !a
- | LookupNode !TreeMergeType !(Vector (LookupTree a))
- mapMStrict :: Monad m => (a -> m b) -> LookupTree a -> m (LookupTree b)
- 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))))
- 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
Foldable LookupTree Source # | |
Defined in Database.LSMTree.Internal.MergingTree.Lookup Methods fold :: Monoid m => LookupTree m -> m # foldMap :: Monoid m => (a -> m) -> LookupTree a -> m # foldMap' :: Monoid m => (a -> m) -> LookupTree a -> m # foldr :: (a -> b -> b) -> b -> LookupTree a -> b # foldr' :: (a -> b -> b) -> b -> LookupTree a -> b # foldl :: (b -> a -> b) -> b -> LookupTree a -> b # foldl' :: (b -> a -> b) -> b -> LookupTree a -> b # foldr1 :: (a -> a -> a) -> LookupTree a -> a # foldl1 :: (a -> a -> a) -> LookupTree a -> a # toList :: LookupTree a -> [a] # null :: LookupTree a -> Bool # length :: LookupTree a -> Int # elem :: Eq a => a -> LookupTree a -> Bool # maximum :: Ord a => LookupTree a -> a # minimum :: Ord a => LookupTree a -> a # sum :: Num a => LookupTree a -> a # product :: Num a => LookupTree a -> a # |
mapMStrict :: Monad m => (a -> m b) -> LookupTree a -> m (LookupTree b) Source #
Deriving Traversable
leads to functions that are not strict in the
elements of the vector of children. This function avoids that issue.
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.
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.