Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Index m blk h = Index {
- readOffsets ∷ ∀ t. (HasCallStack, Traversable t) ⇒ ChunkNo → t RelativeSlot → m (t (Maybe SecondaryOffset), Maybe (StrictSeq SecondaryOffset))
- readFirstFilledSlot ∷ HasCallStack ⇒ ChunkNo → m (Maybe RelativeSlot)
- openPrimaryIndex ∷ HasCallStack ⇒ ChunkNo → AllowExisting → m (Handle h)
- appendOffsets ∷ ∀ f. (HasCallStack, Foldable f) ⇒ Handle h → f SecondaryOffset → m ()
- readEntries ∷ ∀ 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, Maybe (StrictSeq SecondaryOffset))
- fileBackedIndex ∷ ∀ m blk h. (ConvertRawHash blk, MonadCatch m, StandardHash blk, Typeable blk) ⇒ HasFS m h → ChunkInfo → Index m blk h
- data CacheConfig = CacheConfig {}
- cachedIndex ∷ ∀ 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.
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, Maybe (StrictSeq SecondaryOffset)) Source #
See readOffset
.
File-backed index
fileBackedIndex ∷ ∀ 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 #
CacheConfig | |
|
Instances
Show CacheConfig Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache showsPrec ∷ Int → CacheConfig → ShowS # show ∷ CacheConfig → String # showList ∷ [CacheConfig] → ShowS # | |
Eq CacheConfig Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache (==) ∷ CacheConfig → CacheConfig → Bool # (/=) ∷ CacheConfig → CacheConfig → Bool # |
∷ ∀ 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.