Skip to content

Commit

Permalink
Merge pull request #498 from IntersectMBO/mheinzel/module-merging-run
Browse files Browse the repository at this point in the history
Split out module MergingRun
  • Loading branch information
mheinzel authored Dec 17, 2024
2 parents 9b4d561 + 69b32e6 commit 016716c
Show file tree
Hide file tree
Showing 8 changed files with 675 additions and 587 deletions.
1 change: 1 addition & 0 deletions lsm-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ library
Database.LSMTree.Internal.Lookup
Database.LSMTree.Internal.Merge
Database.LSMTree.Internal.MergeSchedule
Database.LSMTree.Internal.MergingRun
Database.LSMTree.Internal.Page
Database.LSMTree.Internal.PageAcc
Database.LSMTree.Internal.PageAcc1
Expand Down
1 change: 1 addition & 0 deletions src-extras/Database/LSMTree/Extras/NoThunks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import Database.LSMTree.Internal.Index.CompactAcc
import Database.LSMTree.Internal.Merge hiding (Level)
import qualified Database.LSMTree.Internal.Merge as Merge
import Database.LSMTree.Internal.MergeSchedule
import Database.LSMTree.Internal.MergingRun
import Database.LSMTree.Internal.Page
import Database.LSMTree.Internal.PageAcc
import Database.LSMTree.Internal.Paths
Expand Down
5 changes: 4 additions & 1 deletion src/Database/LSMTree/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,9 @@ createSnapshot resolve snap label tableType t = do
-- credits as if the buffer was full, and then flush the (possibly)
-- underfull buffer. However, note that this bit of code
-- here is probably going to change anyway because of #392
supplyCredits conf (Credit $ unNumEntries $ case confWriteBufferAlloc conf of AllocNumEntries x -> x) (tableLevels content)
let credits = case confWriteBufferAlloc conf of
AllocNumEntries n -> Credits (unNumEntries n)
supplyCredits conf credits (tableLevels content)
content' <- flushWriteBuffer
(TraceMerge `contramap` tableTracer t)
conf
Expand Down Expand Up @@ -1196,6 +1198,7 @@ openSnapshot sesh label tableType override snap resolve = do
snapLevels' <- openRuns reg hfs hbio conf (sessionUniqCounter seshEnv) snapDir actDir snapLevels
-- Convert from the snapshot format, restoring merge progress in the process
tableLevels <- fromSnapLevels reg hfs hbio conf (sessionUniqCounter seshEnv) resolve actDir snapLevels'
releaseRuns reg snapLevels'

tableCache <- mkLevelsCache reg tableLevels
newWith reg sesh seshEnv conf' am $! TableContent {
Expand Down
Loading

0 comments on commit 016716c

Please sign in to comment.