def open.locked

mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:383

import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteManifest.bend as ByteManifest
import mylsm-lsm-store@0.6.0.1/src/ByteManifestIo.bend as ByteManifestIo
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/DurableError.bend as DurableError

383# Checks for a published byte SST while retaining database ownership.
384def open.locked(
385  +path: String,
386  result: Result<&1, &1, DurableError.Error, DbLock.Lock>
387) -> IO(Result<&1, &1, Error, Handle>):
388  match result:
389    case Fail{error}:
390      IO.pure(Result<&1, &1, Error, Handle>, Fail{lock.error(error)})
391    case Done{lock}:
392      do IO<Result<&1, &1, Error, Handle>>:
393        manifest : Result<&1, &1, ByteManifestIo.Error, ByteManifest.ManifestValue> <-
394          ByteManifestIo.read(path ++ "/MANIFEST")
395        open.manifest.reclaimed(path, lock, manifest)

Uses (15)

Used by (2)