Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Database.LSMTree.Internal.BlobRef
Synopsis
- data BlobSpan = BlobSpan {
- blobSpanOffset :: !Word64
- blobSpanSize :: !Word32
- data RawBlobRef m h = RawBlobRef {
- rawBlobRefFile :: !(BlobFile m h)
- rawBlobRefSpan :: !BlobSpan
- data WeakBlobRef m h = WeakBlobRef {
- weakBlobRefFile :: !(WeakRef (BlobFile m h))
- weakBlobRefSpan :: !BlobSpan
- newtype WeakBlobRefInvalid = WeakBlobRefInvalid Int
- mkRawBlobRef :: Ref (BlobFile m h) -> BlobSpan -> RawBlobRef m h
- mkWeakBlobRef :: Ref (BlobFile m h) -> BlobSpan -> WeakBlobRef m h
- rawToWeakBlobRef :: RawBlobRef m h -> WeakBlobRef m h
- readRawBlobRef :: (MonadThrow m, PrimMonad m) => HasFS m h -> RawBlobRef m h -> m SerialisedBlob
- readWeakBlobRef :: (MonadMask m, PrimMonad m) => HasFS m h -> WeakBlobRef m h -> m SerialisedBlob
- readWeakBlobRefs :: (MonadMask m, PrimMonad m) => HasBlockIO m h -> Vector (WeakBlobRef m h) -> m (Vector SerialisedBlob)
Documentation
The location of a blob inside a blob file.
Constructors
BlobSpan | |
Fields
|
data RawBlobRef m h Source #
A raw blob reference is a reference to a blob within a blob file.
The "raw" means that it does not maintain ownership of the BlobFile
to
keep it open. Thus these are only safe to use in the context of code that
already (directly or indirectly) owns the blob file that the blob ref uses
(such as within run merging).
Thus these cannot be handed out via the API. Use WeakBlobRef
for that.
Constructors
RawBlobRef | |
Fields
|
Instances
Show (RawBlobRef m h) Source # | |
Defined in Database.LSMTree.Internal.BlobRef Methods showsPrec :: Int -> RawBlobRef m h -> ShowS # show :: RawBlobRef m h -> String # showList :: [RawBlobRef m h] -> ShowS # |
data WeakBlobRef m h Source #
A "weak" reference to a blob within a blob file. These are the ones we can return in the public API and can outlive their parent table.
They are weak references in that they do not keep the file open using a reference. So when we want to use our weak reference we have to dereference them to obtain a normal strong reference while we do the I/O to read the blob. This ensures the file is not closed under our feet.
See BlobRef
for more info.
Constructors
WeakBlobRef | |
Fields
|
Instances
Show (WeakBlobRef m h) Source # | |
Defined in Database.LSMTree.Internal.BlobRef Methods showsPrec :: Int -> WeakBlobRef m h -> ShowS # show :: WeakBlobRef m h -> String # showList :: [WeakBlobRef m h] -> ShowS # |
newtype WeakBlobRefInvalid Source #
The WeakBlobRef
now points to a blob that is no longer available.
Constructors
WeakBlobRefInvalid Int |
Instances
Exception WeakBlobRefInvalid Source # | |
Defined in Database.LSMTree.Internal.BlobRef Methods toException :: WeakBlobRefInvalid -> SomeException # fromException :: SomeException -> Maybe WeakBlobRefInvalid # | |
Show WeakBlobRefInvalid Source # | |
Defined in Database.LSMTree.Internal.BlobRef Methods showsPrec :: Int -> WeakBlobRefInvalid -> ShowS # show :: WeakBlobRefInvalid -> String # showList :: [WeakBlobRefInvalid] -> ShowS # |
mkRawBlobRef :: Ref (BlobFile m h) -> BlobSpan -> RawBlobRef m h Source #
mkWeakBlobRef :: Ref (BlobFile m h) -> BlobSpan -> WeakBlobRef m h Source #
rawToWeakBlobRef :: RawBlobRef m h -> WeakBlobRef m h Source #
Convert a RawBlobRef
to a WeakBlobRef
.
readRawBlobRef :: (MonadThrow m, PrimMonad m) => HasFS m h -> RawBlobRef m h -> m SerialisedBlob Source #
readWeakBlobRef :: (MonadMask m, PrimMonad m) => HasFS m h -> WeakBlobRef m h -> m SerialisedBlob Source #
readWeakBlobRefs :: (MonadMask m, PrimMonad m) => HasBlockIO m h -> Vector (WeakBlobRef m h) -> m (Vector SerialisedBlob) Source #