@@ -7,7 +7,7 @@ import qualified Data.BloomFilter as Bloom
7
7
import Data.Foldable (traverse_ )
8
8
import Data.Map.Strict (Map )
9
9
import qualified Data.Map.Strict as Map
10
- import Data.Maybe (isJust , mapMaybe )
10
+ import Data.Maybe (isJust )
11
11
import qualified Data.Vector as V
12
12
import Database.LSMTree.Extras
13
13
import Database.LSMTree.Extras.Generators (KeyForIndexCompact )
@@ -39,9 +39,6 @@ tests = testGroup "Test.Database.LSMTree.Internal.Merge"
39
39
[ testProperty " prop_MergeDistributes" $ \ mergeType stepSize rds ->
40
40
ioPropertyWithMockFS $ \ fs hbio ->
41
41
prop_MergeDistributes fs hbio mergeType stepSize rds
42
- , testProperty " prop_MergeUnion" $ \ stepSize rds ->
43
- ioPropertyWithMockFS $ \ fs hbio ->
44
- prop_MergeUnion fs hbio stepSize rds
45
42
, testProperty " prop_AbortMerge" $ \ level stepSize rds ->
46
43
ioPropertyWithMockFS $ \ fs hbio ->
47
44
prop_AbortMerge fs hbio level stepSize rds
@@ -134,44 +131,6 @@ prop_MergeDistributes fs hbio mergeType stepSize (SmallList rds) =
134
131
, blobFileContent
135
132
)
136
133
137
- -- | Union-merging multiple runs behaves like 'Map.unionsWith' on their values
138
- -- and blobs.
139
- prop_MergeUnion ::
140
- FS. HasFS IO h ->
141
- FS. HasBlockIO IO h ->
142
- StepSize ->
143
- SmallList (RunData KeyForIndexCompact SerialisedValue SerialisedBlob ) ->
144
- IO Property
145
- prop_MergeUnion fs hbio stepSize (SmallList rds) =
146
- withRuns fs hbio (V. fromList (zip (simplePaths [10 .. ]) rds')) $ \ runs -> do
147
- (_, run) <- mergeRuns fs hbio MergeUnion (RunNumber 0 ) runs stepSize
148
-
149
- lhsKOps <- readKOps Nothing run
150
- let lhs = Map. fromList (mapMaybe (traverse getValueAndBlob) lhsKOps)
151
-
152
- -- cleanup
153
- releaseRef run
154
-
155
- return $
156
- lhs === rhs
157
- .&&. counterexample (" Deletes in " <> show lhs)
158
- (all ((/= Entry. Delete ) . snd ) lhsKOps)
159
- where
160
- rds' = fmap serialiseRunData rds
161
-
162
- rhs :: Map SerialisedKey (SerialisedValue , Maybe SerialisedBlob )
163
- rhs = Map. unionsWith resolveValueAndBlob
164
- (map (Map. mapMaybe getValueAndBlob . unRunData) rds')
165
-
166
- getValueAndBlob :: Entry. Entry v b -> Maybe (v , Maybe b )
167
- getValueAndBlob = \ case
168
- Entry. Insert v -> Just (v, Nothing )
169
- Entry. InsertWithBlob v b -> Just (v, Just b)
170
- Entry. Mupdate v -> Just (v, Nothing )
171
- Entry. Delete -> Nothing
172
-
173
- resolveValueAndBlob (v', b') (v, _) = (mappendValues v' v, b')
174
-
175
134
-- | After merging for a few steps, we can prematurely abort the merge, which
176
135
-- should clean up properly.
177
136
prop_AbortMerge ::
0 commit comments