@@ -8,12 +8,11 @@ module Test.Database.LSMTree.Internal.RunReader (
8
8
import Control.RefCount
9
9
import Data.Coerce (coerce )
10
10
import qualified Data.Map as Map
11
- import Database.LSMTree.Extras.Generators
12
- (BiasedKeyForIndexCompact (.. ))
11
+ import Database.LSMTree.Extras.Generators (BiasedKey (.. ))
13
12
import Database.LSMTree.Extras.RunData
14
13
import Database.LSMTree.Internal.BlobRef
15
14
import Database.LSMTree.Internal.Entry (Entry )
16
- import qualified Database.LSMTree.Internal.Index as Index (IndexType (Compact ))
15
+ import qualified Database.LSMTree.Internal.Index as Index (IndexType (Ordinary ))
17
16
import Database.LSMTree.Internal.Run (Run )
18
17
import qualified Database.LSMTree.Internal.RunAcc as RunAcc
19
18
import qualified Database.LSMTree.Internal.RunBuilder as RunBuilder
@@ -71,7 +70,7 @@ runParams =
71
70
RunBuilder. RunParams {
72
71
runParamCaching = RunBuilder. CacheRunData ,
73
72
runParamAlloc = RunAcc. RunAllocFixed 10 ,
74
- runParamIndex = Index. Compact
73
+ runParamIndex = Index. Ordinary
75
74
}
76
75
77
76
-- | Creating a run from a write buffer and reading from the run yields the
@@ -86,8 +85,8 @@ runParams =
86
85
prop_readAtOffset ::
87
86
FS. HasFS IO h
88
87
-> FS. HasBlockIO IO h
89
- -> RunData BiasedKeyForIndexCompact SerialisedValue SerialisedBlob
90
- -> Maybe BiasedKeyForIndexCompact
88
+ -> RunData BiasedKey SerialisedValue SerialisedBlob
89
+ -> Maybe BiasedKey
91
90
-> IO Property
92
91
prop_readAtOffset fs hbio rd offsetKey =
93
92
withRunAt fs hbio runParams (simplePath 42 ) rd' $ \ run -> do
@@ -109,15 +108,15 @@ prop_readAtOffset fs hbio rd offsetKey =
109
108
prop_readAtOffsetExisting ::
110
109
FS. HasFS IO h
111
110
-> FS. HasBlockIO IO h
112
- -> RunData BiasedKeyForIndexCompact SerialisedValue SerialisedBlob
111
+ -> RunData BiasedKey SerialisedValue SerialisedBlob
113
112
-> NonNegative Int
114
113
-> IO Property
115
114
prop_readAtOffsetExisting fs hbio rd (NonNegative index)
116
115
| null kops = pure discard
117
116
| otherwise =
118
117
prop_readAtOffset fs hbio rd (Just (keys !! (index `mod` length keys)))
119
118
where
120
- keys :: [BiasedKeyForIndexCompact ]
119
+ keys :: [BiasedKey ]
121
120
keys = coerce (fst <$> kops)
122
121
kops = Map. toList (unRunData rd)
123
122
@@ -130,8 +129,8 @@ prop_readAtOffsetExisting fs hbio rd (NonNegative index)
130
129
prop_readAtOffsetIdempotence ::
131
130
FS. HasFS IO h
132
131
-> FS. HasBlockIO IO h
133
- -> RunData BiasedKeyForIndexCompact SerialisedValue SerialisedBlob
134
- -> Maybe BiasedKeyForIndexCompact
132
+ -> RunData BiasedKey SerialisedValue SerialisedBlob
133
+ -> Maybe BiasedKey
135
134
-> IO Property
136
135
prop_readAtOffsetIdempotence fs hbio rd offsetKey =
137
136
withRunAt fs hbio runParams (simplePath 42 ) rd' $ \ run -> do
@@ -155,7 +154,7 @@ prop_readAtOffsetIdempotence fs hbio rd offsetKey =
155
154
prop_readAtOffsetReadHead ::
156
155
FS. HasFS IO h
157
156
-> FS. HasBlockIO IO h
158
- -> RunData BiasedKeyForIndexCompact SerialisedValue SerialisedBlob
157
+ -> RunData BiasedKey SerialisedValue SerialisedBlob
159
158
-> IO Property
160
159
prop_readAtOffsetReadHead fs hbio rd =
161
160
withRunAt fs hbio runParams (simplePath 42 ) rd' $ \ run -> do
0 commit comments