Skip to content

Commit d96f464

Browse files
authored
Merge pull request #657 from IntersectMBO/wenkokke/fence-pointer-index-type
fix: rename FencePointerIndex to FencePointerIndexType
2 parents 04a2f5e + caa555a commit d96f464

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

src-extras/Database/LSMTree/Extras/NoThunks.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ deriving anyclass instance NoThunks WriteBufferAlloc
632632
deriving stock instance Generic BloomFilterAlloc
633633
deriving anyclass instance NoThunks BloomFilterAlloc
634634

635-
deriving stock instance Generic FencePointerIndex
636-
deriving anyclass instance NoThunks FencePointerIndex
635+
deriving stock instance Generic FencePointerIndexType
636+
deriving anyclass instance NoThunks FencePointerIndexType
637637

638638
deriving stock instance Generic DiskCachePolicy
639639
deriving anyclass instance NoThunks DiskCachePolicy

src/Database/LSMTree.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module Database.LSMTree (
4848
, Common.NumEntries (..)
4949
, Common.BloomFilterAlloc (..)
5050
, Common.defaultBloomFilterAlloc
51-
, Common.FencePointerIndex (..)
51+
, Common.FencePointerIndexType (..)
5252
, Common.DiskCachePolicy (..)
5353
, Common.MergeSchedule (..)
5454
, Common.defaultMergeSchedule

src/Database/LSMTree/Common.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module Database.LSMTree.Common (
5353
, Internal.NumEntries (..)
5454
, Internal.BloomFilterAlloc (..)
5555
, Internal.defaultBloomFilterAlloc
56-
, Internal.FencePointerIndex (..)
56+
, Internal.FencePointerIndexType (..)
5757
, Internal.DiskCachePolicy (..)
5858
, Internal.MergeSchedule (..)
5959
, Internal.defaultMergeSchedule

src/Database/LSMTree/Internal/Config.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module Database.LSMTree.Internal.Config (
2424
, defaultBloomFilterAlloc
2525
, bloomFilterAllocForLevel
2626
-- * Fence pointer index
27-
, FencePointerIndex (..)
27+
, FencePointerIndexType (..)
2828
, indexTypeForRun
2929
-- * Disk cache policy
3030
, DiskCachePolicy (..)
@@ -71,7 +71,7 @@ data TableConfig = TableConfig {
7171
-- applications.
7272
, confWriteBufferAlloc :: !WriteBufferAlloc
7373
, confBloomFilterAlloc :: !BloomFilterAlloc
74-
, confFencePointerIndex :: !FencePointerIndex
74+
, confFencePointerIndex :: !FencePointerIndexType
7575
-- | The policy for caching key\/value data from disk in memory.
7676
, confDiskCachePolicy :: !DiskCachePolicy
7777
, confMergeSchedule :: !MergeSchedule
@@ -240,7 +240,7 @@ bloomFilterAllocForLevel conf _levelNo =
240240
-------------------------------------------------------------------------------}
241241

242242
-- | Configure the type of fence pointer index.
243-
data FencePointerIndex =
243+
data FencePointerIndexType =
244244
-- | Use a compact fence pointer index.
245245
--
246246
-- Compact indexes are designed to work with keys that are large (for
@@ -263,11 +263,11 @@ data FencePointerIndex =
263263
| OrdinaryIndex
264264
deriving stock (Eq, Show)
265265

266-
instance NFData FencePointerIndex where
266+
instance NFData FencePointerIndexType where
267267
rnf CompactIndex = ()
268268
rnf OrdinaryIndex = ()
269269

270-
indexTypeForRun :: FencePointerIndex -> IndexType
270+
indexTypeForRun :: FencePointerIndexType -> IndexType
271271
indexTypeForRun CompactIndex = Index.Compact
272272
indexTypeForRun OrdinaryIndex = Index.Ordinary
273273

src/Database/LSMTree/Internal/Snapshot/Codec.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,19 @@ instance DecodeVersioned BloomFilterAlloc where
447447
(2, 1) -> AllocRequestFPR <$> decodeDouble
448448
_ -> fail ("[BloomFilterAlloc] Unexpected combination of list length and tag: " <> show (n, tag))
449449

450-
-- FencePointerIndex
450+
-- FencePointerIndexType
451451

452-
instance Encode FencePointerIndex where
452+
instance Encode FencePointerIndexType where
453453
encode CompactIndex = encodeWord 0
454454
encode OrdinaryIndex = encodeWord 1
455455

456-
instance DecodeVersioned FencePointerIndex where
456+
instance DecodeVersioned FencePointerIndexType where
457457
decodeVersioned V0 = do
458458
tag <- decodeWord
459459
case tag of
460460
0 -> pure CompactIndex
461461
1 -> pure OrdinaryIndex
462-
_ -> fail ("[FencePointerIndex] Unexpected tag: " <> show tag)
462+
_ -> fail ("[FencePointerIndexType] Unexpected tag: " <> show tag)
463463

464464
-- DiskCachePolicy
465465

src/Database/LSMTree/Monoidal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module Database.LSMTree.Monoidal (
6363
, Common.NumEntries (..)
6464
, Common.BloomFilterAlloc (..)
6565
, Common.defaultBloomFilterAlloc
66-
, Common.FencePointerIndex (..)
66+
, Common.FencePointerIndexType (..)
6767
, Common.DiskCachePolicy (..)
6868
, Common.MergeSchedule (..)
6969
, Common.defaultMergeSchedule

src/Database/LSMTree/Normal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module Database.LSMTree.Normal (
6262
, Common.NumEntries (..)
6363
, Common.BloomFilterAlloc (..)
6464
, Common.defaultBloomFilterAlloc
65-
, Common.FencePointerIndex (..)
65+
, Common.FencePointerIndexType (..)
6666
, Common.DiskCachePolicy (..)
6767
, Common.MergeSchedule (..)
6868
, Common.defaultMergeSchedule

test/Test/Database/LSMTree/Internal/Snapshot/Codec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ testAll test = [
161161
, test (Proxy @WriteBufferAlloc)
162162
, test (Proxy @NumEntries)
163163
, test (Proxy @BloomFilterAlloc)
164-
, test (Proxy @FencePointerIndex)
164+
, test (Proxy @FencePointerIndexType)
165165
, test (Proxy @DiskCachePolicy)
166166
, test (Proxy @MergeSchedule)
167167
-- SnapLevels
@@ -262,7 +262,7 @@ instance Arbitrary BloomFilterAlloc where
262262
shrink (AllocFixed x) = AllocFixed <$> shrink x
263263
shrink (AllocRequestFPR x) = AllocRequestFPR <$> shrink x
264264

265-
instance Arbitrary FencePointerIndex where
265+
instance Arbitrary FencePointerIndexType where
266266
arbitrary = elements [CompactIndex, OrdinaryIndex]
267267
shrink _ = []
268268

test/Test/Database/LSMTree/Internal/Snapshot/Codec/Golden.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import qualified Data.Vector as V
1313
import Database.LSMTree.Common (BloomFilterAlloc (..),
1414
DiskCachePolicy (..), NumEntries (..), TableConfig (..),
1515
WriteBufferAlloc (..), defaultTableConfig)
16-
import Database.LSMTree.Internal.Config (FencePointerIndex (..),
16+
import Database.LSMTree.Internal.Config (FencePointerIndexType (..),
1717
MergePolicy (..), MergeSchedule (..), SizeRatio (..))
1818
import Database.LSMTree.Internal.MergeSchedule
1919
(MergePolicyForLevel (..), NominalCredits (..),

test/Test/Database/LSMTree/StateMachine.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ instance Arbitrary R.WriteBufferAlloc where
280280
| QC.Positive x' <- QC.shrink (QC.Positive x)
281281
]
282282

283-
deriving stock instance Enum R.FencePointerIndex
284-
deriving stock instance Bounded R.FencePointerIndex
285-
instance Arbitrary R.FencePointerIndex where
283+
deriving stock instance Enum R.FencePointerIndexType
284+
deriving stock instance Bounded R.FencePointerIndexType
285+
instance Arbitrary R.FencePointerIndexType where
286286
arbitrary = QC.arbitraryBoundedEnum
287287
shrink R.OrdinaryIndex = []
288288
shrink R.CompactIndex = [R.OrdinaryIndex]

0 commit comments

Comments
 (0)