ISubspaceLocation<TSubspace>
Namespace: FoundationDB.Client · interface
Implements: ISubspaceLocation, IEquatable<ISubspaceLocation>
Represents the path to a typed subspace in the database
Methods
Resolve
ValueTask<TSubspace> Resolve(IFdbReadOnlyTransaction tr, FdbDirectoryLayer directory = null)
Returns the actual subspace that corresponds to this location, or throws if it does not exist.
tr— Current transactiondirectory— DirectoryLayer instance to use for the resolve. If null, uses the default database directory layer.
Returns: Key subspace using the resolved key prefix of this location in the context of the current transaction
The instance resolved for this transaction SHOULD NOT be used in the context of a different transaction, because its location in the Directory Layer may have been changed concurrently!
Re-using cached subspace instances MAY lead to DATA CORRUPTION if not used carefully! The best practice is to call Resolve() every time it is needed by a new transaction.
TryResolve
ValueTask<TSubspace> TryResolve(IFdbReadOnlyTransaction tr, FdbDirectoryLayer directory = null)
Returns the actual subspace that corresponds to this location, if it exists.
tr— Current transactiondirectory— DirectoryLayer instance to use for the resolve. If null, uses the default database directory layer.
Returns: Key subspace using the resolved key prefix of this location in the context of the current transaction, or null if the directory does not exist
The instance resolved for this transaction SHOULD NOT be used in the context of a different transaction, because its location in the Directory Layer may have been changed concurrently!
Re-using cached subspace instances MAY lead to DATA CORRUPTION if not used carefully! The best practice is to call TryResolve() every time it is needed by a new transaction.