~/bend-docscommunity

src/SstFileV2.bend fails

raw source on the hub · import mylsm-lsm-store@0.3.1.0/src/SstFileV2.bend as SstFileV2

6 imports
import Base
import ./Decimal.bend as Decimal
import ./Keys.bend as Keys
import ./MemTable.bend as MemTable
import ./Sstable.bend as Sstable
import ./SstChecksum.bend as SstChecksum

Types

type Error source · line 32 · raw

Data

type Tag source · line 49 · raw

Data

type Phase source · line 53 · raw

Data

type Transition source · line 68 · raw

Data

type Decoder source · line 75 · raw

Data

type ParseResult source · line 88 · raw

Data

Definitions

def max_file_chars source · line 14 · raw

Nat

def max_entries source · line 17 · raw

Nat

def max_key_chars source · line 20 · raw

Nat

def max_value_chars source · line 23 · raw

Nat

def max_level source · line 26 · raw

Nat

def read_chunk_chars source · line 29 · raw

Nat

def entry_fragments source · line 94 · raw

@entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @acc:List<&2, String> -> List<&2, String>

def header_fragments source · line 105 · raw

@count:Nat -> @level:Nat -> List<&2, String>

def body source · line 108 · raw

@+entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> String

def serialize source · line 112 · raw

@+entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> String

def expected_char source · line 118 · raw

@ok:Bool -> @next:Phase -> @error:Error -> Transition

def decimal_error source · line 125 · raw

@error:0x0ae7ac793853e753f5f74c16e06ee078/src/Decimal.Error -> @overflow:Error -> Transition

def level_scan source · line 132 · raw

@scan:0x0ae7ac793853e753f5f74c16e06ee078/src/Decimal.Scan -> Transition

def count_scan source · line 141 · raw

@scan:0x0ae7ac793853e753f5f74c16e06ee078/src/Decimal.Scan -> Transition

def delete_key_length source · line 150 · raw

@value:Nat -> Transition

def key_length_done source · line 157 · raw

@tag:Tag -> @value:Nat -> Transition

def key_length_scan source · line 164 · raw

@tag:Tag -> @scan:0x0ae7ac793853e753f5f74c16e06ee078/src/Decimal.Scan -> Transition

def put_lengths source · line 173 · raw

@key_length:Nat -> @value_length:Nat -> Transition

def value_length_scan source · line 184 · raw

@key_length:Nat -> @scan:0x0ae7ac793853e753f5f74c16e06ee078/src/Decimal.Scan -> Transition

def tag_del source · line 193 · raw

@is_del:Bool -> Transition

def tag_put source · line 200 · raw

@is_put:Bool -> @ch:Char -> Transition

def tag_step source · line 207 · raw

@+ch:Char -> Transition

def key_last source · line 210 · raw

@tag:Tag -> @value_length:Nat -> @reversed:String -> Transition

def key_step source · line 221 · raw

@tag:Tag -> @remaining:Nat -> @value_length:Nat -> @reversed:String -> @ch:Char -> Transition

def value_step source · line 232 · raw

@key:String -> @remaining:Nat -> @reversed:String -> @ch:Char -> Transition

def checksum_step source · line 243 · raw

@+reversed:String -> @+ch:Char -> Transition

def phase_step source · line 246 · raw

@phase:Phase -> @+ch:Char -> Transition

def phase_bodies source · line 275 · raw

@phase:Phase -> Bool

def select_body source · line 284 · raw

@keeps:Bool -> @body_rev:String -> @ch:Char -> String

def decoder_next source · line 293 · raw

@phase:Phase -> @remaining:Nat -> @previous:Maybe<&2, String> -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> Decoder

def count_transition source · line 296 · raw

@count:Nat -> @previous:Maybe<&2, String> -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @body_rev:String -> @consumed:Nat -> Decoder

def ordered_entry source · line 303 · raw

@entry:0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry -> @remaining:Nat -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> Decoder

def order_decision source · line 316 · raw

@cmp:Cmp -> @entry:0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry -> @remaining:Nat -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> Decoder

def entry_transition source · line 323 · raw

@+entry:0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry -> @remaining:Nat -> @previous:Maybe<&2, String> -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> Decoder

def apply_transition source · line 332 · raw

@transition:Transition -> @remaining:Nat -> @previous:Maybe<&2, String> -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> Decoder

def decoder_step_live source · line 345 · raw

@+phase:Phase -> @remaining:Nat -> @previous:Maybe<&2, String> -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> @+ch:Char -> Decoder

def decoder_step_bounded source · line 349 · raw

@within:Bool -> @phase:Phase -> @remaining:Nat -> @previous:Maybe<&2, String> -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @declared:Nat -> @body_rev:String -> @consumed:Nat -> @ch:Char -> Decoder

def decoder_step source · line 367 · raw

@decoder:Decoder -> @ch:Char -> Decoder

def checksum_decision source · line 376 · raw

@equal:Bool -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> ParseResult

def checksum_value source · line 383 · raw

@+claimed_rev:String -> @entries:List<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/MemTable.Entry> -> @level:Nat -> @+body_rev:String -> ParseResult

def finish_decoder source · line 386 · raw

@decoder:Decoder -> ParseResult

def decode_go source · line 409 · raw

@rest:String -> @decoder:Decoder -> ParseResult

def parse_result source · line 416 · raw

@str:String -> ParseResult

def parse_wrap source · line 419 · raw

@result:ParseResult -> Maybe<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/Sstable.Table>

def parse source · line 426 · raw

@str:String -> Maybe<&2, 0x0ae7ac793853e753f5f74c16e06ee078/src/Sstable.Table>

def parser_decides source · line 430 · raw

@_result:ParseResult -> Bool

Useful pure projections for laws and streaming-state agreement.

def error_of source · line 433 · raw

@result:ParseResult -> Maybe<&2, Error>

def checksum_bad source · line 443 · raw

@err:Maybe<&2, Error> -> Bool

--- Fail-closed batch checksum verdict (Task 3) --- Any parse failure (checksum or otherwise) is a bad body: recovery treats every reject as fatal, so the batch verdict stays consistent with parse.

def checksum_ok_of source · line 451 · raw

@bad:Bool -> Bool

Invert a bad-body flag into an ok verdict.

def body_checksum_ok source · line 459 · raw

@+enc:String -> Bool

Checksum verdict over a full encoded body, reusing the production decoder.