~/bend-docscommunity

src/legacy/ManifestIo.bend relies on unsafe/foreign

raw source on the hub · import mylsm-lsm-store@0.6.0.1/src/legacy/ManifestIo.bend as ManifestIo

6 imports
import Base
import ../Manifest.bend as Manifest
import ../StorageBytes.bend as StorageBytes
import ../Fs.bend as Fs
import ../CrashPoint.bend as CrashPoint
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

Types

type ManifestReadState source · line 9 · raw

Type

Represent ManifestReadState data used by the memtable flush.

Definitions

def write_tail.chmod source · line 13 · raw

@result:Result<&1, &1, Pair(U32, String), Unit> -> @+path:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

def write_tail.fsync source · line 23 · raw

@result:Result<&1, &1, Pair(U32, String), Unit> -> @+path:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

def write_tail source · line 36 · raw

@fr:Pair(File, Result<&1, &1, Pair(U32, String), Unit>) -> @+path:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Writes the remaining bytes of a file buffer.

def write_file.opened source · line 46 · raw

@opened:Result<&1, &1, Pair(U32, String), File> -> @+path:String -> @+data:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

def write_file source · line 60 · raw

@+path:String -> @+data:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Creates and syncs one storage file.

def write_manifest.bytes.opened source · line 65 · raw

@opened:Result<&1, &1, Pair(U32, String), File> -> @+path:String -> @bytes:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Result<&1, &1, Pair(U32, String), Unit>)

def write_manifest.bytes source · line 78 · raw

@+path:String -> @bytes:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Result<&1, &1, Pair(U32, String), Unit>)

def write_manifest.encoded source · line 83 · raw

@path:String -> @encoded:Result<&1, &1, 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Error, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> IO(Result<&1, &1, Pair(U32, String), Unit>)

def write_manifest source · line 94 · raw

@path:String -> @manifest:0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Write manifest for the memtable flush.

def read_tail3 source · line 98 · raw

@fr:Pair(File, Result<&1, &1, Pair(U32, String), String>) -> IO(Result<&1, &1, Pair(U32, String), String>)

Read tail3 for the memtable flush.

def read_file.opened source · line 109 · raw

@opened:Result<&1, &1, Pair(U32, String), File> -> IO(Result<&1, &1, Pair(U32, String), String>)

Base File.read decodes each returned chunk independently. A chunk boundary can split a multi-byte UTF-8 character, so table files are read in one bounded call Reads a bounded storage file and returns its bytes.

def read_file source · line 121 · raw

@+path:String -> IO(Result<&1, &1, Pair(U32, String), String>)

Reads a bounded storage file and returns its bytes.

def mfst_parsed source · line 127 · raw

@parsed:0xdd46804cd6318755b753109f15ff3725/src/Manifest.ParseResult -> Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>

Classifies the Manifest parse result before recovery.

def manifest.read.result source · line 138 · raw

@pair:Pair(File, Result<&1, &1, Pair(U32, String), 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>) -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

def manifest.read.loop source · line 151 · raw

@fuel:Nat -> @state:ManifestReadState -> IO(Pair(File, Result<&1, &1, Pair(U32, String), 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>))

def manifest.read.size.run source · line 186 · raw

@file:File -> @+size:Nat -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

def manifest.read.size.valid source · line 191 · raw

@file:File -> @size:Nat -> @within:Bool -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

def manifest.read.size source · line 204 · raw

@file:File -> @result:Result<&1, &1, Pair(U32, String), Nat> -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

def mfst_open_error source · line 217 · raw

@missing:Bool -> @+code:U32 -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

Handle mfst open error in the memtable flush.

def mfst_opened source · line 228 · raw

@path:String -> @result:Result<&1, &1, Pair(U32, String), File> -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

Handle mfst opened in the memtable flush.

def load_mfst source · line 241 · raw

@+path:String -> IO(Result<&1, &1, Pair(U32, String), 0xdd46804cd6318755b753109f15ff3725/src/Manifest.Manifest>)

Handle load mfst in the memtable flush.

def dir_tail source · line 247 · raw

@res:Result<&1, &1, Pair(U32, String), Nat> -> @+path:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Handle dir tail in the memtable flush.

def ensure_dir source · line 255 · raw

@+path:String -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Handle ensure dir in the memtable flush.

def ldir_of source · line 261 · raw

@idx:Nat -> Maybe<&2, String>

Handle ldir of in the database recovery effects.