def Bytes.compact

mylsm-lsm-store@0.6.0.1 · mylsm.bend:750

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as RawByteDb
import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as OwnerClient
import mylsm-lsm-store@0.6.0.1/src/coordinator/ByteClient.bend as OwnerByteClient

750# Publishes a canonical byte snapshot with tombstones removed.
751def Bytes.compact(handle: Bytes.Handle) -> IO(Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>):
752  match handle:
753    case ByteHandle{raw}:
754      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
755        pair : RawByteDb.Handle & Result<&1, &1, RawByteDb.Error, Unit> <- RawByteDb.compact(raw)
756        return Bytes.flush.result(pair)
757    case RemoteByteHandle{session}:
758      do IO<Bytes.Handle & Result<&1, &1, Bytes.Error, Unit>>:
759        pair : OwnerClient.Session & Result<&1, &1, OwnerClient.Error, Unit> <-
760          OwnerByteClient.compact(session)
761        return Bytes.owner.unit.result(pair)

Uses (16)

Used by (1)