def append.applied.decoded
mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:495
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/ByteWal.bend as ByteWal
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
495
496def append.applied.decoded(
497 +path: String,
498 lock: DbLock.Lock,
499 table: ByteMemTable.Table,
500 result: Result<&1, &1, Error, ByteWal.Batch>
501) -> Handle & Result<&1, &1, Error, Unit>:
502 match result:
503 case Fail{error}:
504 (Handle{path, lock, table, Poisoned{}, VisibleStats.Stats{0n, 0n}}, Fail{CommitUnknown{0, "invalid durable frame"}})
505 case Done{batch}:
506 (Handle{path, lock, ByteWalIo.apply.batch(table, batch), Open{}, VisibleStats.Stats{0n, 0n}}, Done{Unit{}})