@@ -20,7 +20,6 @@ module Database.LSMTree.Internal.Config (
2020 -- * Fence pointer index
2121 , FencePointerIndexType (.. )
2222 , indexTypeForRun
23- , serialiseKeyMinimalSize
2423 -- * Disk cache policy
2524 , DiskCachePolicy (.. )
2625 , diskCachePolicyForLevel
@@ -36,11 +35,9 @@ import Database.LSMTree.Internal.Index (IndexType)
3635import qualified Database.LSMTree.Internal.Index as Index
3736 (IndexType (Compact , Ordinary ))
3837import qualified Database.LSMTree.Internal.MergingRun as MR
39- import qualified Database.LSMTree.Internal.RawBytes as RB
4038import Database.LSMTree.Internal.Run (RunDataCaching (.. ))
4139import Database.LSMTree.Internal.RunAcc (RunBloomFilterAlloc (.. ))
4240import Database.LSMTree.Internal.RunBuilder (RunParams (.. ))
43- import Database.LSMTree.Internal.Serialise.Class (SerialiseKey (.. ))
4441
4542newtype LevelNo = LevelNo Int
4643 deriving stock (Show , Eq , Ord )
@@ -321,12 +318,11 @@ data FencePointerIndexType =
321318 | {- |
322319 Compact indexes are designed for the case where the keys in the database are uniformly distributed, e.g., when the keys are hashes.
323320
324- When using a compact index, the 'Database.LSMTree.Internal.Serialise.Class.serialiseKey' function must satisfy the following additional law :
321+ When using a compact index, some requirements apply to serialised keys :
325322
326- [Minimal size]
327- @'Database.LSMTree.Internal.RawBytes.size' ('Database.LSMTree.Internal.Serialise.Class.serialiseKey' x) >= 8@
328-
329- Use 'serialiseKeyMinimalSize' to test this law.
323+ * keys must be uniformly distributed;
324+ * keys can be of variable length;
325+ * keys less than 8 bytes (64bits) are padded with zeros (in LSB position).
330326 -}
331327 CompactIndex
332328 deriving stock (Eq , Show )
@@ -339,10 +335,6 @@ indexTypeForRun :: FencePointerIndexType -> IndexType
339335indexTypeForRun CompactIndex = Index. Compact
340336indexTypeForRun OrdinaryIndex = Index. Ordinary
341337
342- -- | Test the __Minimal size__ law for the 'CompactIndex' option.
343- serialiseKeyMinimalSize :: SerialiseKey k => k -> Bool
344- serialiseKeyMinimalSize x = RB. size (serialiseKey x) >= 8
345-
346338{- ------------------------------------------------------------------------------
347339 Disk cache policy
348340-------------------------------------------------------------------------------}
0 commit comments