Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CurrentChunkInfo = CurrentChunkInfo ! ChunkNo ! BlockOffset
- extractBlockComponent :: forall m blk b h. ( HasHeader blk, ReconstructNestedCtxt Header blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, IOLike m) => HasFS m h -> ChunkInfo -> ChunkNo -> CodecConfig blk -> (blk -> Bool ) -> Handle h -> WithBlockSize ( Entry blk) -> BlockComponent blk b -> m b
- getSlotInfo :: forall m blk h. ( HasCallStack , IOLike m, HasHeader blk) => ChunkInfo -> Index m blk h -> WithOrigin ( Tip blk) -> RealPoint blk -> ExceptT ( MissingBlock blk) m ( ChunkSlot , ( Entry blk, BlockSize ), SecondaryOffset )
- streamImpl :: forall m blk b. ( IOLike m, HasHeader blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, ReconstructNestedCtxt Header blk, HasCallStack ) => ImmutableDBEnv m blk -> ResourceRegistry m -> BlockComponent blk b -> StreamFrom blk -> StreamTo blk -> m ( Either ( MissingBlock blk) ( Iterator m blk b))
Documentation
data CurrentChunkInfo Source #
Auxiliary data type that combines the
currentChunk
and
currentChunkOffset
fields from
OpenState
. This is used to avoid passing
the whole state around, and moreover, it avoids issues with existential
h
type parameter.
extractBlockComponent :: forall m blk b h. ( HasHeader blk, ReconstructNestedCtxt Header blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, IOLike m) => HasFS m h -> ChunkInfo -> ChunkNo -> CodecConfig blk -> (blk -> Bool ) -> Handle h -> WithBlockSize ( Entry blk) -> BlockComponent blk b -> m b Source #
:: forall m blk h. ( HasCallStack , IOLike m, HasHeader blk) | |
=> ChunkInfo | |
-> Index m blk h | |
-> WithOrigin ( Tip blk) |
Current tip |
-> RealPoint blk | |
-> ExceptT ( MissingBlock blk) m ( ChunkSlot , ( Entry blk, BlockSize ), SecondaryOffset ) |
Get information about the block or EBB at the given slot with the given
hash. If no such block exists, because the slot is empty, it contains a block
and/or EBB with a different hash, or it is newer than the current tip, return
a
MissingBlock
.
Return the
ChunkSlot
corresponding to the block or EBB, the corresponding
entry (and
BlockSize
) from the secondary index file, and the
SecondaryOffset
of that entry.
The primary index is read to find out whether the slot is filled and what
the
SecondaryOffset
is for the slot. The secondary index is read to check
the hash and to return the
Entry
.
streamImpl :: forall m blk b. ( IOLike m, HasHeader blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, ReconstructNestedCtxt Header blk, HasCallStack ) => ImmutableDBEnv m blk -> ResourceRegistry m -> BlockComponent blk b -> StreamFrom blk -> StreamTo blk -> m ( Either ( MissingBlock blk) ( Iterator m blk b)) Source #