def get.manifest
mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:1359
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/VisibleStats.bend as VisibleStats
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
1359def get.manifest(
1360 +path: String,
1361 lock: DbLock.Lock,
1362 key: Bytes.Bytes,
1363 table: ByteMemTable.Table,
1364 result: Result<&1, &1, ByteManifestIo.Error, ByteManifest.ManifestValue>
1365) -> IO(Handle & Result<&1, &1, Error, Maybe<&1, Bytes.Bytes>>):
1366 match result:
1367 case Fail{ByteManifestIo.Invalid{_}}:
1368 IO.pure(Handle & Result<&1, &1, Error, Maybe<&1, Bytes.Bytes>>,
1369 (Handle{path, lock, table, Open{}, VisibleStats.Stats{0n, 0n}}, Fail{Corruption{"byte manifest validation failed"}}))
1370 case Fail{ByteManifestIo.Host{code, message}}:
1371 IO.pure(Handle & Result<&1, &1, Error, Maybe<&1, Bytes.Bytes>>,
1372 (Handle{path, lock, table, Open{}, VisibleStats.Stats{0n, 0n}}, Fail{Io{code, message}}))
1373 case Done{ByteManifest.Empty{}}:
1374 get.delta(path, lock, ByteMemTable.get(table, key))
1375 case Done{ByteManifest.GenerationEmpty{}}:
1376 get.delta(path, lock, ByteMemTable.get(table, key))
1377 case Done{ByteManifest.HasSst{}}:
1378 get.sst.probe.start(path, lock, ByteMemTable.bytes.clone(key), table)
1379 case Done{ByteManifest.GenerationSst{file_id}}:
1380 get.sst.generation.path(path.clone.pair(path), file_id, lock, table, key)