def read.table.size.limited.decision

mylsm-lsm-store@0.6.0.1 · src/SstStreamIo.bend:398

import mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend as SstStreamIo
import Base
import mylsm-lsm-store@0.6.0.1/src/SstReadPolicy.bend as SstReadPolicy
import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable

398def read.table.size.limited.decision(
399  +path: String,
400  +size: Nat,
401  decision: SstReadPolicy.Decision
402) -> IO(Result<&1, &1, U32 & String, Sstable.Table>):
403  match decision:
404    case SstReadPolicy.TooSmall{}:
405      IO.pure(Result<&1, &1, U32 & String, Sstable.Table>,
406        Fail{(corruption_error_code(), "malformed SST size")})
407    case SstReadPolicy.OverBudget{}:
408      IO.pure(Result<&1, &1, U32 & String, Sstable.Table>,
409        Fail{(resource_limit_error_code(), "SST exceeds configured byte budget")})
410    case SstReadPolicy.WithinBudget{}:
411      read.table.size.checked(path, size, True{})

Uses (14)

Used by (1)