Go · Batches and Arenas

Batches and Arenas

import "github.com/unum-cloud/ustore" 1.0.0-rc.1 · 084197c4

Ask your coding agent about this page, or add the docs server to it

curl -s 'https://www.unum.cloud/docs/ustore/go/batches-and-arenas.md' | claude -p "How would this fit my code?"

Every output whose length scales with the call lands in an Arena, and the verb answers a view over it. NewArena(executor) places one where that executor computes, and NewArena(nil) on host pages, and a call rewinds it, keeping its high-water mark, so a steady loop allocates once. A view read after a later call took its arena fails as Contended. A slice or segment an accessor returned is valid only until the arena’s next call. A result kept past the next call needs the next call to take another arena. An input lying inside the arena a call rewinds is refused with StatusInvalidArgument. A Key is sixteen bytes ordered as their bytes, and KeyFromUint64 spells an integer big-endian, so integer keys order as integers.

found, err := ustore.NewArena(nil)
fetched, err := ustore.NewArena(nil)
scanned, err := database.BlobsScan(people, 100, found, nil)
for _, key := range scanned.Keys(0) {
	values, err := database.BlobsRead(people, []ustore.Key{key}, fetched, nil) // rewinds fetched, never found
	consume(values, err)
}

§ Receivers & Deferred Calls

The receiver a verb is called on chooses what it sees, where it runs and how it completes, while the verb and its arguments stay. A Database, a Transaction, a Snapshot and a cursor run their verbs on the calling goroutine, On(executor) blocks on an executor, and Deferred(executor), which cursors lack, answers a *Deferred once the call is submitted, or the refusal the binding or the library made before anything ran. A deferred call reads its slices and writes its arena until it is final, so neither may change until Wait returns. Wait blocks in ustore_outcome_wait, Status polls through ustore_outcome_status, and a Deferred dropped without either is released by the collector once its call is final.

deferred := database.Deferred(executor)
writing, err := deferred.BlobsWrite(people, []ustore.Key{ada, grace}, ustore.TapeOf("Ada", "Grace"), nil)
if err != nil {
	return err
}
_, err = writing.Wait()

reading, err := deferred.BlobsRead(people, []ustore.Key{ada, grace}, arena, nil)
values, err := reading.Wait() // or poll reading.Status() until it leaves ustore.StatusDeferred
committing, err := transaction.Deferred(executor).Commit(ustore.DurabilityBuffered)

§ Executors

An Executor is the threads that run calls, shared by any number of databases and receivers, serving one call at a time, so a call submitted while another holds it answers StatusContended. ExecutorForRam spawns threads near the NUMA nodes it names, every node for an empty list, where zero threads take seven eighths of their cores, and a nonzero scratch limit caps each thread’s scratch. ExecutorForNvme spawns the NVMe engine’s rings near the memory domains it names or the media under its Paths, and ExecutorForVram drives the GPUs of one vendor, their positions in GPUDevices or every one for none, one stream each, which it creates and destroys or adopts from the caller and destroys. Opening a database blocks, on the executor its config names or the calling goroutine, and closing an executor waits for the call holding it. An arena never outlives the executor that made it, so defer executor.Close() comes before defer arena.Close(), and an arena from NewArena(nil) lives until it is closed.

executor, err := ustore.ExecutorForRam([]int32{0}, 8, ustore.CPUClassUnknown, 0)
defer executor.Close()
people, err := ustore.DatabaseOpenRocksdb("/var/lib/people", &ustore.DatabaseOpenRocksdbConfig{Executor: executor})
arena, err := ustore.NewArena(executor)
defer arena.Close()
found, err := people.On(executor).CollectionFind(ustore.TapeOf("names"), arena)
err = executor.Drain(ustore.MoodParked)

§ Apache Arrow

The converters of c/ustore/arrow.h view an Arrow column as a call’s input in place, and export what a call wrote into an arena as a column in place, and until the column is released the arena’s next call and Close answer StatusContended:

scanned, err := database.BlobsScan(people, 100, found, nil)
var schema ustore.ArrowSchema
var array ustore.ArrowDeviceArray
if err := ustore.KeysViewToArrow(scanned.Keys(0), found, &schema, &array); err != nil {
	return err
}
defer schema.Release()
defer array.Release()

keys, err := ustore.KeysViewFromArrow(&schema, array.Array()) // the same keys, in place
columns, err := database.DocsGather(movies, keys, ustore.TapeOf("title"), []ustore.DocsFieldType{ustore.DocsFieldTypeString}, fetched)
var titles ustore.ArrowSchema
var column ustore.ArrowDeviceArray
err = ustore.DocsColumnViewToArrow(columns.Column(0), ustore.DocsFieldTypeString, fetched, &titles, &column)
defer titles.Release()
defer column.Release()

tape, err := ustore.StringsViewFromArrow(&titles, column.Array()) // the same strings, as a Tape
err = database.BlobsWrite(people, keys, tape, nil)

KeysViewFromArrow and StringsViewFromArrow read keys and strings, and KeysViewToArrow, StringsViewToArrow and DocsColumnViewToArrow write keys, strings and gathered columns.

API

Types

PhaseProgressPhaseProgress is where a plan stands: its phase, that phase's position in the plan, and its own count, laid out as ustore_phase_progress_t.
db.go:220 ↗
type PhaseProgress struct {
    Phase Phase
    Ordinal uint64
    Completed uint64
    Total uint64
}

Fields

PhasePhasePhase is the kind of work in hand.
Ordinaluint64Ordinal is this phase's position among the ones the plan runs, from zero.
Completeduint64Completed counts the units of this phase done.
Totaluint64Total counts the units of this phase in all.
ProgressCallbackProgressCallback is called with the units a long call finished so far and the units it finishes if it runs to the end; false stops it, which then fails with StatusCancelled and publishes nothing.
db.go:646 ↗
type ProgressCallback func(finished, total uint64) bool

It never runs on two threads at once, and it must not panic.

ResidencyResidency is where an arena's outputs live.
db.go:458 ↗
type Residency int32

Values

ResidencyUnknownResidencyUnknown is no residency, which only a zeroed description reads as.
ResidencyRamResidencyRam is host pages, which Go code reads in place.
ResidencyVramResidencyVram is one device's memory, which Go code reads only where its HostAccess is HostAccessReadable.
StructArenaArena is memory the library writes every output whose length scales with a call into, reused so a steady loop allocates once.3
types.go:893 ↗
type Arena struct {
    // contains filtered or unexported fields
}

Every call given an arena rewinds and refills it, so the views of its previous call end there, as they do once it is closed: their accessors panic with StatusContended, as a slice bound does, while a slice already handed out is plain memory the next call overwrites, so it is valid only until then. To keep one call's views past the next, give that call another arena. An arena serves one call at a time, and a second overlapping it fails with StatusContended. Deferred verbs view it as blocking ones do, since Close waits for every deferred call naming it.

NewArenaNewArena makes an empty arena where executor computes, host pages or the memory of its GPU, decided once; a nil executor makes host pages for calls on the calling goroutine.
types.go:902 ↗
func NewArena(executor *Executor) (*Arena, error)

Nothing is allocated until a call writes into it. An arena must not outlive the executor that made it, so Arena.Close comes before Executor.Close; one made with a nil executor lives until it is closed.

CloseClose releases the memory, waiting for every deferred call naming the arena, and ends every view over it; it comes before the Close of the executor that made the arena.
types.go:1281 ↗
func (arena *Arena) Close() error

While an Arrow export of its outputs is unreleased it fails with StatusContended and frees nothing, so a later Close retries. It is idempotent, and a closed arena must not be used again.

DescribeDescribe reports where the arena's outputs live, as the executor that made it decided.
types.go:954 ↗
func (arena *Arena) Describe() (ArenaDescription, error)
StructBlobsCursorBlobsCursor walks the keys of one collection page by page, every pull resuming past the last key the pull before it handed out.4
blobs.go:397 ↗
type BlobsCursor struct {
    BlobsCursorOn
    // contains filtered or unexported fields
}

It holds its database open, and the transaction or snapshot it reads through, until BlobsCursor.Close.

*Close× 5Close frees the walk, giving back the holds it kept.
blobs.go:497 ↗
func (cursor *BlobsCursor) Close() error

It is idempotent.

Next*NextKeys× 2NextKeys pulls up to wanted keys of the walk into arena.
blobs.go:453 ↗

Inherited from BlobsCursorOn

func (on BlobsCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Page, error)
Next*NextPairs× 2NextPairs pulls up to wanted keys of the walk with their values into arena, in one call.
blobs.go:464 ↗

Inherited from BlobsCursorOn

func (on BlobsCursor) NextNextPairs(
    wanted uint,
    arena *Arena,
) (Page, error)
*On× 12On is the receiver whose pulls block on executor.
blobs.go:410 ↗

Inherited from BlobsCursorOn

func (on BlobsCursor) On(executor *Executor) BlobsCursorOn
StructBlobsCursorOnBlobsCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a BlobsCursor, and on an executor when BlobsCursorOn.On makes it.
blobs.go:405 ↗
type BlobsCursorOn struct {
    // contains filtered or unexported fields
}
EnumCPUClassCPUClass is the CPU generation a database or an executor confines itself to; the zero value sets no ceiling.2
types.go:301 ↗
type CPUClass int32

Values

CPUClassUnknownCPUClassUnknown picks the newest class this machine runs.
CPUClassSerialCPUClassSerial is the portable floor every CPU runs.
CPUClassMonoversionedCPUClassMonoversioned is the one class of a monoversioned build.
CPUClassIntelHaswellCPUClassIntelHaswell is x86 from Intel Haswell on.
CPUClassIntelSierraCPUClassIntelSierra is x86 efficiency cores from Intel Sierra Forest on.
CPUClassIntelSkylakeCPUClassIntelSkylake is x86 server cores from Intel Skylake on.
CPUClassIntelIcelakeCPUClassIntelIcelake is x86 server cores from Intel Ice Lake on.
CPUClassAWSG2CPUClassAWSG2 is Arm from AWS Graviton 2 on.
CPUClassAppleM2CPUClassAppleM2 is Arm from Apple M2 on.
CPUClassAWSG5CPUClassAWSG5 is Arm server cores from AWS Graviton 5 on.
CPUClassAlibabaC930CPUClassAlibabaC930 is RISC-V with RVV, Zawrs and Zacas, from Alibaba's C930 on.
CPUClassIBMPower10CPUClassIBMPower10 is Power from POWER10 on.
CPUClassFromNameCPUClassFromName reads a CPU class back from the spelling CPUClass.String renders.
types.go:336 ↗
func CPUClassFromName(name string) (CPUClass, error)
StringString renders the class as the library spells it, such as "intel-haswell".
types.go:331 ↗
func (class CPUClass) String() string
StructChangesCursorChangesCursor is a feed of the changes committed to one collection after a stamp, oldest first, pinning that stamp as a snapshot does until ChangesCursor.Close.3
db.go:1810 ↗
type ChangesCursor struct {
    ChangesCursorOn
    // contains filtered or unexported fields
}
CloseClose releases the feed and the stamp it pins.
db.go:1949 ↗
func (cursor *ChangesCursor) Close() error

It is idempotent.

Next*NextKeys× 2NextKeys pulls up to wanted changes into arena: their keys, stamps and kinds.
db.go:1904 ↗

Inherited from ChangesCursorOn

func (on ChangesCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Changes, error)
Next*NextPairs× 2NextPairs pulls up to wanted changes into arena with the bytes every change carries.
db.go:1915 ↗

Inherited from ChangesCursorOn

func (on ChangesCursor) NextNextPairs(
    wanted uint,
    arena *Arena,
) (Changes, error)
StructChangesCursorOnChangesCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a ChangesCursor, or on an executor that ChangesCursorOn.On picks.
db.go:1819 ↗
type ChangesCursorOn struct {
    // contains filtered or unexported fields
}
StructDatabaseDatabase is an open database, safe to share across goroutines from open until Database.Close.38
db.go:748 ↗
type Database struct {
    DatabaseOn
    // contains filtered or unexported fields
}

Its own verbs read and write the head on the calling goroutine; DatabaseOn.On and DatabaseOn.Deferred pick an executor.

DatabaseInitRamDatabaseInitRam starts an empty database in memory alone.
db.go:793 ↗
func DatabaseInitRam(
    config *DatabaseInitRamConfig,
) (*Database, error)
DatabaseOpenLeveldbDatabaseOpenLeveldb serves a LevelDB directory in place, creating it if absent.
db.go:935 ↗
func DatabaseOpenLeveldb(
    directory string,
    config *DatabaseOpenLeveldbConfig,
) (*Database, error)
DatabaseOpenNvmeDatabaseOpenNvme serves a directory through the in-tree NVMe engine.
db.go:992 ↗
func DatabaseOpenNvme(
    directory string,
    config *DatabaseOpenNvmeConfig,
) (*Database, error)
DatabaseOpenRamDatabaseOpenRam serves directory as one in-memory image, loading it if present.
db.go:815 ↗
func DatabaseOpenRam(
    directory string,
    config *DatabaseInitRamConfig,
) (*Database, error)
DatabaseOpenRocksdbDatabaseOpenRocksdb serves a RocksDB directory in place, creating it if absent.
db.go:874 ↗
func DatabaseOpenRocksdb(
    directory string,
    config *DatabaseOpenRocksdbConfig,
) (*Database, error)
DatabaseViewNvmeDatabaseViewNvme serves the database a manifest names through the in-tree NVMe engine, read-only, writing nothing to its data directories and refusing every change with StatusReadOnly.
db.go:1050 ↗
func DatabaseViewNvme(
    directory string,
    config *DatabaseViewNvmeConfig,
) (*Database, error)
DatabaseViewRocksdbDatabaseViewRocksdb serves a RocksDB directory read-only, refusing every change with StatusReadOnly.
db.go:899 ↗
func DatabaseViewRocksdb(
    directory string,
    config *DatabaseOpenRocksdbConfig,
) (*Database, error)
CloseClose releases the database once every transaction, snapshot, cursor and ingest holding it is closed, waiting for every deferred call naming it.
db.go:767 ↗
func (database *Database) Close() error

It never flushes: commits made with DurabilityBuffered and not yet flushed are not on disk, so call DatabaseOn.Flush first. It is idempotent, and a closed database must not be used again.

Blobs*BlobsRemove× 4BlobsRemove removes keys with their values, or every key of a range per task given end keys.
db.go:202 ↗

Inherited from writes[Handle]

func (on Database) BlobsBlobsRemove(
    collections Collections,
    keys []Key,
    config *RemoveConfig,
) error
Blobs*BlobsWrite× 4BlobsWrite upserts one value per key, an empty value still being a value.
db.go:162 ↗

Inherited from writes[Handle]

func (on Database) BlobsBlobsWrite(
    collections Collections,
    keys []Key,
    values Tape,
    config *WriteConfig,
) error
ChangesCursor*ChangesCursorInit× 2ChangesCursorInit opens a feed of collection's changes committed after since, reading nothing yet and blocking whatever receiver it is called on; every pull names its own executor through On.
db.go:1831 ↗

Inherited from DatabaseOn

func (on Database) ChangesCursorChangesCursorInit(
    collection CollectionID,
    since CommitStamp,
) (*ChangesCursor, error)
*Clear× 2Clear empties every collection at once, as mode says, answering StatusContended for a drop of the collections as DatabaseOn.CollectionDrop does.
db.go:1134 ↗

Inherited from DatabaseOn

func (on Database) Clear(mode DropMode) error
Collection*CollectionCreate× 2CollectionCreate creates a collection under name holding modality; a name starting with an underscore is refused, as the engines keep their own collections there.
db.go:1380 ↗

Inherited from DatabaseOn

func (on Database) CollectionCollectionCreate(
    name string,
    modality Modality,
) (CollectionID, error)
Collection*CollectionDrop× 2CollectionDrop empties a collection of its pairs or values, or drops it whole, as mode says.
db.go:1413 ↗

Inherited from DatabaseOn

func (on Database) CollectionCollectionDrop(
    collection CollectionID,
    mode DropMode,
) error

A whole drop answers StatusContended while a snapshot is open, or on NVMe while a snapshot or a transaction is open.

*Compact× 2Compact reclaims the space that overwritten and removed data still takes, through the phases its engine runs.
db.go:1182 ↗

Inherited from DatabaseOn

func (on Database) Compact(config *CompactConfig) error
CompactPlan*CompactPlanFinish× 2CompactPlanFinish frees a plan whatever the call answers, so another compaction may open on the database, leaving the plan fresh.
db.go:1221 ↗

Inherited from DatabaseOn

func (on Database) CompactPlanCompactPlanFinish(plan *CompactPlan) error
*Deferred× 4Deferred is the receiver whose verbs submit their calls to executor.
db.go:688 ↗

Inherited from DatabaseOn

func (on Database) Deferred(executor *Executor) DatabaseDeferredOn
*Describe× 2Describe reports the engine's capabilities, isolation, CPU class and the sizes it estimates.
db.go:1104 ↗

Inherited from DatabaseOn

func (on Database) Describe() (DatabaseDescription, error)
Docs*DocsRemove× 4DocsRemove removes whole documents, or every document of a range per task given end keys.
db.go:187 ↗

Inherited from writes[Handle]

func (on Database) DocsDocsRemove(
    collections Collections,
    keys []Key,
    config *RemoveConfig,
) error
Docs*DocsWrite× 4DocsWrite writes one document or field per value, keyed by keys or, without them, by the DocsWriteConfig IDField of every document.
db.go:142 ↗

Inherited from writes[Handle]

func (on Database) DocsDocsWrite(
    collections Collections,
    keys []Key,
    values Tape,
    config *DocsWriteConfig,
) error
*Flush× 2Flush makes every buffered write durable.
db.go:1255 ↗

Inherited from DatabaseOn

func (on Database) Flush() error
GraphRemove*GraphRemoveEdges× 4GraphRemoveEdges removes edges, keeping their vertices.
db.go:254 ↗

Inherited from writes[Handle]

func (on Database) GraphRemoveGraphRemoveEdges(
    collections Collections,
    edges []Edge,
    config *WriteConfig,
) error
GraphRemove*GraphRemoveVertices× 4GraphRemoveVertices removes vertices with every edge they connect to, or every vertex of a range per task given end vertices.
db.go:351 ↗

Inherited from writes[Handle]

func (on Database) GraphRemoveGraphRemoveVertices(
    collections Collections,
    vertices []Key,
    config *GraphRemoveVerticesConfig,
) error
GraphWrite*GraphWriteEdges× 4GraphWriteEdges inserts edges, and their vertices where missing.
db.go:212 ↗

Inherited from writes[Handle]

func (on Database) GraphWriteGraphWriteEdges(
    collections Collections,
    edges []Edge,
    config *WriteConfig,
) error
GraphWrite*GraphWriteVertices× 4GraphWriteVertices inserts vertices unless present.
db.go:300 ↗

Inherited from writes[Handle]

func (on Database) GraphWriteGraphWriteVertices(
    collections Collections,
    vertices []Key,
    config *WriteConfig,
) error
Ingest*IngestInit× 2IngestInit opens an ingest into collection, whose rows arrive in order, blocking on the receiver's executor, whose memory domain holds the ingest.
db.go:1985 ↗

Inherited from DatabaseOn

func (on Database) IngestIngestInit(
    collection CollectionID,
    order IngestOrder,
) (*Ingest, error)
*On× 4On is the receiver whose verbs block on executor.
db.go:682 ↗

Inherited from DatabaseOn

func (on Database) On(executor *Executor) DatabaseOn
Pages*PagesImport× 4PagesImport replaces whole pages, one per key, with parsed markup.
db.go:84 ↗

Inherited from writes[Handle]

func (on Database) PagesPagesImport(
    collections Collections,
    keys []Key,
    values Tape,
    config *PagesImportConfig,
) error
Pages*PagesInsert× 4PagesInsert parses one fragment per task into elements of the page keys names, reporting the key every element ended up with into arena.
db.go:161 ↗

Inherited from writes[Handle]

func (on Database) PagesPagesInsert(
    collections Collections,
    keys []Key,
    values Tape,
    arena *Arena,
    config *PagesInsertConfig,
) (Inserted, error)
Pages*PagesMove× 4PagesMove moves elements with their subtrees under parents after anchors.
db.go:273 ↗

Inherited from writes[Handle]

func (on Database) PagesPagesMove(
    collections Collections,
    keys, elements []Key,
    config *PagesMoveConfig,
) error
Pages*PagesRemove× 4PagesRemove removes elements with their subtrees, or whole pages of a range per task given end keys.
db.go:220 ↗

Inherited from writes[Handle]

func (on Database) PagesPagesRemove(
    collections Collections,
    keys []Key,
    config *PagesRemoveConfig,
) error
PagesRemove*PagesRemoveAttributes× 4PagesRemoveAttributes removes one attribute of an element per task.
db.go:401 ↗

Inherited from writes[Handle]

func (on Database) PagesRemovePagesRemoveAttributes(
    collections Collections,
    keys, elements []Key,
    fields Tape,
    config *WriteConfig,
) error
PagesSet*PagesSetAttributes× 4PagesSetAttributes sets one attribute of an element per task.
db.go:359 ↗

Inherited from writes[Handle]

func (on Database) PagesSetPagesSetAttributes(
    collections Collections,
    keys, elements []Key,
    fields, values Tape,
    config *WriteConfig,
) error
Pages*PagesSplice× 4PagesSplice replaces textLengths bytes of the text of every element from textStarts with values, where a zero length only inserts and an empty value only removes.
db.go:316 ↗

Inherited from writes[Handle]

func (on Database) PagesPagesSplice(
    collections Collections,
    keys, elements []Key,
    textStarts, textLengths []uint64,
    values Tape,
    config *WriteConfig,
) error
Snapshot*SnapshotInit× 2SnapshotInit pins the head as it stands, blocking whatever receiver it is called on.
db.go:1302 ↗

Inherited from DatabaseOn

func (on Database) SnapshotSnapshotInit() (*Snapshot, error)
Strings*StringsRemove× 4StringsRemove removes strings with the keys they map onto, or every string of a range per task given end strings.
db.go:84 ↗

Inherited from writes[Handle]

func (on Database) StringsStringsRemove(
    collections Collections,
    strings Tape,
    config *StringsRemoveConfig,
) error
Strings*StringsWrite× 4StringsWrite maps every string onto one key, its value.
db.go:33 ↗

Inherited from writes[Handle]

func (on Database) StringsStringsWrite(
    collections Collections,
    strings Tape,
    values []Key,
    config *WriteConfig,
) error
Transaction*TransactionInit× 2TransactionInit begins a transaction on the head, blocking whatever receiver it is called on.
db.go:1587 ↗

Inherited from DatabaseOn

func (on Database) TransactionTransactionInit() (*Transaction, error)
StructDatabaseOnDatabaseOn is the receiver whose verbs block until their call is final, reading and writing the head: on the calling goroutine when embedded in a Database, and on an executor when DatabaseOn.On makes it.
db.go:668 ↗
type DatabaseOn struct {
    // contains filtered or unexported fields
}
StructDeferredDeferred is a submitted call, which holds its outcome and inputs until it is final, owned by the one goroutine that polls or waits on it.3
types.go:1123 ↗
type Deferred[Result any] struct {
    // contains filtered or unexported fields
}

Status polls without blocking, Wait blocks until the call is final and hands back its result, and Close waits the same way and drops it. A Deferred dropped without Wait or Close is released by the collector once the call is final, never blocking on it: until then every later collection checks it again.

CloseClose blocks until the call is final, releases its pins, and reports the call's failure.
types.go:1160 ↗
func (deferred *Deferred[Result]) Close() error

It is idempotent and safe after Wait.

StatusStatus reports StatusDeferred until the call is final, then its final status, without blocking.
types.go:1149 ↗
func (deferred *Deferred[Result]) Status() Status
WaitWait blocks until the call is final, releases its pins, then hands back its result, the same every time it is asked.
types.go:1153 ↗
func (deferred *Deferred[Result]) Wait() (Result, error)
StructDocsCursorDocsCursor walks the documents of one collection in batches of rows, every pull resuming past the last key the pull before it handed out.1
docs.go:566 ↗
type DocsCursor struct {
    DocsCursorOn
    // contains filtered or unexported fields
}
*Next× 2Next pulls batches of up to wanted rows in all into arena, each row a key and a cell of every column the cursor gathers.
docs.go:661 ↗

Inherited from DocsCursorOn

func (on DocsCursor) Next(
    wanted uint,
    arena *Arena,
) (DocsBatches, error)
StructDocsCursorOnDocsCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a DocsCursor, and on an executor when DocsCursorOn.On makes it.
docs.go:574 ↗
type DocsCursorOn struct {
    // contains filtered or unexported fields
}
StructExecutorExecutor owns the host threads, I/O rings or device stream calls run on, shared by any number of databases.5
types.go:681 ↗
type Executor struct {
    // contains filtered or unexported fields
}

A nil *Executor is the null executor: it owns nothing, and every call handed it runs on the calling goroutine. An executor serves one call at a time, while databases stay freely concurrent; a second call finding it held finishes StatusContended, and nothing queues.

ExecutorForNvmeExecutorForNvme spawns threads for the NVMe engine, each submitting and polling its own I/O ring, placed with their staging on memoryDomains, the first placing the threads, or on the domain nvme.Paths share for an empty list.
types.go:730 ↗
func ExecutorForNvme(
    memoryDomains []int32,
    nvme NvmeOptions,
    threads uint,
    cpuClassCeiling CPUClass,
    scratchLimit uint64,
) (*Executor, error)

Zero threads takes the fewest hardware queues of the disks under the paths, capped by the cores, and a zero scratchLimit takes 16 GiB per thread.

ExecutorForRamExecutorForRam spawns host threads for the RAM, RocksDB and LevelDB engines, interleaved across the compute domains local to memoryDomains, every domain the process may allocate on for an empty list.
types.go:690 ↗
func ExecutorForRam(
    memoryDomains []int32,
    threads uint,
    cpuClassCeiling CPUClass,
    scratchLimit uint64,
) (*Executor, error)

Zero threads takes seven eighths of the cores those domains carry, and a cpuClassCeiling the CPU lacks narrows the pick rather than refusing it. Every call's staging carves from each thread's scratch, capped at scratchLimit, where zero takes 16 GiB.

ExecutorForVramExecutorForVram opens one non-blocking stream on every named device, its position in the listing of GPUDevices, all of one vendor, created with the executor and destroyed when it closes, all of them driven by the one goroutine that calls the verbs, so that a deferred call on it is final once it returns.
types.go:771 ↗
func ExecutorForVram(
    devices []int32,
    gpuClassCeiling GPUClass,
    streams []unsafe.Pointer,
    scratchLimit uint64,
    gds Gds,
) (*Executor, error)

Empty devices take every listed device of the first vendor with a known class. Arenas live on the first device, where every call computes but a filtered scan, which deals its pages across every device.

Streams are empty, or one per device in devices order, a cudaStream_t, hipStream_t or id<MTLCommandQueue> on that device, which the executor adopts: on success a CUDA or HIP stream becomes the executor's, which synchronizes and destroys it when it closes, while a Metal queue is retained, the executor releasing its own reference and the caller keeping theirs; on failure every stream stays the caller's. A nil or default stream, a device named twice beside streams, or streams beside empty devices answer StatusInvalidArgument, and a stream on another device than its entry names answers StatusConfigMismatch. Zero scratchLimit lets each device's scratch grow, gds is how reads and compactions move bytes between the drives and the devices, and a gpuClassCeiling some named device loads nothing under answers StatusUnsupported.

CloseClose waits out the call holding the executor, then releases its threads, rings or streams; every arena it made must be closed first, or it fails with StatusContended and frees nothing, so a later Close retries.
types.go:1210 ↗
func (executor *Executor) Close() error

It is idempotent; a closed executor must not be used again.

DrainDrain waits until no call holds the executor, then adopts mood until its next call; it only waits and never runs a call itself.
types.go:803 ↗
func (executor *Executor) Drain(mood Mood) error

A failure is the executor's own, never one of a drained call.

EnumGPUClassGPUClass is a GPU generation UStore tells apart; a class implies its vendor, and the zero value sets no ceiling.2
types.go:416 ↗
type GPUClass int32

Values

GPUClassUnknownGPUClassUnknown is no class.
GPUClassNVIDIAAmpereGPUClassNVIDIAAmpere is Ampere-class NVIDIA, and every later GPU that compiles its PTX.
GPUClassNVIDIAAdaGPUClassNVIDIAAda is Ada-class NVIDIA.
GPUClassNVIDIAHopperGPUClassNVIDIAHopper is Hopper-class NVIDIA.
GPUClassNVIDIABlackwellGPUClassNVIDIABlackwell is Blackwell-class NVIDIA.
GPUClassNVIDIABlackwellRTXGPUClassNVIDIABlackwellRTX is consumer Blackwell NVIDIA.
GPUClassAMDCDNA3GPUClassAMDCDNA3 is CDNA3 AMD, gfx942.
GPUClassAMDCDNA4GPUClassAMDCDNA4 is CDNA4 AMD, gfx950.
GPUClassAMDCDNA5GPUClassAMDCDNA5 is CDNA5 AMD, gfx1250.
GPUClassAppleMetal7GPUClassAppleMetal7 is Apple7-family GPUs, and every Apple GPU without a class of its own.
GPUClassAppleMetal9GPUClassAppleMetal9 is Apple9-family GPUs.
GPUClassAppleMetal10GPUClassAppleMetal10 is Apple10-family GPUs.
GPUClassFromNameGPUClassFromName reads a GPU class back from the spelling GPUClass.String renders.
types.go:451 ↗
func GPUClassFromName(name string) (GPUClass, error)
StringString renders the class as the library spells it, such as "amd-cdna3".
types.go:446 ↗
func (class GPUClass) String() string
StructGPUDeviceGPUDevice is one GPU as UStore numbers it: its position in GPUDevices is the ordinal ExecutorForVram names it by.1
types.go:822 ↗
type GPUDevice struct {
    Vendor GPUVendor
    VendorOrdinal uint32
    GPUClass GPUClass
    ComputeUnits uint32
    MemoryBytes uint64
    Name string
}

Fields

VendorGPUVendorVendor is the vendor whose runtime drives the device.
VendorOrdinaluint32VendorOrdinal is the device's ordinal in its vendor's runtime.
GPUClassGPUClassGPUClass is the newest class this build compiled code for that runs on the device.
ComputeUnitsuint32ComputeUnits counts streaming multiprocessors, compute units or GPU cores.
MemoryBytesuint64MemoryBytes is the device memory, or the working set Metal recommends for unified memory.
NamestringName is the vendor's own name for the device.
GPUDevicesGPUDevices lists every GPU this process can drive, NVIDIA devices first, then AMD, then Apple, and nothing on a machine without GPUs.
types.go:839 ↗
func GPUDevices() ([]GPUDevice, error)
EnumGPUVendorGPUVendor is a GPU vendor one binary drives, each through a runtime opened on first use.1
types.go:396 ↗
type GPUVendor int32

Values

GPUVendorUnknownGPUVendorUnknown names no vendor.
GPUVendorNVIDIAGPUVendorNVIDIA drives NVIDIA devices through the CUDA driver.
GPUVendorAMDGPUVendorAMD drives AMD devices through the HIP runtime.
GPUVendorAppleGPUVendorApple drives Apple devices through Metal.
StringString renders the vendor as the library spells it.
types.go:410 ↗
func (vendor GPUVendor) String() string
EnumGdsGds is how a VRAM executor moves bytes through GPUDirect Storage, between the drives and its device.2
types.go:373 ↗
type Gds int32

Values

GdsAutomaticGdsAutomatic transfers directly where the driver is loaded, and through cuFile's compatibility mode elsewhere.
GdsDirectGdsDirect transfers directly, refused with StatusDevice where the driver is absent.
GdsCompatibilityGdsCompatibility bounces through host pages cuFile manages.
GdsFromNameGdsFromName reads a GPUDirect Storage mode back from the spelling Gds.String renders.
types.go:389 ↗
func GdsFromName(name string) (Gds, error)
StringString renders the mode as the library spells it.
types.go:386 ↗
func (gds Gds) String() string
StructGraphVerticesCursorGraphVerticesCursor walks the vertices of one graph collection page by page, every pull resuming past the last vertex the pull before it handed out.1
graph.go:479 ↗
type GraphVerticesCursor struct {
    GraphVerticesCursorOn
    // contains filtered or unexported fields
}
Next*NextKeys× 2NextKeys pulls up to wanted vertices of the walk into arena.
graph.go:532 ↗

Inherited from GraphVerticesCursorOn

func (on GraphVerticesCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Page, error)
StructGraphVerticesCursorOnGraphVerticesCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a GraphVerticesCursor, or on an executor when GraphVerticesCursorOn.On makes it.
graph.go:488 ↗
type GraphVerticesCursorOn struct {
    // contains filtered or unexported fields
}
EnumHostAccessHostAccess is whether Go code may read an arena's outputs, which every verb checks before it views them as Go slices.1
types.go:472 ↗
type HostAccess int32

Values

HostAccessRefusedHostAccessRefused is memory host code must not read.
HostAccessReadableHostAccessReadable is host, pinned, managed and Apple's shared memory, read in place.
StringString renders the host access as the library spells it.
types.go:482 ↗
func (access HostAccess) String() string
StructIngestIngest lands every row appended to it into one collection as one commit of its own, joining no transaction; its calls run one at a time, on the calling goroutine, or on an executor through IngestOn.On.4
db.go:1966 ↗
type Ingest struct {
    IngestOn
    // contains filtered or unexported fields
}
CloseClose frees the ingest, dropping every row of an unfinished one.
db.go:2080 ↗
func (ingest *Ingest) Close() error

It is idempotent.

*Append× 2Append hands the ingest one batch of rows, copied or written before it returns, parsing values over the executor's threads.
db.go:2030 ↗

Inherited from IngestOn

func (on Ingest) Append(rows IngestRows) error
*Finish× 2Finish lands every row appended as one commit and ends the ingest, answering the one stamp every row landed at.
db.go:2060 ↗

Inherited from IngestOn

func (on Ingest) Finish(
    durability Durability,
) (CommitStamp, error)
*On× 2On is the receiver whose calls block on executor.
db.go:1978 ↗

Inherited from IngestOn

func (on Ingest) On(executor *Executor) IngestOn
StructIngestOnIngestOn is the receiver whose appends and finish block until their call is final: on the calling goroutine when embedded in an Ingest, and on an executor when IngestOn.On makes it.
db.go:1973 ↗
type IngestOn struct {
    // contains filtered or unexported fields
}
EnumMoodMood is what an executor's threads do between a drain and its next call.2
types.go:280 ↗
type Mood int32

Values

MoodParkedMoodParked sleeps in the kernel until the next call, freeing the cores.
MoodSpinningMoodSpinning keeps polling, trading the cores for the lowest wake-up latency.
MoodFromNameMoodFromName reads a mood back from the spelling Mood.String renders.
types.go:293 ↗
func MoodFromName(name string) (Mood, error)
StringString renders the mood as the library spells it.
types.go:290 ↗
func (mood Mood) String() string
StructPagesCursorPagesCursor walks the pages of one collection page by page, every pull resuming past the last key the pull before it handed out.2
pages.go:590 ↗
type PagesCursor struct {
    PagesCursorOn
    // contains filtered or unexported fields
}
Next*NextKeys× 2NextKeys pulls up to wanted page keys of the walk into arena.
pages.go:643 ↗

Inherited from PagesCursorOn

func (on PagesCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Page, error)
Next*NextPairs× 2NextPairs pulls up to wanted page keys of the walk with their pages rendered as outputsEncoding into arena.
pages.go:655 ↗

Inherited from PagesCursorOn

func (on PagesCursor) NextNextPairs(
    wanted uint,
    outputsEncoding PageEncoding,
    arena *Arena,
) (Page, error)
StructPagesCursorOnPagesCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a PagesCursor, and on an executor when PagesCursorOn.On makes it.
pages.go:598 ↗
type PagesCursorOn struct {
    // contains filtered or unexported fields
}
StructSnapshotSnapshot pins the state it was taken at until Snapshot.Close, and its own verbs read that state on the calling goroutine; nothing writes through it.32
db.go:1289 ↗
type Snapshot struct {
    SnapshotOn
    // contains filtered or unexported fields
}
CloseClose releases the snapshot once every deferred call naming it is final, unpinning the versions only it kept.
db.go:1331 ↗
func (snapshot *Snapshot) Close() error

It is idempotent.

ReadStampReadStamp reports the stamp the snapshot reads at, which every commit at or below it shows.
db.go:1327 ↗
func (snapshot *Snapshot) ReadStamp() ReadStamp
BlobsCursor*BlobsCursorInit× 2BlobsCursorInit opens a walk over collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on; every pull names its own executor through On.
db.go:417 ↗

Inherited from reads[Handle]

func (on Snapshot) BlobsCursorBlobsCursorInit(
    collection CollectionID,
    startKey Key,
    config *BlobsCursorConfig,
) (*BlobsCursor, error)
Blobs*BlobsMeasure× 2BlobsMeasure estimates the entries and the space inside a range per task into arena, one task per collection collections names, without walking them.
db.go:552 ↗

Inherited from reads[Handle]

func (on Snapshot) BlobsBlobsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
Blobs*BlobsRead× 2BlobsRead reads one value per key into arena, a missing key reading as absent.
db.go:255 ↗

Inherited from reads[Handle]

func (on Snapshot) BlobsBlobsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *BlobsReadConfig,
) (Values, error)
Blobs*BlobsSample× 2BlobsSample draws up to wanted keys uniformly at random into arena, one task per collection collections names.
db.go:513 ↗

Inherited from reads[Handle]

func (on Snapshot) BlobsBlobsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
Blobs*BlobsScan× 2BlobsScan lists up to wanted keys of a range per task into arena, one task per collection collections names.
db.go:322 ↗

Inherited from reads[Handle]

func (on Snapshot) BlobsBlobsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *BlobsScanConfig,
) (Scanned, error)
Collection*CollectionFind× 2CollectionFind resolves a batch of names into the collections they address, into arena.
db.go:1537 ↗

Inherited from reads[Handle]

func (on Snapshot) CollectionCollectionFind(
    names Tape,
    arena *Arena,
) (FoundCollections, error)
Collection*CollectionList× 2CollectionList lists every collection the receiver sees, with its modality and name, into arena.
db.go:1478 ↗

Inherited from reads[Handle]

func (on Snapshot) CollectionCollectionList(
    arena *Arena,
) (CollectionList, error)
DocsCursor*DocsCursorInit× 2DocsCursorInit opens a walk over collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on.
db.go:587 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsCursorDocsCursorInit(
    collection CollectionID,
    startKey Key,
    config *DocsCursorConfig,
) (*DocsCursor, error)
Docs*DocsGather× 2DocsGather reads, type-checks and converts one column per field of the documents keys name into arena, converting field i into outputsTypes[i].
db.go:424 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsDocsGather(
    collections Collections,
    keys []Key,
    fields Tape,
    outputsTypes []DocsFieldType,
    arena *Arena,
) (Columns, error)
Docs*DocsGist× 2DocsGist lists the unique paths to the leaves of the documents keys name into arena.
db.go:301 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsDocsGist(
    collections Collections,
    keys []Key,
    arena *Arena,
) (Paths, error)
Docs*DocsMeasure× 2DocsMeasure estimates the documents and the space inside a range per task into arena, one task per collection collections names.
db.go:740 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsDocsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
Docs*DocsRead× 2DocsRead reads whole documents or fields inside them into arena, a missing one reading as absent.
db.go:240 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsDocsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *DocsReadConfig,
) (Values, error)
Docs*DocsSample× 2DocsSample draws up to wanted document keys uniformly at random into arena, one task per collection collections names.
db.go:701 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsDocsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
Docs*DocsScan× 2DocsScan lists up to wanted document keys of a range per task into arena, one task per collection collections names.
db.go:493 ↗

Inherited from reads[Handle]

func (on Snapshot) DocsDocsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *DocsScanConfig,
) (Scanned, error)
GraphMeasure*GraphMeasureVertices× 2GraphMeasureVertices estimates the vertices and the space inside a range per task into arena, one task per collection collections names.
db.go:609 ↗

Inherited from reads[Handle]

func (on Snapshot) GraphMeasureGraphMeasureVertices(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
GraphRead*GraphReadEdges× 2GraphReadEdges reads the degree and the edges of every vertex in its roles into arena.
db.go:170 ↗

Inherited from reads[Handle]

func (on Snapshot) GraphReadGraphReadEdges(
    collections Collections,
    vertices []Key,
    roles Roles,
    arena *Arena,
) (Neighborhoods, error)
GraphSample*GraphSampleVertices× 2GraphSampleVertices draws up to wanted vertices uniformly at random into arena, one task per collection collections names.
db.go:570 ↗

Inherited from reads[Handle]

func (on Snapshot) GraphSampleGraphSampleVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
GraphScan*GraphScanVertices× 2GraphScanVertices lists up to wanted vertices of a range per task into arena, one task per collection collections names.
db.go:414 ↗

Inherited from reads[Handle]

func (on Snapshot) GraphScanGraphScanVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *GraphScanConfig,
) (Scanned, error)
GraphVerticesCursor*GraphVerticesCursorInit× 2GraphVerticesCursorInit opens a walk over the vertices of collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on.
db.go:500 ↗

Inherited from reads[Handle]

func (on Snapshot) GraphVerticesCursorGraphVerticesCursorInit(
    collection CollectionID,
    startKey Key,
    config *GraphVerticesCursorConfig,
) (*GraphVerticesCursor, error)
PagesCursor*PagesCursorInit× 2PagesCursorInit opens a walk over collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on.
db.go:610 ↗

Inherited from reads[Handle]

func (on Snapshot) PagesCursorPagesCursorInit(
    collection CollectionID,
    startKey Key,
    config *PagesCursorConfig,
) (*PagesCursor, error)
Pages*PagesMeasure× 2PagesMeasure estimates the pages and the space inside a range per task into arena, one task per collection collections names.
db.go:744 ↗

Inherited from reads[Handle]

func (on Snapshot) PagesPagesMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
Pages*PagesRead× 2PagesRead renders whole pages or subtrees into arena, a missing one reading as absent.
db.go:455 ↗

Inherited from reads[Handle]

func (on Snapshot) PagesPagesRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *PagesReadConfig,
) (Values, error)
Pages*PagesSample× 2PagesSample draws up to wanted page keys uniformly at random into arena, one task per collection collections names.
db.go:705 ↗

Inherited from reads[Handle]

func (on Snapshot) PagesPagesSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
Pages*PagesScan× 2PagesScan lists up to wanted page keys of a range per task into arena, one task per collection collections names.
db.go:522 ↗

Inherited from reads[Handle]

func (on Snapshot) PagesPagesScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *PagesScanConfig,
) (Scanned, error)
*Save× 2Save writes the snapshot out as a new database of the same engine at path, holding exactly the collections and names it records; a cancelled save removes what it wrote.
db.go:1342 ↗

Inherited from SnapshotOn

func (on Snapshot) Save(
    path string,
    progress ProgressCallback,
) error
StringsCursor*StringsCursorInit× 2StringsCursorInit opens a walk over collection, copying its prefix and bounds, reading nothing until its first pull and blocking whatever receiver it is called on.
db.go:358 ↗

Inherited from reads[Handle]

func (on Snapshot) StringsCursorStringsCursorInit(
    collection CollectionID,
    config *StringsCursorConfig,
) (*StringsCursor, error)
Strings*StringsMeasure× 2StringsMeasure estimates the entries and the space inside a range of strings per task into arena, one task per collection collections names.
db.go:532 ↗

Inherited from reads[Handle]

func (on Snapshot) StringsStringsMeasure(
    collections Collections,
    arena *Arena,
    config *StringsMeasureConfig,
) (Measurement, error)
Strings*StringsRead× 2StringsRead looks up the key every string maps onto into arena.
db.go:151 ↗

Inherited from reads[Handle]

func (on Snapshot) StringsStringsRead(
    collections Collections,
    strings Tape,
    arena *Arena,
) (Mapped, error)
Strings*StringsSample× 2StringsSample draws up to wanted strings uniformly at random into arena, one task per collection collections names.
db.go:482 ↗

Inherited from reads[Handle]

func (on Snapshot) StringsStringsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Listing, error)
Strings*StringsScan× 2StringsScan lists up to wanted strings per task into arena, one task per collection collections names.
db.go:257 ↗

Inherited from reads[Handle]

func (on Snapshot) StringsStringsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *StringsScanConfig,
) (Listing, error)
StructSnapshotDeferredOnSnapshotDeferredOn is the receiver whose verbs submit their calls to an executor, offering the verbs of SnapshotOn with the same arguments.25
db.go:725 ↗
type SnapshotDeferredOn struct {
    // contains filtered or unexported fields
}
SaveSave submits SnapshotOn.Save.
db.go:1349 ↗
func (on SnapshotDeferredOn) Save(
    path string,
    progress ProgressCallback,
) (*Deferred[struct{}], error)
BlobsMeasureBlobsMeasure submits DatabaseOn.BlobsMeasure.
db.go:558 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) BlobsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
BlobsReadBlobsRead submits DatabaseOn.BlobsRead.
db.go:261 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) BlobsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *BlobsReadConfig,
) (*Deferred[Values], error)
BlobsSampleBlobsSample submits DatabaseOn.BlobsSample.
db.go:519 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) BlobsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
BlobsScanBlobsScan submits DatabaseOn.BlobsScan.
db.go:328 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) BlobsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *BlobsScanConfig,
) (*Deferred[Scanned], error)
CollectionFindCollectionFind submits DatabaseOn.CollectionFind.
db.go:1543 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) CollectionFind(
    names Tape,
    arena *Arena,
) (*Deferred[FoundCollections], error)
CollectionListCollectionList submits DatabaseOn.CollectionList.
db.go:1484 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) CollectionList(
    arena *Arena,
) (*Deferred[CollectionList], error)
DocsGatherDocsGather submits DatabaseOn.DocsGather.
db.go:430 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) DocsGather(
    collections Collections,
    keys []Key,
    fields Tape,
    outputsTypes []DocsFieldType,
    arena *Arena,
) (*Deferred[Columns], error)
DocsGistDocsGist submits DatabaseOn.DocsGist.
db.go:307 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) DocsGist(
    collections Collections,
    keys []Key,
    arena *Arena,
) (*Deferred[Paths], error)
DocsMeasureDocsMeasure submits DatabaseOn.DocsMeasure.
db.go:746 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) DocsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
DocsReadDocsRead submits DatabaseOn.DocsRead.
db.go:246 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) DocsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *DocsReadConfig,
) (*Deferred[Values], error)
DocsSampleDocsSample submits DatabaseOn.DocsSample.
db.go:707 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) DocsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
DocsScanDocsScan submits DatabaseOn.DocsScan.
db.go:499 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) DocsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *DocsScanConfig,
) (*Deferred[Scanned], error)
GraphMeasureVerticesGraphMeasureVertices submits DatabaseOn.GraphMeasureVertices.
db.go:615 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) GraphMeasureVertices(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
GraphReadEdgesGraphReadEdges submits DatabaseOn.GraphReadEdges.
db.go:176 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) GraphReadEdges(
    collections Collections,
    vertices []Key,
    roles Roles,
    arena *Arena,
) (*Deferred[Neighborhoods], error)
GraphSampleVerticesGraphSampleVertices submits DatabaseOn.GraphSampleVertices.
db.go:576 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) GraphSampleVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
GraphScanVerticesGraphScanVertices submits DatabaseOn.GraphScanVertices.
db.go:420 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) GraphScanVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *GraphScanConfig,
) (*Deferred[Scanned], error)
PagesMeasurePagesMeasure submits DatabaseOn.PagesMeasure.
db.go:750 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) PagesMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
PagesReadPagesRead submits DatabaseOn.PagesRead.
db.go:461 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) PagesRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *PagesReadConfig,
) (*Deferred[Values], error)
PagesSamplePagesSample submits DatabaseOn.PagesSample.
db.go:711 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) PagesSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
PagesScanPagesScan submits DatabaseOn.PagesScan.
db.go:528 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) PagesScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *PagesScanConfig,
) (*Deferred[Scanned], error)
StringsMeasureStringsMeasure submits DatabaseOn.StringsMeasure.
db.go:538 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) StringsMeasure(
    collections Collections,
    arena *Arena,
    config *StringsMeasureConfig,
) (*Deferred[Measurement], error)
StringsReadStringsRead submits DatabaseOn.StringsRead.
db.go:157 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) StringsRead(
    collections Collections,
    strings Tape,
    arena *Arena,
) (*Deferred[Mapped], error)
StringsSampleStringsSample submits DatabaseOn.StringsSample.
db.go:488 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) StringsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Listing], error)
StringsScanStringsScan submits DatabaseOn.StringsScan.
db.go:263 ↗

Inherited from deferredReads[Handle]

func (on SnapshotDeferredOn) StringsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *StringsScanConfig,
) (*Deferred[Listing], error)
StructSnapshotOnSnapshotOn is the receiver whose verbs block until their call is final, reading the state a snapshot pinned; nothing writes through it.
db.go:719 ↗
type SnapshotOn struct {
    // contains filtered or unexported fields
}
StructStringsCursorStringsCursor walks the strings of one collection page by page, in the order of their text, every pull resuming past the last string the pull before it handed out.2
strings.go:337 ↗
type StringsCursor struct {
    StringsCursorOn
    // contains filtered or unexported fields
}
Next*NextPairs× 2NextPairs pulls up to wanted strings of the walk with the keys they map onto into arena.
strings.go:433 ↗

Inherited from StringsCursorOn

func (on StringsCursor) NextNextPairs(
    wanted uint,
    arena *Arena,
) (StringsPage, error)
Next*NextStrings× 2NextStrings pulls up to wanted strings of the walk into arena.
strings.go:422 ↗

Inherited from StringsCursorOn

func (on StringsCursor) NextNextStrings(
    wanted uint,
    arena *Arena,
) (StringsPage, error)
StructStringsCursorOnStringsCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a StringsCursor, or on an executor that StringsCursorOn.On picks.
strings.go:346 ↗
type StringsCursorOn struct {
    // contains filtered or unexported fields
}
StructTransactionTransaction groups reads and writes across collections and modalities, and commits all of them or none.8
db.go:1581 ↗
type Transaction struct {
    TransactionOn
    // contains filtered or unexported fields
}

Its own verbs run on the calling goroutine and watch the keys they touch, while Transaction.View picks another watch. It serves one call at a time and holds its database open until Transaction.Close.

CloseClose releases the transaction once every deferred call naming it is final, dropping whatever it did not commit.
db.go:1620 ↗
func (transaction *Transaction) Close() error

It is idempotent.

ViewView is the receiver whose reads and writes, on the calling goroutine, record their keys under watch.
db.go:1612 ↗
func (transaction *Transaction) View(watch Watch) TransactionOn
*Commit× 2Commit lands every change of the transaction at once, or none of them with a conflict status, answering its position in commit order.
db.go:1686 ↗

Inherited from TransactionOn

func (on Transaction) Commit(
    durability Durability,
) (CommitStamp, error)
*Deferred× 2Deferred is the receiver whose verbs submit their calls to executor, under the same watch.
db.go:712 ↗

Inherited from TransactionOn

func (on Transaction) Deferred(
    executor *Executor,
) TransactionDeferredOn
*On× 2On is the receiver whose verbs block on executor, under the same watch.
db.go:706 ↗

Inherited from TransactionOn

func (on Transaction) On(executor *Executor) TransactionOn
*Reset× 2Reset reopens the transaction on the newest state for another try, dropping its contents.
db.go:1630 ↗

Inherited from TransactionOn

func (on Transaction) Reset() error
*Rollback× 2Rollback withdraws a stage while keeping the reads and writes, so that the transaction can stage again.
db.go:1718 ↗

Inherited from TransactionOn

func (on Transaction) Rollback() error
*Stage× 2Stage validates the transaction and holds its keys, answering the stamp it reads at and its commit validates against.
db.go:1655 ↗

Inherited from TransactionOn

func (on Transaction) Stage() (ReadStamp, error)
StructTransactionOnTransactionOn is the receiver whose verbs block until their call is final, reading and writing inside a transaction under one Watch.
db.go:695 ↗
type TransactionOn struct {
    // contains filtered or unexported fields
}
EnumTransportTransport is how the NVMe engine moves bytes between its files and memory.2
types.go:343 ↗
type Transport int32

Values

TransportAutomaticTransportAutomatic takes io_uring where the kernel offers it, Linux AIO where it offers only that, and blocking calls elsewhere.
TransportBlockingTransportBlocking takes positioned reads and writes that block the polling thread.
TransportLinuxUringTransportLinuxUring takes io_uring on unbuffered files.
TransportLinuxAIOTransportLinuxAIO takes Linux AIO on unbuffered files.
TransportLinuxSPDKTransportLinuxSPDK takes SPDK's user-space driver on NVMe devices the process owns.
TransportFromNameTransportFromName reads a transport back from the spelling Transport.String renders.
types.go:365 ↗
func TransportFromName(name string) (Transport, error)
StringString renders the transport as the library spells it.
types.go:360 ↗
func (transport Transport) String() string