def flush.wal.reset

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

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/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/scan/VisibleStats.bend as VisibleStats

647# Applies the flush transition after the WAL checkpoint is durable.
648def flush.wal.reset(
649  +path: String,
650  lock: DbLock.Lock,
651  table: ByteMemTable.Table,
652  entries: List<&1, ByteMemTable.Entry>,
653  result: Result<&1, &1, U32 & String, Unit>
654) -> Handle & Result<&1, &1, Error, Unit>:
655  match result:
656    case Fail{(code, message)}:
657      (Handle{path, lock, table, Open{}, VisibleStats.Stats{0n, 0n}}, Fail{Io{code, message}})
658    case Done{Unit{}}:
659      (Handle{path, lock, ByteMemTable.empty(), Open{},
660        flush.stats.entries(entries, VisibleStats.Stats{0n, 0n})}, Done{Unit{}})

Uses (16)

Used by (1)