~/bend-docscommunity

src/coordinator/StatsCodec.bend checks

raw source on the hub · import mylsm-lsm-store@0.6.0.2/src/coordinator/StatsCodec.bend as StatsCodec

4 imports
import Base
import ../StorageBytes.bend as StorageBytes
import ./Protocol.bend as Protocol
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

Types

type Stats source · line 7 · raw

Data

Carries visible data and live owner-retention counters.

type Decision source · line 11 · raw

Data

Distinguishes a decoded statistics payload from malformed bytes.

type State source · line 16 · raw

Data

Tracks decimal fields while parsing the bounded owner counter payload.

Definitions

def decimal.length source · line 26 · raw

@value:Nat -> Nat

def payload.length source · line 29 · raw

@entries:Nat -> @payload_bytes:Nat -> @snapshots:Nat -> @retained_bytes:Nat -> @cursors:Nat -> Nat

def digit.value source · line 41 · raw

@scalar:U32 -> Nat

def digit.valid.checked source · line 44 · raw

@copies:Pair(U32, U32) -> Bool

def digit.valid.copies source · line 48 · raw

@copies:Pair(U32, Pair(U32, U32)) -> Bool

def digit.valid source · line 52 · raw

@scalar:U32 -> Bool

def separator.character source · line 55 · raw

@parser:State -> @scalar:U32 -> State

def separator source · line 78 · raw

@parser:State -> @seen:Bool -> @scalar:U32 -> State

Advances to a new stats field only after the current field has digits.

def entry.step source · line 83 · raw

@entries:Nat -> @scalar:U32 -> @is_digit:Bool -> @seen:Bool -> State

def payload.step source · line 97 · raw

@entries:Nat -> @payload_bytes:Nat -> @scalar:U32 -> @is_digit:Bool -> @seen:Bool -> State

def snapshot.step source · line 115 · raw

@entries:Nat -> @payload_bytes:Nat -> @snapshots:Nat -> @scalar:U32 -> @is_digit:Bool -> @seen:Bool -> State

def retained.step source · line 134 · raw

@entries:Nat -> @payload_bytes:Nat -> @snapshots:Nat -> @retained_bytes:Nat -> @scalar:U32 -> @is_digit:Bool -> @seen:Bool -> State

def cursor.step source · line 154 · raw

@entries:Nat -> @payload_bytes:Nat -> @snapshots:Nat -> @retained_bytes:Nat -> @cursors:Nat -> @scalar:U32 -> @is_digit:Bool -> State

def parse.step source · line 169 · raw

@state:State -> @scalar:U32 -> @is_digit:Bool -> State

def parse.step.copies source · line 186 · raw

@state:State -> @copies:Pair(U32, Pair(U32, U32)) -> State

def parse.go source · line 194 · raw

@text:String -> @state:State -> State

def finish source · line 202 · raw

@state:State -> Decision

Completes parsing only when the payload byte field contains digits.

def parse.text source · line 210 · raw

@text:String -> Decision

def parse.result source · line 213 · raw

@result:Result<&1, &1, Pair(U32, String), String> -> Decision

def parse source · line 221 · raw

@input:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> Decision

Parses a strict UTF-8 decimal pair from the owner response bytes.