def advance.owner.decision

mylsm-lsm-store@0.6.0.1 · src/transfer/BackupCursor.bend:323

import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursor.bend as BackupCursor
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursorPolicy.bend as Policy

323# Applies one frame returned by a retained owner cursor.
324def advance.owner.decision(
325  stream: Stream,
326  decision: Policy.OwnerFrameDecision
327) -> Step:
328  match stream:
329    case Stream{CursorBlocks{}, _, pending, pending_count, seen, expected,
330        entry_count, block_count, block_index}:
331      match decision:
332        case Policy.OwnerCursorItem{key, value}:
333          item(ByteMemTable.Entry{key, Some{value}}, None{}, pending,
334            seen, pending_count, expected, entry_count, block_count,
335            block_index)
336        case Policy.OwnerCursorEnd{}:
337          finish(Stream{CursorBlocks{}, None{}, pending, pending_count,
338            seen, expected, entry_count, block_count, block_index})
339    case Stream{CursorFooter{}, cursor, pending, pending_count, seen,
340        expected, entry_count, block_count, block_index}:
341      footer(cursor, seen, expected, entry_count, block_count, block_index)
342    case Stream{CursorFinished{}, _, _, _, _, _, _, _, _}: End{}

Uses (9)

Used by (1)