Skip to content

Commit

Permalink
Run pre-commit script
Browse files Browse the repository at this point in the history
  • Loading branch information
wenkokke committed Dec 5, 2024
1 parent f6fd19a commit eb55cf0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
33 changes: 19 additions & 14 deletions src/Database/LSMTree/Internal/WriteBufferReader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,35 @@ module Database.LSMTree.Internal.WriteBufferReader (

import Control.Monad.Class.MonadST (MonadST (..))
import Control.Monad.Class.MonadSTM (MonadSTM (..))
import Control.Monad.Class.MonadThrow (MonadCatch (..), MonadThrow (..), MonadMask)
import Control.Monad.Class.MonadThrow (MonadCatch (..), MonadMask,
MonadThrow (..))
import Control.Monad.Primitive (PrimMonad (..))
import Data.Primitive.MutVar (MutVar, newMutVar, readMutVar, writeMutVar)
import Data.Primitive.MutVar (MutVar, newMutVar, readMutVar,
writeMutVar)
import Data.Primitive.PrimVar
import qualified Data.Vector as V
import Data.Word (Word16)
import Database.LSMTree.Internal.BlobFile (BlobFile, openBlobFile)
import qualified Database.LSMTree.Internal.BlobFile as BlobFile
import Database.LSMTree.Internal.BlobRef (RawBlobRef (..),
readRawBlobRef)
import qualified Database.LSMTree.Internal.Entry as E
import Database.LSMTree.Internal.Lookup (ResolveSerialisedValue)
import Database.LSMTree.Internal.MergeSchedule (addWriteBufferEntries)
import Database.LSMTree.Internal.Paths
import Database.LSMTree.Internal.RawPage
import Database.LSMTree.Internal.RunReader (Entry (..), Result (..),
mkEntryOverflow, readDiskPage, readOverflowPages,
toFullEntry)
import Database.LSMTree.Internal.Serialise (SerialisedValue)
import Database.LSMTree.Internal.WriteBuffer (WriteBuffer)
import qualified Database.LSMTree.Internal.WriteBuffer as WB
import Database.LSMTree.Internal.WriteBufferBlobs (WriteBufferBlobs)
import qualified Database.LSMTree.Internal.WriteBufferBlobs as WBB
import qualified System.FS.API as FS
import System.FS.API (HasFS)
import qualified System.FS.BlockIO.API as FS
import System.FS.BlockIO.API (HasBlockIO)
import Database.LSMTree.Internal.RunReader (readDiskPage, Result (..), Entry (..), mkEntryOverflow, readOverflowPages, toFullEntry)
import Database.LSMTree.Internal.Serialise (SerialisedValue)
import Database.LSMTree.Internal.BlobRef (RawBlobRef (..), readRawBlobRef)
import Database.LSMTree.Internal.BlobFile (BlobFile, openBlobFile)
import Database.LSMTree.Internal.WriteBuffer (WriteBuffer)
import qualified Data.Vector as V
import qualified Database.LSMTree.Internal.WriteBuffer as WB
import qualified Database.LSMTree.Internal.WriteBufferBlobs as WBB
import Database.LSMTree.Internal.Lookup (ResolveSerialisedValue)
import Database.LSMTree.Internal.MergeSchedule (addWriteBufferEntries)
import qualified Database.LSMTree.Internal.BlobFile as BlobFile
import Database.LSMTree.Internal.WriteBufferBlobs (WriteBufferBlobs)

{-# SPECIALISE
readWriteBuffer ::
Expand Down
13 changes: 6 additions & 7 deletions test/Test/Database/LSMTree/Internal/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ module Test.Database.LSMTree.Internal.Run (
tests,
) where

import Control.Exception (bracket, bracket_)
import Control.Monad (when)
import Control.RefCount (RefCount (..), readRefCount)
import Control.TempRegistry (withTempRegistry)
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Short as SBS
import Data.Coerce (coerce)
import Data.Foldable (for_)
import qualified Data.Map as M
import qualified Data.Map.Strict as Map
import Data.Maybe (fromJust)
Expand All @@ -36,8 +39,8 @@ import Database.LSMTree.Internal.WriteBuffer (WriteBuffer)
import qualified Database.LSMTree.Internal.WriteBuffer as WB
import Database.LSMTree.Internal.WriteBufferBlobs (WriteBufferBlobs)
import qualified Database.LSMTree.Internal.WriteBufferBlobs as WBB
import Database.LSMTree.Internal.WriteBufferWriter
(writeWriteBuffer)
import Database.LSMTree.Internal.WriteBufferReader (readWriteBuffer)
import Database.LSMTree.Internal.WriteBufferWriter (writeWriteBuffer)
import qualified FormatPage as Proto
import System.FilePath
import qualified System.FS.API as FS
Expand All @@ -51,10 +54,6 @@ import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertEqual, testCase, (@=?), (@?))
import Test.Tasty.QuickCheck
import Test.Util.FS (propNoOpenHandles, withSimHasBlockIO)
import Database.LSMTree.Internal.WriteBufferReader (readWriteBuffer)
import Control.Monad (when)
import Data.Foldable (for_)
import Control.Exception (bracket, bracket_)


tests :: TestTree
Expand Down Expand Up @@ -234,7 +233,7 @@ prop_WriteAndOpen fs hbio wb =

-- | Writing and loading a 'WriteBuffer' gives the same in-memory
-- representation as the original run.
prop_WriteAndOpenWriteBuffer ::
prop_WriteAndOpenWriteBuffer ::
FS.HasFS IO h
-> FS.HasBlockIO IO h
-> RunData KeyForIndexCompact SerialisedValue SerialisedBlob
Expand Down

0 comments on commit eb55cf0

Please sign in to comment.