@@ -83,6 +83,7 @@ import Database.LSMTree.Internal.WriteBuffer (WriteBuffer)
83
83
import qualified Database.LSMTree.Internal.WriteBuffer as WB
84
84
import Database.LSMTree.Internal.WriteBufferBlobs (WriteBufferBlobs )
85
85
import qualified Database.LSMTree.Internal.WriteBufferBlobs as WBB
86
+ import GHC.Stack (HasCallStack )
86
87
import qualified System.FS.API as FS
87
88
import System.FS.API (HasFS )
88
89
import System.FS.BlockIO.API (HasBlockIO )
@@ -198,14 +199,15 @@ data LevelsCache m h = LevelsCache_ {
198
199
}
199
200
200
201
{-# SPECIALISE mkLevelsCache ::
201
- ActionRegistry IO
202
+ HasCallStack
203
+ => ActionRegistry IO
202
204
-> Levels IO h
203
205
-> IO (LevelsCache IO h) #-}
204
206
-- | Flatten the argument 'Level's into a single vector of runs, including all
205
207
-- runs that are inputs to an ongoing merge. Use that to populate the
206
208
-- 'LevelsCache'. The cache will take a reference for each of its runs.
207
209
mkLevelsCache ::
208
- forall m h . (PrimMonad m , MonadMVar m , MonadMask m )
210
+ forall m h . (HasCallStack , PrimMonad m , MonadMVar m , MonadMask m )
209
211
=> ActionRegistry m
210
212
-> Levels m h
211
213
-> m (LevelsCache m h )
@@ -239,7 +241,8 @@ mkLevelsCache reg lvls = do
239
241
(incoming <> ) . fold <$> V. forM rs k1
240
242
241
243
{-# SPECIALISE rebuildCache ::
242
- ActionRegistry IO
244
+ HasCallStack
245
+ => ActionRegistry IO
243
246
-> LevelsCache IO h
244
247
-> Levels IO h
245
248
-> IO (LevelsCache IO h) #-}
@@ -264,7 +267,7 @@ mkLevelsCache reg lvls = do
264
267
-- a solution to keep blob references valid until the next /update/ comes along.
265
268
-- Lookups should no invalidate blob erferences.
266
269
rebuildCache ::
267
- (PrimMonad m , MonadMVar m , MonadMask m )
270
+ (HasCallStack , PrimMonad m , MonadMVar m , MonadMask m )
268
271
=> ActionRegistry m
269
272
-> LevelsCache m h -- ^ old cache
270
273
-> Levels m h -- ^ new levels
@@ -274,11 +277,12 @@ rebuildCache reg oldCache newLevels = do
274
277
mkLevelsCache reg newLevels
275
278
276
279
{-# SPECIALISE duplicateLevelsCache ::
277
- ActionRegistry IO
280
+ HasCallStack
281
+ => ActionRegistry IO
278
282
-> LevelsCache IO h
279
283
-> IO (LevelsCache IO h) #-}
280
284
duplicateLevelsCache ::
281
- (PrimMonad m , MonadMask m )
285
+ (HasCallStack , PrimMonad m , MonadMask m )
282
286
=> ActionRegistry m
283
287
-> LevelsCache m h
284
288
-> m (LevelsCache m h )
@@ -288,11 +292,12 @@ duplicateLevelsCache reg cache = do
288
292
pure cache { cachedRuns = rs' }
289
293
290
294
{-# SPECIALISE releaseLevelsCache ::
291
- ActionRegistry IO
295
+ HasCallStack
296
+ => ActionRegistry IO
292
297
-> LevelsCache IO h
293
298
-> IO () #-}
294
299
releaseLevelsCache ::
295
- (PrimMonad m , MonadMask m )
300
+ (HasCallStack , PrimMonad m , MonadMask m )
296
301
=> ActionRegistry m
297
302
-> LevelsCache m h
298
303
-> m ()
0 commit comments