@@ -22,7 +22,6 @@ module Database.LSMTree.Internal.Run (
2222 , fromWriteBuffer
2323 , RunDataCaching (.. )
2424 -- * Snapshot
25- , FileFormatError (.. )
2625 , openFromDisk
2726 ) where
2827
@@ -234,10 +233,6 @@ fromWriteBuffer fs hbio caching alloc fsPaths buffer blobs = do
234233 Snapshot
235234-------------------------------------------------------------------------------}
236235
237- data FileFormatError = FileFormatError FS. FsPath String
238- deriving stock Show
239- deriving anyclass Exception
240-
241236{-# SPECIALISE openFromDisk ::
242237 HasFS IO h
243238 -> HasBlockIO IO h
@@ -262,7 +257,7 @@ openFromDisk ::
262257-- TODO: make exception safe
263258openFromDisk fs hbio runRunDataCaching runRunFsPaths = do
264259 expectedChecksums <-
265- expectValidFile (runChecksumsPath runRunFsPaths) . fromChecksumsFile
260+ CRC. expectValidFile (runChecksumsPath runRunFsPaths) . fromChecksumsFile
266261 =<< CRC. readChecksumsFile fs (runChecksumsPath runRunFsPaths)
267262
268263 -- verify checksums of files we don't read yet
@@ -272,10 +267,10 @@ openFromDisk fs hbio runRunDataCaching runRunFsPaths = do
272267
273268 -- read and try parsing files
274269 runFilter <-
275- expectValidFile (forRunFilterRaw paths) . bloomFilterFromSBS
270+ CRC. expectValidFile (forRunFilterRaw paths) . bloomFilterFromSBS
276271 =<< readCRC (forRunFilterRaw expectedChecksums) (forRunFilterRaw paths)
277272 (runNumEntries, runIndex) <-
278- expectValidFile (forRunIndexRaw paths) . Index. fromSBS
273+ CRC. expectValidFile (forRunIndexRaw paths) . Index. fromSBS
279274 =<< readCRC (forRunIndexRaw expectedChecksums) (forRunIndexRaw paths)
280275
281276 runKOpsFile <- FS. hOpen fs (runKOpsPath runRunFsPaths) FS. ReadMode
@@ -306,6 +301,3 @@ openFromDisk fs hbio runRunDataCaching runRunFsPaths = do
306301 FS. hAdviseAll hbio h FS. AdviceDontNeed
307302 CRC. expectChecksum fp expected checksum
308303 return sbs
309-
310- expectValidFile _ (Right x) = pure x
311- expectValidFile fp (Left err) = throwIO $ FileFormatError fp err
0 commit comments