def owner.snapshot.open.available
mylsm-lsm-store@0.6.0.1 · src/scan/Snapshot.bend:507
import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as Snapshot
import Base
507def owner.snapshot.open.available(
508 allocator: ResourceIdAllocator,
509 reservations: Registry,
510 snapshots: List<&2, SnapshotResource>,
511 cursors: List<&2, CursorResource>,
512 generation: Nat,
513 requests: Nat & Nat,
514 limits: Nat & Nat
515) -> OwnerOpenDecision:
516 match allocator:
517 case ResourceIdAllocator{next_id, exhausted}:
518 match exhausted:
519 case True{}:
520 OwnerSnapshotRejected{OwnerRegistry{allocator, reservations,
521 snapshots, cursors}}
522 case False{}:
523 match requests:
524 case (requested_bytes, release_bytes):
525 owner.snapshot.open.budget(allocator, snapshots, cursors,
526 generation, nat.duplicate(requested_bytes), release_bytes, limits,
527 reservations)