def db_write

mylsm-lsm-store@0.3.2.0 · src/Db.bend:298

import mylsm-lsm-store@0.3.2.0/src/Db.bend as Db
import Base
import mylsm-lsm-store@0.3.2.0/src/Wal.bend as Wal

298def db_write(+db: Db, +batch: Wal.Batch) -> IO(Result<&1, &1, U32 & String, Db>):
299  match db:
300    case Db{dir, mem, frozen, batch_cap, bcache, levels, flushed, manifest_token, mem_count, frozen_count}:
301      match batch:
302        case Wal.Batch{muts}:
303          do IO<Result<&1, &1, U32 & String, Db>>:
304            _res : Unit <- IO.try(Unit, wal_append(dir, Wal.encode(Wal.Batch{muts})))
305            return rot_done(apply_and_rotate(muts, mem, frozen, mem_count, frozen_count), dir, batch_cap, bcache, levels, flushed, manifest_token)

Uses (15)

Used by (3)