| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index
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 ()
- readOffset :: Functor m => Index m blk h -> ChunkNo -> RelativeSlot -> m (Maybe SecondaryOffset)
- readEntry :: Functor m => Index m blk h -> ChunkNo -> IsEBB -> SecondaryOffset -> m (Entry blk, BlockSize)
- fileBackedIndex :: forall m blk h. (ConvertRawHash blk, MonadCatch m) => HasFS m h -> ChunkInfo -> Index m blk h
- cachedIndex :: forall m blk h. (IOLike m, ConvertRawHash blk, StandardHash blk) => HasFS m h -> ResourceRegistry m -> Tracer m TraceCacheEvent -> CacheConfig -> ChunkInfo -> ChunkNo -> m (Index m blk h)
- data CacheConfig = CacheConfig {}
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
| |
Instances
readOffset :: Functor m => Index m blk h -> ChunkNo -> RelativeSlot -> m (Maybe SecondaryOffset) Source #
See readOffset.
readEntry :: Functor m => Index m blk h -> ChunkNo -> IsEBB -> SecondaryOffset -> m (Entry blk, BlockSize) Source #
See readEntry.
File-backed index
fileBackedIndex :: forall m blk h. (ConvertRawHash blk, MonadCatch m) => HasFS m h -> ChunkInfo -> Index m blk h Source #
Cached index
Arguments
| :: forall m blk h. (IOLike m, ConvertRawHash blk, StandardHash 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.
data CacheConfig Source #
Constructors
| CacheConfig | |
Fields
| |
Instances
| Eq CacheConfig Source # | |
| Show CacheConfig Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache Methods showsPrec :: Int -> CacheConfig -> ShowS # show :: CacheConfig -> String # showList :: [CacheConfig] -> ShowS # | |