~/bend-docscommunity

src/scan/BlockIndexPolicy.bend checks

raw source on the hub · import mylsm-lsm-store@0.6.0.0/src/scan/BlockIndexPolicy.bend as BlockIndexPolicy

2 imports
import Base
import ../coordinator/QueuePolicy.bend as QueuePolicy

Types

type PageDecision source · line 5 · raw

Data

Describes one bounded page in a serialized block index.

Definitions

def resident_budget source · line 9 · raw

Nat

Returns the fixed bound for all resident serialized-index buffers.

def buffer_copies source · line 13 · raw

Nat

Counts the input buffer, positional-read assembly, and two hash inputs.

def max_bytes source · line 17 · raw

Nat

Bounds one serialized-index read so its live copies fit the resident budget.

def max_entries source · line 21 · raw

Nat

Computes the number of entries that fit beside one page header.

def max_blocks source · line 25 · raw

Nat

Returns the maximum entries that fit in a page-sized index span.

def resident_metadata_bytes source · line 29 · raw

@page_bytes:Nat -> Nat

Counts all bounded resident copies of one serialized-index read.

def accepts source · line 33 · raw

@entries:Nat -> Bool

Accepts one page only when it fits the resident budget.

def read_bytes.limit source · line 37 · raw

@limit:Nat -> @remaining:Nat -> Nat

Bounds one positional index read without restricting the total index size.

def read_bytes source · line 41 · raw

@remaining:Nat -> Nat

Applies the resident page limit to one positional index read.

def contains source · line 45 · raw

@block_count:Nat -> @index:Nat -> Bool

Accepts a block ordinal only when a serialized index contains that block.

def entry_valid.copies source · line 49 · raw

@offsets:Pair(Nat, Nat) -> @data_length:Nat -> @index_offset:Nat -> Bool

Combines independent offset copies to validate the complete block interval.

def entry_valid source · line 60 · raw

@data_offset:Nat -> @data_length:Nat -> @index_offset:Nat -> Bool

Accepts a block range only when it stays between the header and index.

def page.parts source · line 64 · raw

@firsts:Pair(Nat, Nat) -> @entries:Nat -> PageDecision

def page source · line 70 · raw

@first:Nat -> @entries:Nat -> PageDecision

Selects a fixed-budget index page; a zero count marks the terminal position.