Skip to content

SingleBufferStoreV2

Defined in: src/backends/single_buffer/v2.ts:630

A store for version 2 of the single-buffer format.

Every change is a transaction that copies what it modifies. Readers never block, and an interrupted writer does not change the file system.

  • DataView<ArrayBufferLike>

new SingleBufferStoreV2(buffer, byteOffset?, byteLength?, options?): SingleBufferStore

Defined in: src/backends/single_buffer/v2.ts:671

Opens a file system, or creates one if format is set. When creating one, byte ranges in used are kept, and the first transaction runs populate after making everything else free.

ArrayBufferLike | ArrayBufferView<ArrayBufferLike>

number = 0

number

SingleBufferStoreOptions = {}

SingleBufferStore

DataView<ArrayBufferLike>.constructor

protected optional _fs?: StoreFS<Store>

Defined in: src/backends/single_buffer/v2.ts:898


readonly [toStringTag]: string

Defined in: ../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:274

DataView.[toStringTag]


readonly blockSize: number

Defined in: src/backends/single_buffer/v2.ts:648

Internal


readonly buffer: ArrayBufferLike

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1745

DataView.buffer


readonly byteLength: number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1746

DataView.byteLength


readonly byteOffset: number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1747

DataView.byteOffset


readonly bytes: Uint8Array

Defined in: src/backends/single_buffer/v2.ts:645

Internal

The entire file system


protected readonly commits: [Commit, Commit]

Defined in: src/backends/single_buffer/v2.ts:656


readonly epochs: EpochTable

Defined in: src/backends/single_buffer/v2.ts:651

Internal


readonly flags: readonly ["partial", "atomic"]

Defined in: src/backends/single_buffer/v2.ts:631

Use for optimizations

SyncMapStore.flags


protected readonly generation: BigInt64Array

Defined in: src/backends/single_buffer/v2.ts:654


protected readonly index: BPlusTree<bigint, DataExtent>

Defined in: src/backends/single_buffer/v2.ts:662

The index of the version being read


protected readonly mutex: Mutex

Defined in: src/backends/single_buffer/v2.ts:653


readonly name: "sbfs" = 'sbfs'

Defined in: src/backends/single_buffer/v2.ts:632

What the file system using this store should be called. For example, tmpfs for an in memory store

SyncMapStore.name


protected readonly nextId: BigInt64Array

Defined in: src/backends/single_buffer/v2.ts:655


protected optional pinned?: object

Defined in: src/backends/single_buffer/v2.ts:665

Pins the oldest version read by this thread’s unfinished reads

release: () => void

void

users: number


readonly readOnly: BPlusTreeStorage

Defined in: src/backends/single_buffer/v2.ts:659

Internal


protected readonly superblock: SuperBlock

Defined in: src/backends/single_buffer/v2.ts:639


readonly type: 1935828595 = 0x73626673

Defined in: src/backends/single_buffer/v2.ts:633

FileSystem#id

SyncMapStore.type

get uuid(): `${string}-${string}-${string}-${string}-${string}`

Defined in: src/backends/single_buffer/v2.ts:635

A UUID for this instance of the store.

`${string}-${string}-${string}-${string}-${string}`

A UUID for this instance of the store.

SyncMapStore.uuid

allocId(): [ino: number, data: number]

Defined in: src/backends/single_buffer/v2.ts:885

Allocate IDs for a new inode + data

[ino: number, data: number]

SyncMapStore.allocId


copy(extent, offset, end?): Uint8Array<ArrayBufferLike> | undefined

Defined in: src/backends/single_buffer/v2.ts:871

Internal

Copies the bytes of an extent from offset to end

Extent | undefined

number

number

Uint8Array<ArrayBufferLike> | undefined


delete(id): void

Defined in: src/backends/single_buffer/v2.ts:881

number

void

SyncMapStore.delete


get(id, offset?, end?): Uint8Array<ArrayBufferLike> | undefined

Defined in: src/backends/single_buffer/v2.ts:863

number

number = 0

number

Uint8Array<ArrayBufferLike> | undefined

SyncMapStore.get


getBigInt64(byteOffset, littleEndian?): bigint

Defined in: ../../node_modules/typescript/lib/lib.es2020.bigint.d.ts:732

Gets the BigInt64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

bigint

DataView.getBigInt64


getBigUint64(byteOffset, littleEndian?): bigint

Defined in: ../../node_modules/typescript/lib/lib.es2020.bigint.d.ts:740

Gets the BigUint64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

bigint

DataView.getBigUint64


getFloat16(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es2025.float16.d.ts:434

Gets the Float16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getFloat16


getFloat32(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1754

Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getFloat32


getFloat64(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1762

Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getFloat64


getInt16(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1777

Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getInt16


getInt32(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1784

Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getInt32


getInt8(byteOffset): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1769

Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

number

DataView.getInt8


getUint16(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1799

Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getUint16


getUint32(byteOffset, littleEndian?): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1807

Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

boolean

If false or undefined, a big-endian value should be read.

number

DataView.getUint32


getUint8(byteOffset): number

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1791

Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

number

The place in the buffer at which the value should be retrieved.

number

DataView.getUint8


keys(): number[]

Defined in: src/backends/single_buffer/v2.ts:859

number[]

SyncMapStore.keys


protected read<T>(read): T

Defined in: src/backends/single_buffer/v2.ts:827

Runs read against the current version

T

(index) => T

T


set(id, data, offset?): void

Defined in: src/backends/single_buffer/v2.ts:877

number

Uint8Array

number

void

SyncMapStore.set


setBigInt64(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es2020.bigint.d.ts:748

Stores a BigInt64 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

bigint

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setBigInt64


setBigUint64(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es2020.bigint.d.ts:756

Stores a BigUint64 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

bigint

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setBigUint64


setFloat16(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es2025.float16.d.ts:442

Stores an Float16 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setFloat16


setFloat32(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1815

Stores an Float32 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setFloat32


setFloat64(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1823

Stores an Float64 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setFloat64


setInt16(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1838

Stores an Int16 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setInt16


setInt32(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1846

Stores an Int32 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setInt32


setInt8(byteOffset, value): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1830

Stores an Int8 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

void

DataView.setInt8


setUint16(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1861

Stores an Uint16 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setUint16


setUint32(byteOffset, value, littleEndian?): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1869

Stores an Uint32 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

boolean

If false or undefined, a big-endian value should be written.

void

DataView.setUint32


setUint8(byteOffset, value): void

Defined in: ../../node_modules/typescript/lib/lib.es5.d.ts:1853

Stores an Uint8 value at the specified byte offset from the start of the view.

number

The place in the buffer at which the value should be set.

number

The value to set.

void

DataView.setUint8


snapshot(): Snapshot

Defined in: src/backends/single_buffer/v2.ts:797

Internal

Pins the current version, which stays readable until the snapshot is disposed. Snapshots in the same thread share one pin of the oldest version.

Snapshot


sync(): Promise<void>

Defined in: src/backends/single_buffer/v2.ts:909

Syncs the store

Promise<void>

SyncMapStore.sync


transaction(): SingleBufferTransaction

Defined in: src/backends/single_buffer/v2.ts:913

Begins a new transaction.

SingleBufferTransaction

SyncMapStore.transaction


usage(): UsageInfo

Defined in: src/backends/single_buffer/v2.ts:891

Usage information for the store

UsageInfo

SyncMapStore.usage


protected withCurrentCommit<T>(read): T

Defined in: src/backends/single_buffer/v2.ts:784

Reads the current commit, retrying if a writer replaces it while reading

T

(commit, generation) => T

T


write<T>(change): T

Defined in: src/backends/single_buffer/v2.ts:834

Runs change in a write transaction, retrying with more spare blocks if the free trees run out of them

T

(tx) => T

T