Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types
Synopsis
- data BlockOrEBB
- data WithBlockSize a = WithBlockSize {
- blockSize ∷ !Word32
- withoutBlockSize ∷ !a
- isBlockOrEBB ∷ BlockOrEBB → IsEBB
- data ValidationPolicy
- data ChunkFileError blk
- = ChunkErrRead ReadIncrementalErr
- | ChunkErrHashMismatch (HeaderHash blk) (ChainHash blk)
- | ChunkErrCorrupt (Point blk)
- data TraceCacheEvent
- data TraceChunkValidation blk validateTo
- = StartedValidatingChunk ChunkNo validateTo
- | ValidatedChunk ChunkNo validateTo
- | MissingChunkFile ChunkNo
- | InvalidChunkFile ChunkNo (ChunkFileError blk)
- | MissingPrimaryIndex ChunkNo
- | MissingSecondaryIndex ChunkNo
- | InvalidPrimaryIndex ChunkNo
- | InvalidSecondaryIndex ChunkNo
- | RewritePrimaryIndex ChunkNo
- | RewriteSecondaryIndex ChunkNo
- data TraceEvent blk
- = NoValidLastLocation
- | ValidatedLastLocation ChunkNo (Tip blk)
- | ChunkValidationEvent (TraceChunkValidation blk ChunkNo)
- | ChunkFileDoesntFit (ChainHash blk) (ChainHash blk)
- | Migrating Text
- | DeletingAfter (WithOrigin (Tip blk))
- | DBAlreadyClosed
- | DBClosed
- | TraceCacheEvent !TraceCacheEvent
Misc types
data BlockOrEBB Source #
Instances
data WithBlockSize a Source #
Constructors
WithBlockSize | |
Fields
|
Instances
Functor WithBlockSize Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods fmap ∷ (a → b) → WithBlockSize a → WithBlockSize b # (<$) ∷ a → WithBlockSize b → WithBlockSize a # | |||||
Foldable WithBlockSize Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods fold ∷ Monoid m ⇒ WithBlockSize m → m # foldMap ∷ Monoid m ⇒ (a → m) → WithBlockSize a → m # foldMap' ∷ Monoid m ⇒ (a → m) → WithBlockSize a → m # foldr ∷ (a → b → b) → b → WithBlockSize a → b # foldr' ∷ (a → b → b) → b → WithBlockSize a → b # foldl ∷ (b → a → b) → b → WithBlockSize a → b # foldl' ∷ (b → a → b) → b → WithBlockSize a → b # foldr1 ∷ (a → a → a) → WithBlockSize a → a # foldl1 ∷ (a → a → a) → WithBlockSize a → a # toList ∷ WithBlockSize a → [a] # null ∷ WithBlockSize a → Bool # length ∷ WithBlockSize a → Int # elem ∷ Eq a ⇒ a → WithBlockSize a → Bool # maximum ∷ Ord a ⇒ WithBlockSize a → a # minimum ∷ Ord a ⇒ WithBlockSize a → a # sum ∷ Num a ⇒ WithBlockSize a → a # product ∷ Num a ⇒ WithBlockSize a → a # | |||||
Traversable WithBlockSize Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods traverse ∷ Applicative f ⇒ (a → f b) → WithBlockSize a → f (WithBlockSize b) # sequenceA ∷ Applicative f ⇒ WithBlockSize (f a) → f (WithBlockSize a) # mapM ∷ Monad m ⇒ (a → m b) → WithBlockSize a → m (WithBlockSize b) # sequence ∷ Monad m ⇒ WithBlockSize (m a) → m (WithBlockSize a) # | |||||
Generic (WithBlockSize a) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Associated Types
Methods from ∷ WithBlockSize a → Rep (WithBlockSize a) x # to ∷ Rep (WithBlockSize a) x → WithBlockSize a # | |||||
Show a ⇒ Show (WithBlockSize a) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods showsPrec ∷ Int → WithBlockSize a → ShowS # show ∷ WithBlockSize a → String # showList ∷ [WithBlockSize a] → ShowS # | |||||
Eq a ⇒ Eq (WithBlockSize a) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods (==) ∷ WithBlockSize a → WithBlockSize a → Bool # (/=) ∷ WithBlockSize a → WithBlockSize a → Bool # | |||||
NoThunks a ⇒ NoThunks (WithBlockSize a) Source # | |||||
type Rep (WithBlockSize a) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types type Rep (WithBlockSize a) = D1 ('MetaData "WithBlockSize" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "WithBlockSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "blockSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "withoutBlockSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) |
Validation policy
data ValidationPolicy Source #
The validation policy used when opening an
ImmutableDB
.
The validation policy is used by
openDB
: the initial opening of
the database, either an empty database or a database that was previously
closed.
The recovery policy dictates which on-disk files should be validated.
Constructors
ValidateMostRecentChunk | The chunk and index files of the most recent chunk stored on disk will be validated. Prior chunk and index files are ignored, even their presence will not be checked. A Because not all files are validated, subsequent operations on the database after opening may result in unexpected errors. |
ValidateAllChunks | The chunk and index files of all chunks starting from the first one up to the last chunk stored on disk will be validated. A |
Instances
Generic ValidationPolicy Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Associated Types
Methods from ∷ ValidationPolicy → Rep ValidationPolicy x # to ∷ Rep ValidationPolicy x → ValidationPolicy # | |||||
Show ValidationPolicy Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods showsPrec ∷ Int → ValidationPolicy → ShowS # show ∷ ValidationPolicy → String # showList ∷ [ValidationPolicy] → ShowS # | |||||
Eq ValidationPolicy Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods | |||||
type Rep ValidationPolicy Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types type Rep ValidationPolicy = D1 ('MetaData "ValidationPolicy" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "ValidateMostRecentChunk" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ValidateAllChunks" 'PrefixI 'False) (U1 ∷ Type → Type)) |
Chunk file error
data ChunkFileError blk Source #
Defined here instead of in the Parser
module because TraceEvent
depends on it.
Constructors
ChunkErrRead ReadIncrementalErr | A block could not be decoded |
ChunkErrHashMismatch | The previous hash of a block did not match the hash of the previous block. |
Fields
| |
ChunkErrCorrupt (Point blk) | The integrity verification of the block with the given point returned
|
Instances
StandardHash blk ⇒ Show (ChunkFileError blk) Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods showsPrec ∷ Int → ChunkFileError blk → ShowS # show ∷ ChunkFileError blk → String # showList ∷ [ChunkFileError blk] → ShowS # | |
StandardHash blk ⇒ Eq (ChunkFileError blk) Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods (==) ∷ ChunkFileError blk → ChunkFileError blk → Bool # (/=) ∷ ChunkFileError blk → ChunkFileError blk → Bool # |
Tracing
data TraceCacheEvent Source #
The argument with type Word32
is the number of past chunk currently in
the cache.
Constructors
TraceCurrentChunkHit ChunkNo Word32 | |
TracePastChunkHit ChunkNo Word32 | |
TracePastChunkMiss ChunkNo Word32 | |
TracePastChunkEvict ChunkNo Word32 | The least recently used past chunk was evicted because the cache was full. |
TracePastChunksExpired [ChunkNo] Word32 | Past chunks were expired from the cache because they haven't been used for a while. |
Instances
Generic TraceCacheEvent Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Associated Types
Methods from ∷ TraceCacheEvent → Rep TraceCacheEvent x # to ∷ Rep TraceCacheEvent x → TraceCacheEvent # | |||||
Show TraceCacheEvent Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods showsPrec ∷ Int → TraceCacheEvent → ShowS # show ∷ TraceCacheEvent → String # showList ∷ [TraceCacheEvent] → ShowS # | |||||
Eq TraceCacheEvent Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods (==) ∷ TraceCacheEvent → TraceCacheEvent → Bool # (/=) ∷ TraceCacheEvent → TraceCacheEvent → Bool # | |||||
type Rep TraceCacheEvent Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types type Rep TraceCacheEvent = D1 ('MetaData "TraceCacheEvent" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.25.0.0-inplace" 'False) ((C1 ('MetaCons "TraceCurrentChunkHit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: C1 ('MetaCons "TracePastChunkHit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) :+: (C1 ('MetaCons "TracePastChunkMiss" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: (C1 ('MetaCons "TracePastChunkEvict" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: C1 ('MetaCons "TracePastChunksExpired" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ChunkNo]) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))))) |
data TraceChunkValidation blk validateTo Source #
Constructors
StartedValidatingChunk ChunkNo validateTo | |
ValidatedChunk ChunkNo validateTo | |
MissingChunkFile ChunkNo | |
InvalidChunkFile ChunkNo (ChunkFileError blk) | |
MissingPrimaryIndex ChunkNo | |
MissingSecondaryIndex ChunkNo | |
InvalidPrimaryIndex ChunkNo | |
InvalidSecondaryIndex ChunkNo | |
RewritePrimaryIndex ChunkNo | |
RewriteSecondaryIndex ChunkNo |
Instances
Functor (TraceChunkValidation blk) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods fmap ∷ (a → b) → TraceChunkValidation blk a → TraceChunkValidation blk b # (<$) ∷ a → TraceChunkValidation blk b → TraceChunkValidation blk a # | |||||
Generic (TraceChunkValidation blk validateTo) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Associated Types
Methods from ∷ TraceChunkValidation blk validateTo → Rep (TraceChunkValidation blk validateTo) x # to ∷ Rep (TraceChunkValidation blk validateTo) x → TraceChunkValidation blk validateTo # | |||||
(StandardHash blk, Show validateTo) ⇒ Show (TraceChunkValidation blk validateTo) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods showsPrec ∷ Int → TraceChunkValidation blk validateTo → ShowS # show ∷ TraceChunkValidation blk validateTo → String # showList ∷ [TraceChunkValidation blk validateTo] → ShowS # | |||||
(StandardHash blk, Eq validateTo) ⇒ Eq (TraceChunkValidation blk validateTo) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods (==) ∷ TraceChunkValidation blk validateTo → TraceChunkValidation blk validateTo → Bool # (/=) ∷ TraceChunkValidation blk validateTo → TraceChunkValidation blk validateTo → Bool # | |||||
type Rep (TraceChunkValidation blk validateTo) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types type Rep (TraceChunkValidation blk validateTo) = D1 ('MetaData "TraceChunkValidation" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.25.0.0-inplace" 'False) (((C1 ('MetaCons "StartedValidatingChunk" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 validateTo)) :+: C1 ('MetaCons "ValidatedChunk" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 validateTo))) :+: (C1 ('MetaCons "MissingChunkFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: (C1 ('MetaCons "InvalidChunkFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChunkFileError blk))) :+: C1 ('MetaCons "MissingPrimaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo))))) :+: ((C1 ('MetaCons "MissingSecondaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: C1 ('MetaCons "InvalidPrimaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo))) :+: (C1 ('MetaCons "InvalidSecondaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: (C1 ('MetaCons "RewritePrimaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: C1 ('MetaCons "RewriteSecondaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)))))) |
data TraceEvent blk Source #
Constructors
NoValidLastLocation | |
ValidatedLastLocation ChunkNo (Tip blk) | |
ChunkValidationEvent (TraceChunkValidation blk ChunkNo) | |
ChunkFileDoesntFit (ChainHash blk) (ChainHash blk) | The hash of the last block in the previous epoch doesn't match the previous hash of the first block in the current epoch |
Migrating Text | Performing a migration of the on-disk files |
DeletingAfter (WithOrigin (Tip blk)) | |
DBAlreadyClosed | |
DBClosed | |
TraceCacheEvent !TraceCacheEvent |
Instances
Generic (TraceEvent blk) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Associated Types
Methods from ∷ TraceEvent blk → Rep (TraceEvent blk) x # to ∷ Rep (TraceEvent blk) x → TraceEvent blk # | |||||
StandardHash blk ⇒ Show (TraceEvent blk) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods showsPrec ∷ Int → TraceEvent blk → ShowS # show ∷ TraceEvent blk → String # showList ∷ [TraceEvent blk] → ShowS # | |||||
StandardHash blk ⇒ Eq (TraceEvent blk) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types Methods (==) ∷ TraceEvent blk → TraceEvent blk → Bool # (/=) ∷ TraceEvent blk → TraceEvent blk → Bool # | |||||
type Rep (TraceEvent blk) Source # | |||||
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types type Rep (TraceEvent blk) = D1 ('MetaData "TraceEvent" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.25.0.0-inplace" 'False) (((C1 ('MetaCons "NoValidLastLocation" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ValidatedLastLocation" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tip blk)))) :+: (C1 ('MetaCons "ChunkValidationEvent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TraceChunkValidation blk ChunkNo))) :+: C1 ('MetaCons "ChunkFileDoesntFit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChainHash blk)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChainHash blk))))) :+: ((C1 ('MetaCons "Migrating" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "DeletingAfter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithOrigin (Tip blk))))) :+: (C1 ('MetaCons "DBAlreadyClosed" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "DBClosed" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "TraceCacheEvent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TraceCacheEvent)))))) |