def flush.manifest

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

import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/ByteWalIo.bend as ByteWalIo
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/scan/VisibleStats.bend as VisibleStats
import mylsm-lsm-store@0.6.0.1/src/CrashPoint.bend as CrashPoint

662def flush.manifest(
663  +path: String,
664  lock: DbLock.Lock,
665  table: ByteMemTable.Table,
666  entries: List<&1, ByteMemTable.Entry>,
667  result: Result<&1, &1, U32 & String, Unit>
668) -> IO(Handle & Result<&1, &1, Error, Unit>):
669  match result:
670    case Fail{(code, message)}:
671      IO.pure(Handle & Result<&1, &1, Error, Unit>,
672        (Handle{path, lock, table, Open{}, VisibleStats.Stats{0n, 0n}}, Fail{Io{code, message}}))
673    case Done{Unit{}}:
674      do IO<Handle & Result<&1, &1, Error, Unit>>:
675        _checkpoint : Result<&1, &1, U32 & String, Unit> <-
676          CrashPoint.hit("flush.manifest_published")
677        reset : Result<&1, &1, U32 & String, Unit> <- ByteWalIo.reset_atomic(path)
678        return flush.wal.reset(path, lock, table, entries, reset)

Uses (20)

Used by (1)