def parse.block.decoded

mylsm-lsm-store@0.6.0.1 · src/ByteSstFile.bend:1202

import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
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/Wal.bend as Wal
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

1202def parse.block.decoded(
1203  result: Result<&1, &1, Wal.Error, ByteWal.Batch>,
1204  block: Bytes.Bytes,
1205  frames: Bytes.Bytes & Bytes.Bytes,
1206  counts: Nat & Nat,
1207  payload_length: U32
1208) -> Result<&1, &1, Error, ByteMemTable.Table>:
1209  match result:
1210    case Fail{Wal.ChecksumMismatch{}}: Fail{ChecksumMismatch{}}
1211    case Fail{_}: Fail{Malformed{}}
1212    case Done{ByteWal.Batch{mutations}}:
1213      match counts:
1214        case (decode_count, stored_count):
1215          parse.block.table(decode.apply(decode_count,
1216            ByteMemTable.empty(), mutations), block, frames,
1217            U32.from_nat(stored_count), payload_length)

Uses (14)

Used by (1)