Skip to content

Commit 34ec178

Browse files
committed
Rework LedgerDB arguments in preparation for LSM trees
1 parent 062bcc8 commit 34ec178

File tree

1 file changed

+17
-14
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2

1 file changed

+17
-14
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Args.hs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1-
{-# LANGUAGE DataKinds #-}
2-
{-# LANGUAGE DeriveAnyClass #-}
3-
{-# LANGUAGE DeriveGeneric #-}
4-
{-# LANGUAGE FlexibleInstances #-}
51
{-# LANGUAGE GADTs #-}
6-
{-# LANGUAGE MultiParamTypeClasses #-}
72
{-# LANGUAGE PolyKinds #-}
8-
{-# LANGUAGE TypeFamilies #-}
9-
{-# OPTIONS_GHC -Wno-orphans #-}
103

114
module Ouroboros.Consensus.Storage.LedgerDB.V2.Args
125
( FlavorImplSpecificTrace (..)
136
, HandleArgs (..)
7+
, HandleEnv (..)
148
, LedgerDbFlavorArgs (..)
9+
, LSMHandleArgs (..)
1510
) where
1611

17-
import Data.Void (Void)
18-
import GHC.Generics
19-
import NoThunks.Class
12+
import Data.Void
2013

21-
data LedgerDbFlavorArgs f m = V2Args HandleArgs
14+
data LedgerDbFlavorArgs f m = V2Args (HandleArgs f m)
2215

23-
data HandleArgs
16+
-- | The arguments that are needed to create a 'HandleEnv' for the different
17+
-- backends.
18+
data HandleArgs f m
2419
= InMemoryHandleArgs
25-
| LSMHandleArgs Void
26-
deriving (Generic, NoThunks)
20+
| LSMHandleArgs (LSMHandleArgs f m)
21+
22+
data LSMHandleArgs f m = LSMArgs Void
23+
24+
-- | The environment used to create new handles
25+
data HandleEnv m
26+
= InMemoryHandleEnv
27+
| -- | The environment for creating LSM handles. It carries the 'Session'
28+
-- together with its resource key and the resource key of the 'HasBlockIO'.
29+
LSMHandleEnv !Void
2730

2831
data FlavorImplSpecificTrace
2932
= -- | Created a new 'LedgerTablesHandle', potentially by duplicating an

0 commit comments

Comments
 (0)