@@ -90,8 +90,8 @@ module Database.LSMTree.Normal (
9090 , SnapshotName
9191 , Common. mkSnapshotName
9292 , Common. Labellable (.. )
93- , snapshot
94- , open
93+ , createSnapshot
94+ , openSnapshot
9595 , Common. TableConfigOverride
9696 , Common. configNoOverride
9797 , Common. configOverrideDiskCachePolicy
@@ -150,7 +150,7 @@ import qualified Database.LSMTree.Internal.Vector as V
150150--
151151-- * 'openSession'
152152-- * 'new'
153- -- * 'open '
153+ -- * 'openSnapshot '
154154-- * 'duplicate'
155155-- * 'newCursor'
156156--
@@ -171,7 +171,7 @@ import qualified Database.LSMTree.Internal.Vector as V
171171--
172172-- * 'openSession', paired with 'closeSession'
173173-- * 'new', paired with 'close'
174- -- * 'open ', paired with 'close'
174+ -- * 'openSnapshot ', paired with 'close'
175175-- * 'duplicate', paired with 'close'
176176-- * 'newCursor', paired with 'closeCursor'
177177--
@@ -201,7 +201,7 @@ import qualified Database.LSMTree.Internal.Vector as V
201201-- * 'lookups'
202202-- * 'rangeLookup'
203203-- * 'retrieveBlobs'
204- -- * 'snapshot '
204+ -- * 'createSnapshot '
205205-- * 'duplicate'
206206--
207207-- The write operations are:
@@ -639,7 +639,7 @@ retrieveBlobs (Internal.Session' (sesh :: Internal.Session m h)) refs =
639639 Snapshots
640640-------------------------------------------------------------------------------}
641641
642- {-# SPECIALISE snapshot ::
642+ {-# SPECIALISE createSnapshot ::
643643 ( SerialiseKey k
644644 , SerialiseValue v
645645 , SerialiseValue blob
@@ -652,9 +652,9 @@ retrieveBlobs (Internal.Session' (sesh :: Internal.Session m h)) refs =
652652-- giving the snapshot a name. This is the __only__ mechanism to make a table
653653-- durable -- ordinary insert\/delete operations are otherwise not preserved.
654654--
655- -- Snapshots have names and the table may be opened later using 'open' via that
656- -- name. Names are strings and the management of the names is up to the user of
657- -- the library.
655+ -- Snapshots have names and the table may be opened later using 'openSnapshot'
656+ -- via that name. Names are strings and the management of the names is up to
657+ -- the user of the library.
658658--
659659-- The names correspond to disk files, which imposes some constraints on length
660660-- and what characters can be used.
@@ -677,7 +677,7 @@ retrieveBlobs (Internal.Session' (sesh :: Internal.Session m h)) refs =
677677-- as part of the snapshot because run files aren't (yet) deleted when runs are
678678-- closed. The write buffer is also persisted to disk as part of the snapshot,
679679-- but the original table remains unchanged.
680- snapshot :: forall m k v blob .
680+ createSnapshot :: forall m k v blob .
681681 ( IOLike m
682682 , SerialiseKey k
683683 , SerialiseValue v
@@ -687,12 +687,12 @@ snapshot :: forall m k v blob.
687687 => SnapshotName
688688 -> Table m k v blob
689689 -> m ()
690- snapshot snap (Internal. NormalTable t) =
691- void $ Internal. snapshot const snap label Internal. SnapNormalTable t
690+ createSnapshot snap (Internal. NormalTable t) =
691+ void $ Internal. createSnapshot const snap label Internal. SnapNormalTable t
692692 where
693693 label = Internal. SnapshotLabel $ Common. makeSnapshotLabel (Proxy @ (k , v , blob ))
694694
695- {-# SPECIALISE open ::
695+ {-# SPECIALISE openSnapshot ::
696696 ( SerialiseKey k
697697 , SerialiseValue v
698698 , SerialiseValue blob
@@ -717,13 +717,13 @@ snapshot snap (Internal.NormalTable t) =
717717-- @
718718-- example session = do
719719-- t <- 'new' \@IO \@Int \@Int \@Int session _
720- -- 'snapshot ' "intTable" t
721- -- 'open ' \@IO \@Bool \@Bool \@Bool session "intTable"
720+ -- 'createSnapshot ' "intTable" t
721+ -- 'openSnapshot ' \@IO \@Bool \@Bool \@Bool session "intTable"
722722-- @
723723--
724724-- TODO: this function currently has a temporary implementation until we have
725- -- proper snapshots. See 'snapshot '.
726- open :: forall m k v blob .
725+ -- proper snapshots. See 'createSnapshot '.
726+ openSnapshot :: forall m k v blob .
727727 ( IOLike m
728728 , SerialiseKey k
729729 , SerialiseValue v
@@ -734,8 +734,15 @@ open :: forall m k v blob.
734734 -> Common. TableConfigOverride -- ^ Optional config override
735735 -> SnapshotName
736736 -> m (Table m k v blob )
737- open (Internal. Session' sesh) override snap =
738- Internal. NormalTable <$!> Internal. open sesh label Internal. SnapNormalTable override snap const
737+ openSnapshot (Internal. Session' sesh) override snap =
738+ Internal. NormalTable <$!>
739+ Internal. openSnapshot
740+ sesh
741+ label
742+ Internal. SnapNormalTable
743+ override
744+ snap
745+ const
739746 where
740747 label = Internal. SnapshotLabel $ Common. makeSnapshotLabel (Proxy @ (k , v , blob ))
741748
0 commit comments