Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index
Contents
Synopsis
-
data
Index
m blk h =
Index
{
- readOffsets :: forall t. ( HasCallStack , Traversable t) => ChunkNo -> t RelativeSlot -> m (t ( Maybe SecondaryOffset ))
- readFirstFilledSlot :: HasCallStack => ChunkNo -> m ( Maybe RelativeSlot )
- openPrimaryIndex :: HasCallStack => ChunkNo -> AllowExisting -> m ( Handle h)
- appendOffsets :: forall f. ( HasCallStack , Foldable f) => Handle h -> f SecondaryOffset -> m ()
- readEntries :: forall t. ( HasCallStack , Traversable t) => ChunkNo -> t ( IsEBB , SecondaryOffset ) -> m (t ( Entry blk, BlockSize ))
- readAllEntries :: HasCallStack => SecondaryOffset -> ChunkNo -> ( Entry blk -> Bool ) -> Word64 -> IsEBB -> m [ WithBlockSize ( Entry blk)]
- appendEntry :: HasCallStack => ChunkNo -> Handle h -> WithBlockSize ( Entry blk) -> m Word64
- close :: HasCallStack => m ()
- restart :: HasCallStack => ChunkNo -> m ()
- readEntry :: Functor m => Index m blk h -> ChunkNo -> IsEBB -> SecondaryOffset -> m ( Entry blk, BlockSize )
- readOffset :: Functor m => Index m blk h -> ChunkNo -> RelativeSlot -> m ( Maybe SecondaryOffset )
- fileBackedIndex :: forall m blk h. ( ConvertRawHash blk, MonadCatch m, StandardHash blk, Typeable blk) => HasFS m h -> ChunkInfo -> Index m blk h
- data CacheConfig = CacheConfig { }
- cachedIndex :: forall m blk h. ( IOLike m, ConvertRawHash blk, StandardHash blk, Typeable blk) => HasFS m h -> ResourceRegistry m -> Tracer m TraceCacheEvent -> CacheConfig -> ChunkInfo -> ChunkNo -> m ( Index m blk h)
Index
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
|
readEntry :: Functor m => Index m blk h -> ChunkNo -> IsEBB -> SecondaryOffset -> m ( Entry blk, BlockSize ) Source #
See
readEntry
.
readOffset :: Functor m => Index m blk h -> ChunkNo -> RelativeSlot -> m ( Maybe SecondaryOffset ) Source #
See
readOffset
.
File-backed index
fileBackedIndex :: forall m blk h. ( ConvertRawHash blk, MonadCatch m, StandardHash blk, Typeable blk) => HasFS m h -> ChunkInfo -> Index m blk h Source #
Cached index
data CacheConfig Source #
Constructors
CacheConfig | |
Fields
|
Instances
Eq CacheConfig Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache Methods (==) :: CacheConfig -> CacheConfig -> Bool Source # (/=) :: CacheConfig -> CacheConfig -> Bool Source # |
|
Show CacheConfig Source # | |
Arguments
:: forall 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.