def snapshot.root.value.length.metadata.read

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

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/scan/SstCursor.bend as SstCursor
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

3015def snapshot.root.value.length.metadata.read(
3016  sst_path: Maybe<&1, String>,
3017  probe: ByteMemTable.LengthProbe,
3018  key: Bytes.Bytes
3019) -> IO(Result<&1, &1, Error, Maybe<&1, U32>>):
3020  match sst_path:
3021    case None{}:
3022      IO.pure(Result<&1, &1, Error, Maybe<&1, U32>>,
3023        snapshot.root.value.length.metadata(probe,
3024          Done{ByteWal.ValueAbsent{}}))
3025    case Some{path}:
3026      do IO<Result<&1, &1, Error, Maybe<&1, U32>>>:
3027        measured : Result<&1, &1, U32 & String, ByteWal.ValueMetadata> <-
3028          SstCursor.measure_key(path, key)
3029        return snapshot.root.value.length.metadata(probe, measured)

Uses (14)

Used by (1)