def snapshot.limited.admitted.paths

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

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/ByteManifest.bend as ByteManifest
import mylsm-lsm-store@0.6.0.1/src/ByteManifestIo.bend as ByteManifestIo
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as SnapshotPolicy
import mylsm-lsm-store@0.6.0.1/src/scan/VisibleStats.bend as VisibleStats

2441def snapshot.limited.admitted.paths(
2442  paths: String & String & String,
2443  lock: DbLock.Lock,
2444  table: ByteMemTable.Table,
2445  state: HandleState,
2446  base_stats: VisibleStats.Stats,
2447  decision: SnapshotPolicy.Decision
2448) -> IO(Handle & Result<&1, &1, Error, List<&1, ByteMemTable.Entry>>):
2449  match paths:
2450    case (manifest_path, (read_path, retained_path)):
2451      match decision:
2452        case SnapshotPolicy.ResourceLimit{}:
2453          IO.pure(Handle & Result<&1, &1, Error, List<&1, ByteMemTable.Entry>>,
2454            (Handle{retained_path, lock, table, state, base_stats}, Fail{ResourceLimit{}}))
2455        case SnapshotPolicy.Retained{_, _}:
2456          do IO<Handle & Result<&1, &1, Error, List<&1, ByteMemTable.Entry>>>:
2457            manifest : Result<&1, &1, ByteManifestIo.Error, ByteManifest.ManifestValue> <-
2458              ByteManifestIo.read(manifest_path ++ "/MANIFEST")
2459            snapshot.manifest.result.paths((read_path, retained_path), lock,
2460              table, state, base_stats, manifest)

Uses (21)

Used by (1)