9
9
-- Until then, the documentation on definitions in this module is omitted.
10
10
module Database.LSMTree (
11
11
-- * Exceptions
12
- Common. LSMTreeError (.. )
12
+ Common. SessionDirDoesNotExistError (.. )
13
+ , Common. SessionDirLockedError (.. )
14
+ , Common. SessionDirCorruptedError (.. )
15
+ , Common. SessionClosedError (.. )
16
+ , Common. TableClosedError (.. )
17
+ , Common. TableCorruptedError (.. )
18
+ , Common. TableTooLargeError (.. )
19
+ , Common. TableNotCompatibleError (.. )
20
+ , Common. SnapshotExistsError (.. )
21
+ , Common. SnapshotDoesNotExistError (.. )
22
+ , Common. SnapshotCorruptedError (.. )
23
+ , Common. SnapshotNotCompatibleError (.. )
24
+ , Common. BlobRefInvalidError (.. )
25
+ , Common. CursorClosedError (.. )
26
+ , Common. FileFormat (.. )
27
+ , Common. FileCorruptedError (.. )
13
28
, Common. InvalidSnapshotNameError (.. )
14
29
15
30
-- * Tracing
@@ -67,7 +82,7 @@ module Database.LSMTree (
67
82
, retrieveBlobs
68
83
69
84
-- * Durability (snapshots)
70
- , SnapshotName
85
+ , Common. SnapshotName
71
86
, Common. isValidSnapshotName
72
87
, Common. toSnapshotName
73
88
, Common. SnapshotLabel (.. )
@@ -117,16 +132,15 @@ import Data.List.NonEmpty (NonEmpty (..))
117
132
import Data.Typeable (Proxy (.. ), Typeable , eqT , type (:~: ) (Refl ))
118
133
import qualified Data.Vector as V
119
134
import Database.LSMTree.Common (BlobRef (BlobRef ), IOLike , Range (.. ),
120
- SerialiseKey , SerialiseValue , Session , SnapshotName ,
121
- UnionCredits ( .. ), UnionDebt (.. ), closeSession ,
122
- deleteSnapshot , listSnapshots , openSession , withSession )
135
+ SerialiseKey , SerialiseValue , Session , UnionCredits ( .. ) ,
136
+ UnionDebt (.. ), closeSession , deleteSnapshot ,
137
+ listSnapshots , openSession , withSession )
123
138
import qualified Database.LSMTree.Common as Common
124
139
import qualified Database.LSMTree.Internal as Internal
125
140
import qualified Database.LSMTree.Internal.BlobRef as Internal
126
141
import qualified Database.LSMTree.Internal.Entry as Entry
127
142
import qualified Database.LSMTree.Internal.RawBytes as RB
128
143
import qualified Database.LSMTree.Internal.Serialise as Internal
129
- import qualified Database.LSMTree.Internal.Snapshot as Internal
130
144
import qualified Database.LSMTree.Internal.Vector as V
131
145
import Database.LSMTree.Monoidal (ResolveValue (.. ),
132
146
resolveDeserialised , resolveValueAssociativity ,
@@ -476,24 +490,24 @@ retrieveBlobs (Internal.Session' (sesh :: Internal.Session m h)) refs =
476
490
477
491
{-# SPECIALISE createSnapshot ::
478
492
Common.SnapshotLabel
479
- -> SnapshotName
493
+ -> Common. SnapshotName
480
494
-> Table IO k v b
481
495
-> IO () #-}
482
496
createSnapshot :: forall m k v b .
483
497
IOLike m
484
498
=> Common. SnapshotLabel
485
- -> SnapshotName
499
+ -> Common. SnapshotName
486
500
-> Table m k v b
487
501
-> m ()
488
502
createSnapshot label snap (Internal. Table' t) =
489
- void $ Internal. createSnapshot snap label Internal . SnapFullTable t
503
+ void $ Internal. createSnapshot snap label Common . SnapFullTable t
490
504
491
505
{-# SPECIALISE openSnapshot ::
492
506
ResolveValue v
493
507
=> Session IO
494
508
-> Common.TableConfigOverride
495
509
-> Common.SnapshotLabel
496
- -> SnapshotName
510
+ -> Common. SnapshotName
497
511
-> IO (Table IO k v b ) #-}
498
512
openSnapshot :: forall m k v b .
499
513
( IOLike m
@@ -502,10 +516,10 @@ openSnapshot :: forall m k v b.
502
516
=> Session m
503
517
-> Common. TableConfigOverride -- ^ Optional config override
504
518
-> Common. SnapshotLabel
505
- -> SnapshotName
519
+ -> Common. SnapshotName
506
520
-> m (Table m k v b )
507
521
openSnapshot (Internal. Session' sesh) override label snap =
508
- Internal. Table' <$!> Internal. openSnapshot sesh label Internal . SnapFullTable override snap (resolve (Proxy @ v ))
522
+ Internal. Table' <$!> Internal. openSnapshot sesh label Common . SnapFullTable override snap (resolve (Proxy @ v ))
509
523
510
524
{- ------------------------------------------------------------------------------
511
525
Mutiple writable tables
@@ -556,7 +570,7 @@ unions (t :| ts) =
556
570
-> m (Internal. Table m h )
557
571
checkTableType _ i (Internal. Table' (t' :: Internal. Table m h' ))
558
572
| Just Refl <- eqT @ h @ h' = pure t'
559
- | otherwise = throwIO (Internal. ErrUnionsTableTypeMismatch 0 i)
573
+ | otherwise = throwIO (Common. ErrTableTypeMismatch 0 i)
560
574
561
575
{-# SPECIALISE remainingUnionDebt :: Table IO k v b -> IO UnionDebt #-}
562
576
remainingUnionDebt :: IOLike m => Table m k v b -> m UnionDebt
0 commit comments