ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index

Synopsis

Index

data Index m blk h Source #

Bundle the operations on the primary and secondary index that touch the files. This allows us to easily introduce an intermediary caching layer.

Constructors

Index 

Fields

Instances

Instances details
NoThunks (Index m blk h) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index

Methods

noThunks ∷ Context → Index m blk h → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Index m blk h → IO (Maybe ThunkInfo) #

showTypeOfProxy (Index m blk h) → String #

readEntryFunctor m ⇒ Index m blk h → ChunkNoIsEBBSecondaryOffset → m (Entry blk, BlockSize) Source #

File-backed index

fileBackedIndex ∷ ∀ m blk h. (ConvertRawHash blk, MonadCatch m, StandardHash blk, Typeable blk) ⇒ HasFS m h → ChunkInfoIndex m blk h Source #

Cached index

data CacheConfig Source #

Constructors

CacheConfig 

Fields

cachedIndex Source #

Arguments

∷ ∀ m blk h. (IOLike m, ConvertRawHash blk, StandardHash blk, Typeable blk) 
HasFS m h 
ResourceRegistry m 
→ Tracer m TraceCacheEvent 
CacheConfig 
ChunkInfo 
ChunkNo

Current chunk

→ m (Index m blk h) 

Caches the current chunk's indices as well as a number of past chunk's indices.

Spawns a background thread to expire past chunks from the cache that haven't been used for a while.