~/bend-docscommunity

src/LogicalKey.bend checks

raw source on the hub · import 0x876fb95e9d05a7c35ecfcf6d39b99754/src/LogicalKey.bend as LogicalKey

1 import
import Base

Types

type LogicalKey source · line 5 · raw

Data

Logical keys and the physical MyLSM key layout. All keys are ASCII with "/" separators so prefix scan stays possible at the storage layer.

Definitions

def encode_logical_key source · line 9 · raw

@logical_key:LogicalKey -> String

Renders a key as "namespace/record".

def build_object_storage_key source · line 15 · raw

@content_hash:String -> String

Addresses a content-addressed object by its hash.

def build_tree_storage_key source · line 19 · raw

@tree_hash_value:String -> String

Addresses a persisted state tree by its hash.

def build_commit_storage_key source · line 23 · raw

@commit_identifier:String -> String

Addresses a persisted commit by its identifier.

def build_index_storage_key source · line 27 · raw

@namespace_name:String -> @record_identifier:String -> @commit_identifier:String -> String

Addresses one versioned index entry: value hash or TOMBSTONE.

def build_stage_storage_key source · line 31 · raw

@session_identifier:String -> @namespace_name:String -> @record_identifier:String -> String

Addresses one uncommitted staged value.

def build_version_index_key source · line 35 · raw

@combined_key:String -> @commit_identifier:String -> String

Same version-index layout for callers holding "namespace/record" as one string.

def build_stage_storage_key_combined source · line 39 · raw

@session_identifier:String -> @combined_key:String -> String

Same stage layout for callers holding "namespace/record" as one string.

def split_scan source · line 43 · raw

@remaining_text:String -> @namespace_accum:String -> LogicalKey

Scans for the first "/"; the head match is on a pattern-bound variable.

def split_combined_key source · line 55 · raw

@combined_key:String -> LogicalKey

Inverse of encode_logical_key: splits at the FIRST "/".