Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out module MergingRun #498

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading