MigrateIo.table.walk.go: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend as MigrateIo Lines 242-327 of mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&start_line=242&end_line=327 import Base import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable import mylsm-lsm-store@0.6.0.1/src/SstReadPolicy.bend as SstReadPolicy import mylsm-lsm-store@0.6.0.1/src/coordinator/QueuePolicy.bend as QueuePolicy def table.walk.go(fuel: Nat, state: LegacyTableWalk) -> IO(TableValidation): match fuel: case 0n: match state: case LegacyLevels{lock, _, release_path, _, _, _, _, records}: table.finished(lock, release_path, Fail{ResourceLimit{}}) case LegacyPath{lock, _, release_path, _, _, _, _, _, _, records}: table.finished(lock, release_path, Fail{ResourceLimit{}}) case LegacyNames{lock, _, release_path, _, _, _, _, _, _, records}: table.finished(lock, release_path, Fail{ResourceLimit{}}) case LegacySize{lock, _, release_path, _, _, _, _, _, _, _, _, records}: table.finished(lock, release_path, Fail{ResourceLimit{}}) case LegacyBudget{lock, _, release_path, _, _, _, _, _, _, _, records}: table.finished(lock, release_path, Fail{ResourceLimit{}}) case LegacyRead{lock, _, release_path, _, _, _, _, _, _, _, records}: table.finished(lock, release_path, Fail{ResourceLimit{}}) case 1n+rest: match state: case LegacyLevels{lock, read_path, release_path, levels, index, total_bytes, entries, records}: match levels: case Nil{}: table.finished.records(lock, release_path, Done{(entries, total_bytes)}, records) case Con{names, tail}: table.walk.go(rest, table.walk.level.path( QueuePolicy.nat.clone.pair(index), lock, read_path, release_path, names, tail, total_bytes, entries, records)) case LegacyPath{lock, read_path, release_path, ldir, names, levels, index, total_bytes, entries, records}: match ldir: case None{}: table.finished.records(lock, release_path, Fail{InvalidLegacyManifest{}}, records) case Some{dir}: table.walk.go(rest, LegacyNames{lock, read_path, release_path, levels, index, dir, names, total_bytes, entries, records}) case LegacyNames{lock, read_path, release_path, levels, index, dir, names, total_bytes, entries, records}: match names: case Nil{}: table.walk.go(rest, LegacyLevels{lock, read_path, release_path, levels, Nat.add(index, 1n), total_bytes, entries, records}) case Con{name, tail}: do IO: next : LegacyTableWalk <- table.walk.size( (path.clone.pair(read_path), (path.clone.pair(name), path.clone.pair(dir))), lock, release_path, levels, index, tail, total_bytes, entries, records) table.walk.go(rest, next) case LegacySize{lock, read_path, release_path, levels, index, dir, name, names, total_bytes, entries, result, records}: match result: case Fail{(code, message)}: table.finished.records(lock, release_path, Fail{HostError{code, message}}, records) case Done{size}: table.walk.go(rest, LegacyBudget{lock, read_path, release_path, levels, index, dir, name, names, entries, SstReadPolicy.total_decision(total_bytes, size, 67108864n), records}) case LegacyBudget{lock, read_path, release_path, levels, index, dir, name, names, entries, decision, records}: match decision: case SstReadPolicy.TotalRejected{}: table.finished.records(lock, release_path, Fail{ResourceLimit{}}, records) case SstReadPolicy.TotalAdmitted{next_total}: do IO: next : LegacyTableWalk <- table.walk.decode( (path.clone.pair(read_path), path.clone.pair(dir)), lock, release_path, levels, index, name, names, next_total, entries, records) table.walk.go(rest, next) case LegacyRead{lock, read_path, release_path, levels, index, dir, names, total_bytes, entries, result, records}: match result: case Fail{(code, _)}: table.finished.records(lock, release_path, Fail{table.failure(code)}, records) case Done{Sstable.Tbl{table_entries, _, _, _, _, _, _, _}}: table.walk.go(rest, table.read.next( table.entries.count.keep(table_entries), lock, read_path, release_path, levels, index, dir, names, total_bytes, entries, records)) Uses (24): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstReadPolicy.bend&name=TotalDecision https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstReadPolicy.bend&name=total_decision https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Sstable.bend&name=Table https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/coordinator/QueuePolicy.bend&name=nat.clone.pair https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=LegacyTableWalk https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=TableValidation https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=path.clone.pair https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.entries.count.keep https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.failure https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.finished https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.finished.records https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.read.next https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.walk.decode https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.walk.level.path https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend&name=table.walk.size