src/scan/BlockOrder.bend checks
raw source on the hub · import mylsm-lsm-store@0.6.0.0/src/scan/BlockOrder.bend as BlockOrder
4 imports
import Base import ../ByteMemTable.bend as ByteMemTable import ../Keys.bend as Keys import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
Types
type State source · line 7 · raw
Type
Tracks strict ordering and the last key across decoded SST blocks.
State@valid:Bool -> @last_key:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @count:Nat -> State
Definitions
def empty source · line 11 · raw
@previous:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> State
Starts a block-order check with the preceding block's last key.
def compare.result source · line 14 · raw
@comparison:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, Cmp)) -> Bool
def compare source · line 20 · raw
@previous:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> Bool
Requires each new key to sort strictly after the preceding key.
def advance.state source · line 26 · raw
@previous:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @+count:Nat -> @valid:Bool -> @copies:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> State
def advance source · line 38 · raw
@entry:0x8f9a5c58059f5db5361cb2eddb73ec7f/src/ByteMemTable.Entry -> @state:State -> State
Validates one entry and retains its key as the next comparison boundary.
def go source · line 47 · raw
@entries:List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/ByteMemTable.Entry> -> @state:State -> State
Checks every ordered entry in a block and carries the final key forward.
def accepted source · line 54 · raw
@state:State -> Bool
Reports whether all keys seen so far were strictly ascending.