Skip to content

SingleBufferStoreV2

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

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:616

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:854


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:599

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:596

Internal

The entire file system


protected readonly commits: [Commit, Commit]

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


readonly epochs: EpochTable

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

Internal


readonly flags: readonly ["partial"]

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

Use for optimizations

SyncMapStore.flags


protected readonly generation: BigInt64Array

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


protected readonly index: BPlusTree<bigint, DataExtent>

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

The index of the version being read


protected readonly mutex: Mutex

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


readonly name: "sbfs" = 'sbfs'

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

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:606


protected readonly superblock: SuperBlock

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


readonly type: 1935828595 = 0x73626673

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

FileSystem#id

SyncMapStore.type

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

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

A UUID for this instance of the store.

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

A UUID for this instance of the store.

SyncMapStore.uuid

allocId(): [number, number]

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

Allocate IDs for a new inode + data

[number, number]

SyncMapStore.allocId


delete(id): void

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

number

void

SyncMapStore.delete


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

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

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:775

number[]

SyncMapStore.keys


protected read<T>(read): T

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

Runs read against the current version, which stays valid until read returns

T

(index) => T

T


set(id, data, offset?): void

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

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


sync(): Promise<void>

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

Syncs the store

Promise<void>

SyncMapStore.sync


transaction(): SyncMapTransaction

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

Begins a new transaction.

SyncMapTransaction

SyncMapStore.transaction


usage(): UsageInfo

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

Usage information for the store

UsageInfo

SyncMapStore.usage


protected withCurrentCommit<T>(read): T

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

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:750

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

T

(tx) => T

T