lsm-tree-0.1.0.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.LSMTree.Internal.BlobFile

Synopsis

Documentation

data BlobFile m h Source #

A handle to a file containing blobs.

This is a reference counted object. Upon finalisation, the file is closed and deleted.

Constructors

BlobFile 

Instances

Instances details
RefCounted m (BlobFile m h) Source # 
Instance details

Defined in Database.LSMTree.Internal.BlobFile

Show (BlobFile m h) Source # 
Instance details

Defined in Database.LSMTree.Internal.BlobFile

Methods

showsPrec :: Int -> BlobFile m h -> ShowS #

show :: BlobFile m h -> String #

showList :: [BlobFile m h] -> ShowS #

NFData h => NFData (BlobFile m h) Source # 
Instance details

Defined in Database.LSMTree.Internal.BlobFile

Methods

rnf :: BlobFile m h -> () #

data BlobSpan Source #

The location of a blob inside a blob file.

Constructors

BlobSpan 

Instances

Instances details
Show BlobSpan Source # 
Instance details

Defined in Database.LSMTree.Internal.BlobFile

NFData BlobSpan Source # 
Instance details

Defined in Database.LSMTree.Internal.BlobFile

Methods

rnf :: BlobSpan -> () #

Eq BlobSpan Source # 
Instance details

Defined in Database.LSMTree.Internal.BlobFile

openBlobFile :: (PrimMonad m, MonadCatch m) => HasCallStack => HasFS m h -> FsPath -> OpenMode -> m (Ref (BlobFile m h)) Source #

Open the given file to make a BlobFile. The finaliser will close and delete the file.

REF: the resulting reference must be released once it is no longer used.

ASYNC: this should be called with asynchronous exceptions masked because it allocates/creates resources.

writeBlob :: (MonadThrow m, PrimMonad m) => HasFS m h -> Ref (BlobFile m h) -> SerialisedBlob -> Word64 -> m () Source #