src/scan/ByteBlockBuilder.bend checks
raw source on the hub · import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockBuilder.bend as ByteBlockBuilder
1 import
import Base
Types
type Decision source · line 4 · raw
Data
Selects appending, rollover, or rejection for an exact byte-record size.
Append@used_bytes:Nat -> Decision
StartNextBlock@record_bytes:Nat -> Decision
RecordTooLargeDecision
Definitions
def nat.clone.pair source · line 9 · raw
@+value:Nat -> Pair(Nat, Nat)
def decide.rollover source · line 12 · raw
@record_bytes:Nat -> @current_empty:Bool -> Decision
def decide.current source · line 18 · raw
@used_bytes:Nat -> @record_bytes:Nat -> @fits_current:Bool -> Decision
Chooses whether a record fits the current block without exceeding its cap.
def decide.sized.limits source · line 28 · raw
@+used_bytes:Nat -> @+record_bytes:Nat -> @limits:Pair(Nat, Nat) -> @record_fits:Bool -> Decision
def decide.sized source · line 43 · raw
@used_bytes:Nat -> @record_bytes:Nat -> @max_bytes:Nat -> @record_fits:Bool -> Decision
Rejects a record above the block cap before considering current occupancy.
def decide.with.max source · line 51 · raw
@used_bytes:Nat -> @+record_bytes:Nat -> @limits:Pair(Nat, Nat) -> Decision
def decide source · line 62 · raw
@used_bytes:Nat -> @record_bytes:Nat -> @max_bytes:Nat -> Decision
Admits, rolls over, or rejects one record using byte-exact limits.
def decide.target.placed source · line 65 · raw
@+used_bytes:Nat -> @+record_bytes:Nat -> @append:Bool -> Decision
def decide.target.sized source · line 71 · raw
@+used_bytes:Nat -> @+record_bytes:Nat -> @record_fits:Bool -> @append:Bool -> Decision
Rejects a record above the hard cap, otherwise appends or starts the next block.
def decide.target source · line 82 · raw
@+used_bytes:Nat -> @+record_bytes:Nat -> @target_bytes:Nat -> @max_bytes:Nat -> Decision
Fills blocks up to a target size while admitting any record within the hard cap.