Skip to content

Commit 4711ca0

Browse files
Merge pull request #701 from IntersectMBO/wenkokke/doc-table-config
doc: document table configuration
2 parents 5220063 + 4f9132b commit 4711ca0

File tree

14 files changed

+1183
-387
lines changed

14 files changed

+1183
-387
lines changed

README.md

Lines changed: 377 additions & 82 deletions
Large diffs are not rendered by default.

bench/macro/lsm-tree-bench-wp8.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ cmdP = O.subparser $ mconcat
227227

228228
setupOptsP :: O.Parser SetupOpts
229229
setupOptsP = pure SetupOpts
230-
<*> O.option O.auto (O.long "bloom-filter-alloc" <> O.value LSM.defaultBloomFilterAlloc <> O.showDefault <> O.help "Bloom filter allocation method [AllocFixed n | AllocRequestFPR d]")
230+
<*> O.option O.auto (O.long "bloom-filter-alloc" <> O.value (LSM.confBloomFilterAlloc LSM.defaultTableConfig) <> O.showDefault <> O.help "Bloom filter allocation method [AllocFixed n | AllocRequestFPR d]")
231231

232232
runOptsP :: O.Parser RunOpts
233233
runOptsP = pure RunOpts

lsm-tree.cabal

Lines changed: 306 additions & 56 deletions
Large diffs are not rendered by default.

scripts/generate-readme.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ build-depends:
77
, pandoc ^>=3.6.4
88
, text >=2.1
99
-}
10-
{-# LANGUAGE LambdaCase #-}
10+
{-# LANGUAGE LambdaCase #-}
11+
{-# LANGUAGE OverloadedStrings #-}
1112

1213
module Main (main) where
1314

@@ -22,7 +23,7 @@ import qualified Distribution.Types.PackageDescription as PackageDescription
2223
import Distribution.Utils.ShortText (fromShortText)
2324
import System.IO (hPutStrLn, stderr)
2425
import Text.Pandoc (runIOorExplode)
25-
import Text.Pandoc.Extensions (githubMarkdownExtensions)
26+
import Text.Pandoc.Extensions (getDefaultExtensions)
2627
import Text.Pandoc.Options (ReaderOptions (..), WriterOptions (..),
2728
def)
2829
import Text.Pandoc.Readers (readHaddock)
@@ -45,6 +46,6 @@ main = do
4546
runIOorExplode $ do
4647
doc1 <- readHaddock def description
4748
let doc2 = headerShift 1 doc1
48-
writeMarkdown def{writerExtensions = githubMarkdownExtensions} doc2
49+
writeMarkdown def{writerExtensions = getDefaultExtensions "gfm"} doc2
4950
let readme = T.unlines [readmeHeaderContent, body]
5051
TIO.writeFile "README.md" readme

src/Database/LSMTree.hs

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,12 @@ module Database.LSMTree (
113113
),
114114
defaultTableConfig,
115115
MergePolicy (LazyLevelling),
116+
MergeSchedule (..),
116117
SizeRatio (Four),
117118
WriteBufferAlloc (AllocNumEntries),
118119
BloomFilterAlloc (AllocFixed, AllocRequestFPR),
119-
defaultBloomFilterAlloc,
120120
FencePointerIndexType (OrdinaryIndex, CompactIndex),
121121
DiskCachePolicy (..),
122-
MergeSchedule (..),
123122

124123
-- ** Table Configuration Overrides #table_configuration_overrides#
125124
OverrideDiskCachePolicy (..),
@@ -156,12 +155,6 @@ module Database.LSMTree (
156155
resolveValidOutput,
157156
resolveAssociativity,
158157

159-
-- * Tracer
160-
Tracer,
161-
LSMTreeTrace (..),
162-
TableTrace (..),
163-
CursorTrace (..),
164-
165158
-- * Errors #errors#
166159
SessionDirDoesNotExistError (..),
167160
SessionDirLockedError (..),
@@ -178,6 +171,24 @@ module Database.LSMTree (
178171
BlobRefInvalidError (..),
179172
CursorClosedError (..),
180173
InvalidSnapshotNameError (..),
174+
175+
-- * Traces #traces#
176+
Tracer,
177+
LSMTreeTrace (..),
178+
TableTrace (..),
179+
CursorTrace (..),
180+
MergeTrace (..),
181+
CursorId (..),
182+
TableId (..),
183+
AtLevel (..),
184+
LevelNo (..),
185+
NumEntries (..),
186+
RunNumber (..),
187+
MergePolicyForLevel (..),
188+
LevelMergeType (..),
189+
RunParams (..),
190+
RunDataCaching (..),
191+
IndexType (..),
181192
) where
182193

183194
import Control.Concurrent.Class.MonadMVar.Strict (MonadMVar)
@@ -203,17 +214,24 @@ import qualified Database.LSMTree.Internal.BlobRef as Internal
203214
import Database.LSMTree.Internal.Config
204215
(BloomFilterAlloc (AllocFixed, AllocRequestFPR),
205216
DiskCachePolicy (..), FencePointerIndexType (..),
206-
MergePolicy (..), MergeSchedule (..), SizeRatio (..),
207-
TableConfig (..), WriteBufferAlloc (..),
208-
defaultBloomFilterAlloc, defaultTableConfig,
209-
serialiseKeyMinimalSize)
217+
LevelNo (..), MergePolicy (..), MergeSchedule (..),
218+
SizeRatio (..), TableConfig (..), WriteBufferAlloc (..),
219+
defaultTableConfig, serialiseKeyMinimalSize)
210220
import Database.LSMTree.Internal.Config.Override
211221
(OverrideDiskCachePolicy (..))
222+
import Database.LSMTree.Internal.Entry (NumEntries (..))
212223
import qualified Database.LSMTree.Internal.Entry as Entry
224+
import Database.LSMTree.Internal.Merge (LevelMergeType (..))
225+
import Database.LSMTree.Internal.MergeSchedule (AtLevel (..),
226+
MergePolicyForLevel (..), MergeTrace (..))
213227
import Database.LSMTree.Internal.Paths (SnapshotName,
214228
isValidSnapshotName, toSnapshotName)
215229
import Database.LSMTree.Internal.Range (Range (..))
216230
import Database.LSMTree.Internal.RawBytes (RawBytes (..))
231+
import Database.LSMTree.Internal.RunBuilder (IndexType (..),
232+
RunDataCaching (..), RunParams (..))
233+
import Database.LSMTree.Internal.RunNumber (CursorId (..),
234+
RunNumber (..), TableId (..))
217235
import qualified Database.LSMTree.Internal.Serialise as Internal
218236
import Database.LSMTree.Internal.Serialise.Class (SerialiseKey (..),
219237
SerialiseKeyOrderPreserving, SerialiseValue (..),

0 commit comments

Comments
 (0)