src/transfer/BackupCursor.bend relies on unsafe/foreign
raw source on the hub · import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursor.bend as BackupCursor
7 imports
import Base import ../ByteMemTable.bend as ByteMemTable import ../scan/VisibleCursor.bend as VisibleCursor import ./Backup.bend as Backup import ./BackupCursorPolicy.bend as Policy import ../coordinator/CursorCodec.bend as CursorCodec import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
Types
type Phase source · line 10 · raw
Data
Separates bounded record emission from footer emission and completion.
CursorBlocksPhase
CursorFinishedPhase
type Stream source · line 16 · raw
Type
Tracks one visible cursor and no more than one pending export block.
Stream@phase:Phase -> @cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @pending_count:Nat -> @seen:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> Stream
type Step source · line 23 · raw
Type
Returns a bounded backup chunk, terminal completion, or a validation error.
Chunk@stream:Stream -> @bytes:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> Step
Continue@stream:Stream -> Step
EndStep
Failure@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @error:0xdd46804cd6318755b753109f15ff3725/src/transfer/Backup.Error -> Step
Definitions
def start.ready source · line 30 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @entry_count:U32 -> @expected:Nat -> @block_count:U32 -> @header:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> Step
Initializes the bounded cursor stream after encoding its header.
def start.count source · line 40 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @entries:Pair(U32, U32) -> @block_count:U32 -> @header:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> Step
def start.header source · line 51 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pair:Pair(0xdd46804cd6318755b753109f15ff3725/src/transfer/Backup.Stream, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> Step
def start.counts source · line 60 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @counts:Pair(Nat, Nat) -> Step
def start source · line 73 · raw
@cursor:0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor -> @entry_count:Nat -> Step
Emits the format header and prepares the first incremental source read.
def start.owner source · line 77 · raw
@entry_count:Nat -> Step
Initializes the same bounded encoder without a local cursor handle.
def block.written source · line 80 · raw
@result:Result<&1, &1, 0xdd46804cd6318755b753109f15ff3725/src/transfer/Backup.Error, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @seen:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @next_index:U32 -> @next_phase:Phase -> Step
def block.index.pair source · line 96 · raw
@index:U32 -> Pair(U32, U32)
def block.encoded source · line 100 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @seen:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @indexes:Pair(U32, U32) -> @count:Nat -> @next_phase:Phase -> Step
def item.full source · line 118 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @seen:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> @count:Nat -> @next_phase:Phase -> Step
def item.decided source · line 132 · raw
@decision:0xdd46804cd6318755b753109f15ff3725/src/transfer/BackupCursorPolicy.AppendDecision -> @cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> Step
def item.counted source · line 151 · raw
@entry:0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry -> @cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @seen:Nat -> @pending_count:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> @expected_copies:Pair(Nat, Nat) -> Step
def item source · line 169 · raw
@entry:0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry -> @cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @seen:Nat -> @pending_count:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> Step
Adds one cursor item without exceeding the declared total or block capacity.
def skip source · line 185 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @pending_count:Nat -> @seen:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> Step
Retains the pending block when the cursor advances over a tombstone.
def finish.decided source · line 245 · raw
@decision:0xdd46804cd6318755b753109f15ff3725/src/transfer/BackupCursorPolicy.FinishDecision -> @cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @seen:Nat -> @expected:Nat -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> Step
def finish.copied source · line 264 · raw
@cursor:Maybe<&1, 0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Cursor> -> @pending:List<&1, 0xdd46804cd6318755b753109f15ff3725/src/ByteMemTable.Entry> -> @pending_count:Nat -> @seen_copies:Pair(Nat, Nat) -> @expected_copies:Pair(Nat, Nat) -> @entry_count:U32 -> @block_count:U32 -> @block_index:U32 -> Step
def finish source · line 283 · raw
@stream:Stream -> Step
Rejects early cursor end; emits a final partial block before the footer.
def advance.active source · line 293 · raw
@stream:Stream -> @source_step:0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Step -> Step
def advance source · line 320 · raw
@stream:Stream -> @source_step:0xdd46804cd6318755b753109f15ff3725/src/scan/VisibleCursor.Step -> Step
Applies one result returned by the bounded visible cursor.
def advance.owner.decision source · line 324 · raw
@stream:Stream -> @decision:0xdd46804cd6318755b753109f15ff3725/src/transfer/BackupCursorPolicy.OwnerFrameDecision -> Step
Applies one frame returned by a retained owner cursor.
def advance.owner source · line 344 · raw
@stream:Stream -> @frame:0xdd46804cd6318755b753109f15ff3725/src/coordinator/CursorCodec.Frame -> Step