SubspaceLocation

Namespace: FoundationDB.Client · class

Implements: SubspaceLocation<IKeySubspace>, ISubspaceLocation<IKeySubspace>, ISubspaceLocation, IEquatable<ISubspaceLocation>, IFdbLayer<IKeySubspace, FdbDirectoryLayer>, IFdbLayer, IEquatable<SubspaceLocation>

Factory methods for creating locations in the keyspace of a FoundationDB database.

Constructors

SubspaceLocation

SubspaceLocation(FdbPath path, Slice prefix = null)

Methods

Equals

bool Equals(ISubspaceLocation other)

bool Equals(SubspaceLocation other)

FromPath

static ISubspaceLocation FromPath(FdbPath path)

FromPrefix

static SubspaceLocation FromPrefix(Slice key)

Creates a location for dynamic keys, that uses a fixed binary prefix

GetHashCode

int GetHashCode()

TryResolve

ValueTask<IKeySubspace> TryResolve(IFdbReadOnlyTransaction tr, FdbDirectoryLayer directory = null)

Resolves the subspace for this location, if it exists

  • tr — Transaction used for this operation.
  • directory — Optional Directory Layer to use; otherwise, uses the global instance for the transaction's database.

Returns: Resolved subspace if found; otherwise, null

The subspace may be cached, and be obsolete. The cache will add deferred value checks to the transaction, that will cause it to conflict and retry, if the directory has been deleted or has moved.

WithPrefix

static ISubspaceLocation WithPrefix(IVarTuple items)

Creates a location that uses a fixed prefix given by a tuple

static SubspaceLocation WithPrefix(ReadOnlySpan<byte> key)

Creates a location for dynamic keys, that uses a fixed binary prefix

Fields

Empty

static readonly SubspaceLocation Empty

Represent a location without any prefix, and outside the jurisdiction of the Directory Layer

Root

static readonly SubspaceLocation Root

Represent the root directory of the Directory Layer