| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Database.LSMTree.Extras.Generators
Synopsis
- data WithSerialised k = WithSerialised k SerialisedKey
- data TruePageSummary k = TruePageSummary {}
- flattenLogicalPageSummary :: LogicalPageSummary k -> [TruePageSummary k]
- data LogicalPageSummary k
- = OnePageOneKey k
- | OnePageManyKeys k k
- | MultiPageOneKey k Word32
- shrinkLogicalPageSummary :: Arbitrary k => LogicalPageSummary k -> [LogicalPageSummary k]
- toAppend :: LogicalPageSummary SerialisedKey -> Append
- newtype Pages fp k = Pages {
- getPages :: [fp k]
- type TruePageSummaries k = Pages TruePageSummary k
- flattenLogicalPageSummaries :: LogicalPageSummaries k -> TruePageSummaries k
- type LogicalPageSummaries k = Pages LogicalPageSummary k
- toAppends :: SerialiseKey k => LogicalPageSummaries k -> [Append]
- labelPages :: LogicalPageSummaries k -> Property -> Property
- shrinkPages :: (Arbitrary k, Ord k) => LogicalPageSummaries k -> [LogicalPageSummaries k]
- genPages :: (Arbitrary k, Ord k) => Double -> Gen Word32 -> Double -> Gen (LogicalPageSummaries k)
- mkPages :: forall k. Ord k => Double -> Gen Word32 -> Double -> [k] -> Gen (LogicalPageSummaries k)
- pagesInvariant :: Ord k => LogicalPageSummaries k -> Bool
- newtype ChunkSize = ChunkSize Int
- chunkSizeInvariant :: ChunkSize -> Bool
- genRawBytes :: Gen RawBytes
- genRawBytesN :: Int -> Gen RawBytes
- genRawBytesSized :: Int -> Gen RawBytes
- packRawBytesPinnedOrUnpinned :: Bool -> [Word8] -> RawBytes
- newtype LargeRawBytes = LargeRawBytes RawBytes
- newtype BiasedKey = BiasedKey {}
- shrinkVec :: Prim a => (a -> [a]) -> Vector a -> [Vector a]
WithSerialised
data WithSerialised k Source #
Cache serialised keys
Also useful for failing tests that have keys as inputs, because the printed
WithSerialised values will show both keys and their serialised form.
Constructors
| WithSerialised k SerialisedKey |
Instances
A (logical/true) page
A true page
data TruePageSummary k Source #
A summary of minmax information for keys on a true/ page.
A true page corresponds directly to a disk page. See LogicalPageSummary for
contrast.
Constructors
| TruePageSummary | |
A logical page
data LogicalPageSummary k Source #
A summary of minmax information for keys on a logical/ page.
A key/operation pair can fit onto a single page, or the operation is so large that its bytes flow over into subsequent pages. A logical page makes this overflow explicit. Making these cases explicit in the representation makes generating and shrinking test cases easier.
Constructors
| OnePageOneKey k | |
| OnePageManyKeys k k | |
| MultiPageOneKey k Word32 | number of overflow pages |
Instances
shrinkLogicalPageSummary :: Arbitrary k => LogicalPageSummary k -> [LogicalPageSummary k] Source #
Sequences of (logical/true) pages
Sequences of (logical/true) pages
INVARIANT: The sequence consists of multiple pages in sorted order (keys are sorted within a page and across pages).
Instances
| (Arbitrary k, Ord k) => Arbitrary (LogicalPageSummaries k) Source # | |
Defined in Database.LSMTree.Extras.Generators Methods arbitrary :: Gen (LogicalPageSummaries k) Source # shrink :: LogicalPageSummaries k -> [LogicalPageSummaries k] Source # | |
| Functor fp => Functor (Pages fp) Source # | |
| Generic (Pages fp k2) Source # | |
| Show (fp k2) => Show (Pages fp k2) Source # | |
| NFData (fp k2) => NFData (Pages fp k2) Source # | |
Defined in Database.LSMTree.Extras.Generators | |
| type Rep (Pages fp k2) Source # | |
Defined in Database.LSMTree.Extras.Generators | |
Sequences of true pages
type TruePageSummaries k = Pages TruePageSummary k Source #
Sequences of logical pages
type LogicalPageSummaries k = Pages LogicalPageSummary k Source #
toAppends :: SerialiseKey k => LogicalPageSummaries k -> [Append] Source #
labelPages :: LogicalPageSummaries k -> Property -> Property Source #
shrinkPages :: (Arbitrary k, Ord k) => LogicalPageSummaries k -> [LogicalPageSummaries k] Source #
pagesInvariant :: Ord k => LogicalPageSummaries k -> Bool Source #
Chunking size
chunkSizeInvariant :: ChunkSize -> Bool Source #
Serialised keys/values/blobs
newtype LargeRawBytes Source #
Constructors
| LargeRawBytes RawBytes |
Instances
| Arbitrary LargeRawBytes Source # | |
Defined in Database.LSMTree.Extras.Generators | |
| Show LargeRawBytes Source # | |
Defined in Database.LSMTree.Extras.Generators Methods showsPrec :: Int -> LargeRawBytes -> ShowS # show :: LargeRawBytes -> String # showList :: [LargeRawBytes] -> ShowS # | |
| NFData LargeRawBytes Source # | |
Defined in Database.LSMTree.Extras.Generators Methods rnf :: LargeRawBytes -> () # | |
| SerialiseValue LargeRawBytes Source # | |
Defined in Database.LSMTree.Extras.Generators Methods | |
Constructors
| BiasedKey | |
Fields | |
Instances
| Arbitrary BiasedKey Source # | |
| Show BiasedKey Source # | |
| NFData BiasedKey Source # | |
Defined in Database.LSMTree.Extras.Generators | |
| Eq BiasedKey Source # | |
| Ord BiasedKey Source # | |
Defined in Database.LSMTree.Extras.Generators | |
| SerialiseKey BiasedKey Source # | |
Defined in Database.LSMTree.Extras.Generators Methods serialiseKey :: BiasedKey -> RawBytes Source # deserialiseKey :: RawBytes -> BiasedKey Source # | |
helpers
shrinkVec :: Prim a => (a -> [a]) -> Vector a -> [Vector a] Source #
Based on QuickCheck's shrinkList (behaves identically, see tests).