FdbSystemKey

Namespace: FoundationDB.Client · struct

Implements: IFdbKey, ISpanEncodable, ISpanFormattable, IFormattable, IEquatable<FdbRawKey>, IComparable<FdbRawKey>, IEquatable<Slice>, IComparable<Slice>, IEquatable<IFdbKey>, IComparable, IEquatable<ReadOnlySpan<byte>>, IComparable<ReadOnlySpan<byte>>, IEquatable<FdbSystemKey>, IComparable<FdbSystemKey>

Wraps a Slice that wraps a key in either the System (`\xFF`) or Special Key (`\xFF\xFF`) subspaces

Methods

Bytes

FdbSystemKey Bytes(FdbRawKey suffix)

Appends the bytes of another key after the current key

  • suffix — Key whose binary representation will be appended to the current key

FdbSystemKey Bytes(Slice suffix)

Appends the bytes of another key after the current key

  • suffix — Bytes to append to the current key

FdbSystemKey Bytes(ReadOnlySpan<byte> suffix)

Appends the bytes of another key after the current key

  • suffix — Bytes to append to the current key

FdbSystemKey Bytes(string suffix)

Appends an ASCII string after the current key

  • suffix — String that must only contain ASCII bytes (0..127).

Suffix must only contain 7-bit ASCII characters. The only exception is the first character can be \xFF when appending to the System key (\xFF)

FdbSystemKey Bytes(ReadOnlySpan<char> suffix)

Appends an ASCII string after the current key

  • suffix — String that must only contain ASCII bytes (0..127).

Suffix must only contain 7-bit ASCII characters. The only exception is the first character can be \xFF when appending to the System key (\xFF)

CompareTo

int CompareTo(object obj)

int CompareTo(FdbSystemKey other)

int CompareTo(FdbRawKey other)

int CompareTo(Slice other)

int CompareTo(ReadOnlySpan<byte> other)

Contains

bool Contains(ReadOnlySpan<byte> key)

Tests if this key is a prefix of the given key

  • key — Key being tested

Returns: true if key starts with the same bytes as the current key; otherwise, false

The key foobar is contained inside foo because it starts with foo, but bar is NOT contained inside foo because it does not have the same prefix.

Any key contains "itself", so foo is contained inside foo

bool Contains<TOtherKey>(in TOtherKey key)

Tests if this key is a prefix of the given key

  • key — Key being tested

Returns: true if key starts with the same bytes as the current key; otherwise, false

The key foobar is contained inside foo because it starts with foo, but bar is NOT contained inside foo because it does not have the same prefix.

Any key contains "itself", so foo is contained inside foo

Equals

bool Equals(object other)

bool Equals(IFdbKey other)

bool Equals(FdbSystemKey other)

bool Equals(FdbRawKey other)

bool Equals(Slice other)

bool Equals(ReadOnlySpan<byte> other)

FastCompareTo

int FastCompareTo<TOtherKey>(in TOtherKey other)

FastEqualTo

bool FastEqualTo<TOtherKey>(in TOtherKey other)

GetHashCode

int GetHashCode()

ToSlice

Slice ToSlice()

Encodes this key into Slice

Returns: Slice that contains the binary representation of this key

SliceOwner ToSlice(ArrayPool<byte> pool)

Encodes this key into Slice

Returns: Slice that contains the binary representation of this key

ToString

string ToString()

string ToString(string format, IFormatProvider formatProvider = null)

TryEncode

bool TryEncode(Span<byte> destination, out int bytesWritten)

Encodes this instance into its equivalent binary representation in the database

  • destination — Destination buffer
  • bytesWritten — Number of bytes written to the buffer

Returns: true if the operation was successful and the buffer was large enough, or false if it was too small

TryFormat

bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider)

TryGetSizeHint

bool TryGetSizeHint(out int sizeHint)

Returns a quick estimate of the initial buffer size that would be large enough to encode this instance, in a single call to TryEncode

  • sizeHint — Receives an initial capacity that will satisfy almost all values. There is no guarantees that the size will be exact, and the estimate may be smaller or larger than the actual encoded size.

Returns: true if a size could be quickly computed; otherwise, false

TryGetSpan

bool TryGetSpan(out ReadOnlySpan<byte> span)

Returns the already encoded binary representation of the instance, if already available.

  • span — Points to the in-memory binary representation of the encoded key

Returns: true if the key has already been encoded, or it its in-memory layout is the same; otherwise, false

This is only intended to support pass-through or already encoded keys (via Slice), or when the binary representation has been cached to allow multiple uses.

Fields

BackupDataFormat

static readonly FdbSystemKey BackupDataFormat

`\xFF/backupDataFormat`

BackupEnabled

static readonly FdbSystemKey BackupEnabled

`\xFF/backupEnabled`

BulkDumpMode

static readonly FdbSystemKey BulkDumpMode

`\xFF/bulkDumpMode`

BulkLoadMode

static readonly FdbSystemKey BulkLoadMode

`\xFF/bulkLoadMode`

ClusterIdKey

static readonly FdbSystemKey ClusterIdKey

`\xFF/clusterIdKey`: Durable cluster ID key.

Added "Key" to the end to differentiate from the key // "\xff/clusterId" which was stored in the txnStateStore in FDB 7.1, whereas this key is stored in the database in 7.2+.

ConstructData

static readonly FdbSystemKey ConstructData

`\xFF/globals/constructData`

DataDistributionMode

static readonly FdbSystemKey DataDistributionMode

`\xFF/dataDistributionMode`

DbLocked

static readonly FdbSystemKey DbLocked

`\xFF/dbLocked`

FastLoggingEnabled

static readonly FdbSystemKey FastLoggingEnabled

`\xFF/globals/fastLoggingEnabled`

FastLoggingEnabledPrivate

static readonly FdbSystemKey FastLoggingEnabledPrivate

`\xFF\xFF/globals/fastLoggingEnabled`

IsSpecial

readonly bool IsSpecial

If true, uses the `\xFF\xFF` prefix (for special keys); otherwise, uses the `\xFF` prefix (for regular system keys)

KillStorage

static readonly FdbSystemKey KillStorage

`\xFF/globals/killStorage`

KillStoragePrivate

static readonly FdbSystemKey KillStoragePrivate

`\xFF\xFF/globals/killStorage`

LastEpochEnd

static readonly FdbSystemKey LastEpochEnd

`\xFF/globals/lastEpochEnd`

LastEpochEndPrivate

static readonly FdbSystemKey LastEpochEndPrivate

`\xFF\xFF/globals/lastEpochEnd`

Logs

static readonly FdbSystemKey Logs

`\xFF/logs`

MetadataVersion

static readonly FdbSystemKey MetadataVersion

`\xFF/metadataVersion`: contains the global metadata version for the database

See and for more details

MinRequiredCommitVersion

static readonly FdbSystemKey MinRequiredCommitVersion

`\xFF/minRequiredCommitVersion`

PrimaryLocality

static readonly FdbSystemKey PrimaryLocality

`\xFF/globals/primaryLocality`

PrimaryLocalityPrivate

static readonly FdbSystemKey PrimaryLocalityPrivate

`\xFF\xFF/globals/primaryLocality`

RebootWhenDurable

static readonly FdbSystemKey RebootWhenDurable

`\xFF/globals/killStorage`

RebootWhenDurablePrivate

static readonly FdbSystemKey RebootWhenDurablePrivate

`\xFF\xFF/globals/killStorage`

Special

static readonly FdbSystemKey Special

StatusJson

static readonly FdbSystemKey StatusJson

`\xFF\xFF/status/json: returns a JSON document describing the current status of the client and cluster.

See for more details.

SuffixBytes

readonly Slice SuffixBytes

Rest of the key (as bytes)

This is only present if is null

SuffixString

readonly string SuffixString

Rest of the key (as raw string)

If null then contains the rest of the key

System

static readonly FdbSystemKey System

TransactionConflictingKeys

static readonly FdbSystemKey TransactionConflictingKeys

`\xFF\xFF/transaction/conflicting_keys/...`

VersionEpoch

static readonly FdbSystemKey VersionEpoch

`\xFF/versionEpoch`